a (hacky, wip) multi-tenant oidc-terminating reverse proxy, written in anger on top of pingora
1{
2 description = "A replacement for the man tool";
3
4 # Flake inputs
5 inputs = {
6 nixpkgs.url = "github:NixOS/nixpkgs"; # also valid: "nixpkgs"
7 rust-overlay.url = "github:oxalica/rust-overlay"; # A helper for Rust + Nix
8 };
9
10 # Flake outputs
11 outputs = { self, nixpkgs, rust-overlay }:
12 let
13 # Overlays enable you to customize the Nixpkgs attribute set
14 overlays = [
15 # Makes a `rust-bin` attribute available in Nixpkgs
16 (import rust-overlay)
17 # Provides a `rustToolchain` attribute for Nixpkgs that we can use to
18 # create a Rust environment
19 (self: super: {
20 rustToolchain = super.rust-bin.stable.latest.default.override {
21 extensions = [ "rust-analyzer" "rust-src" "rust-docs" ];
22 };
23 })
24 ];
25
26 # Systems supported
27 allSystems = [
28 "x86_64-linux" # 64-bit Intel/AMD Linux
29 #"aarch64-linux" # 64-bit ARM Linux
30 #"x86_64-darwin" # 64-bit Intel macOS
31 #"aarch64-darwin" # 64-bit ARM macOS
32 ];
33
34 # Helper to provide system-specific attributes
35 forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
36 pkgs = import nixpkgs { inherit overlays system; };
37 });
38 in
39 {
40 # Development environment output
41 devShells = forAllSystems ({ pkgs }: {
42 default = pkgs.mkShell {
43 # The Nix packages provided in the environment
44 packages = (with pkgs; [
45 # The package provided by our custom overlay. Includes cargo, Clippy, cargo-fmt,
46 # rustdoc, rustfmt, and other tools.
47 cmake
48 rustToolchain
49 ]) ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [ libiconv ]);
50 };
51 });
52 };
53}