tangled
alpha
login
or
join now
directxman12.dev
/
proxy-in-anger
0
fork
atom
a (hacky, wip) multi-tenant oidc-terminating reverse proxy, written in anger on top of pingora
0
fork
atom
overview
issues
11
pulls
pipelines
add flake build output for deploying with nix
directxman12.dev
4 weeks ago
bc60ef60
a6effb61
+53
-2
3 changed files
expand all
collapse all
unified
split
.gitignore
flake.lock
flake.nix
+3
.gitignore
···
4
4
# vim
5
5
*~
6
6
*.swp
7
7
+
8
8
+
# nix
9
9
+
/result
+16
flake.lock
···
1
1
{
2
2
"nodes": {
3
3
+
"crane": {
4
4
+
"locked": {
5
5
+
"lastModified": 1771121070,
6
6
+
"narHash": "sha256-aIlv7FRXF9q70DNJPI237dEDAznSKaXmL5lfK/Id/bI=",
7
7
+
"owner": "ipetkov",
8
8
+
"repo": "crane",
9
9
+
"rev": "a2812c19f1ed2e5ed5ce2ef7109798b575c180e1",
10
10
+
"type": "github"
11
11
+
},
12
12
+
"original": {
13
13
+
"owner": "ipetkov",
14
14
+
"repo": "crane",
15
15
+
"type": "github"
16
16
+
}
17
17
+
},
3
18
"nixpkgs": {
4
19
"locked": {
5
20
"lastModified": 1771119812,
···
33
48
},
34
49
"root": {
35
50
"inputs": {
51
51
+
"crane": "crane",
36
52
"nixpkgs": "nixpkgs",
37
53
"rust-overlay": "rust-overlay"
38
54
}
+34
-2
flake.nix
···
1
1
{
2
2
-
description = "A replacement for the man tool";
2
2
+
description = "An oauth2/oidc1 proxy, written in anger";
3
3
4
4
# Flake inputs
5
5
inputs = {
6
6
nixpkgs.url = "github:NixOS/nixpkgs"; # also valid: "nixpkgs"
7
7
rust-overlay.url = "github:oxalica/rust-overlay"; # A helper for Rust + Nix
8
8
+
9
9
+
# crane, for nicer caching when building rust
10
10
+
crane.url = "github:ipetkov/crane";
8
11
};
9
12
10
13
# Flake outputs
11
11
-
outputs = { self, nixpkgs, rust-overlay }:
14
14
+
outputs = { self, nixpkgs, rust-overlay, crane }:
12
15
let
13
16
# Overlays enable you to customize the Nixpkgs attribute set
14
17
overlays = [
···
20
23
rustToolchain = super.rust-bin.stable.latest.default.override {
21
24
extensions = [ "rust-analyzer" "rust-src" "rust-docs" ];
22
25
};
26
26
+
minimalRustToolchain = super.rust-bin.stable.latest.minimal;
23
27
})
24
28
];
25
29
···
49
53
protobuf
50
54
]) ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [ libiconv ]);
51
55
};
56
56
+
});
57
57
+
58
58
+
packages = forAllSystems ({ pkgs }: {
59
59
+
default = let
60
60
+
craneLib = (crane.mkLib pkgs).overrideToolchain pkgs.minimalRustToolchain;
61
61
+
commonArgs = {
62
62
+
src = pkgs.lib.cleanSourceWith {
63
63
+
src = ./.;
64
64
+
filter =
65
65
+
let
66
66
+
protoFilter = path: _type: builtins.match ".*\.proto" path != null;
67
67
+
in
68
68
+
path: type: (protoFilter path type) || (craneLib.filterCargoSources path type);
69
69
+
name = "source";
70
70
+
};
71
71
+
nativeBuildInputs = with pkgs; [
72
72
+
# for one of our rust deps
73
73
+
cmake
74
74
+
# for building our config
75
75
+
protobuf
76
76
+
];
77
77
+
};
78
78
+
in
79
79
+
craneLib.buildPackage ({
80
80
+
name = "proxy-in-anger";
81
81
+
version = "0.0.1";
82
82
+
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
83
83
+
} // commonArgs);
52
84
});
53
85
};
54
86
}