File tree Expand file tree Collapse file tree 5 files changed +56
-87
lines changed Expand file tree Collapse file tree 5 files changed +56
-87
lines changed Original file line number Diff line number Diff line change 13
13
treefmt-nix . inputs . nixpkgs . follows = "nixpkgs" ;
14
14
git-hooks . url = "github:cachix/git-hooks.nix" ;
15
15
git-hooks . inputs . nixpkgs . follows = "nixpkgs" ;
16
- nixpkgs-go124 . url = "github:Nixos/nixpkgs/3b9f00d7a7bf68acd4c4abb9d43695afb04e03a5" ;
17
- gatekeeper . url = "git+ssh://[email protected] /supabase/jit-db-gatekeeper?ref=sam/add-flake-parts&rev=34ba4a222c15b2480b837bbb3076508f36c9296f" ;
18
- gatekeeper . inputs . nixpkgs . follows = "nixpkgs" ;
16
+ nixpkgs-go124 . url = "github:Nixos/nixpkgs/d2ac4dfa61fba987a84a0a81555da57ae0b9a2b0" ;
19
17
} ;
20
18
21
19
outputs =
Original file line number Diff line number Diff line change 51
51
buildPgrxExtension_0_14_3 = prev . buildPgrxExtension . override {
52
52
cargo-pgrx = final . cargo-pgrx . cargo-pgrx_0_14_3 ;
53
53
} ;
54
-
55
- # place the gatekeeper module in the expected libpam location
56
- gatekeeper = self . packages . ${ final . system } . gatekeeper ;
57
- linux-pam = prev . linux-pam . overrideAttrs ( old : {
58
- postInstall =
59
- ( old . postInstall or "" )
60
- + ''
61
- mkdir -p $out/lib/security
62
- cp ${ final . gatekeeper } /lib/security/*.so $out/lib/security/
63
- '' ;
64
- } ) ;
65
54
} ;
66
55
}
Original file line number Diff line number Diff line change 2
2
{
3
3
imports = [
4
4
./postgres.nix
5
- ./gatekeeper.nix
5
+ # ./gatekeeper.nix
6
6
] ;
7
7
perSystem =
8
8
{
37
37
cleanup-ami = pkgs . callPackage ./cleanup-ami.nix { } ;
38
38
dbmate-tool = pkgs . callPackage ./dbmate-tool.nix { inherit ( self . supabase ) defaults ; } ;
39
39
docs = pkgs . callPackage ./docs.nix { } ;
40
+ gatekeeper = pkgs . callPackage ./gatekeeper.nix { inherit inputs pkgs ; } ;
40
41
supabase-groonga = pkgs . callPackage ./groonga { } ;
41
42
local-infra-bootstrap = pkgs . callPackage ./local-infra-bootstrap.nix { } ;
42
43
migrate-tool = pkgs . callPackage ./migrate-tool.nix { psql_15 = self' . packages . "psql_15/bin" ; } ;
Original file line number Diff line number Diff line change 1
- { inputs , ... } :
2
1
{
3
- perSystem =
4
- { system , ... } :
5
- let
6
-
7
- go124 = inputs . nixpkgs-go124 . legacyPackages . ${ system } . go_1_24 ;
8
- in
9
- {
10
- packages . gatekeeper = inputs . gatekeeper . lib . ${ system } . makeGatekeeper { go = go124 ; } ;
11
- } ;
2
+ inputs ,
3
+ system ,
4
+ pkgs ,
5
+ ...
6
+ } :
7
+ let
8
+ go124 = inputs . nixpkgs-go124 . legacyPackages . ${ system } . go_1_24 ;
9
+ # Use completely clean nixpkgs without any overlays for gatekeeper
10
+ #cleanPkgs = inputs.nixpkgs.legacyPackages.${system};
11
+ buildGoModule = pkgs . buildGoModule . override { go = go124 ; } ;
12
+ in
13
+
14
+ buildGoModule {
15
+ pname = "gatekeeper" ;
16
+ version = "0.1.0" ;
17
+
18
+ src = pkgs . fetchFromGitHub {
19
+ owner = "supabase" ;
20
+ repo = "jit-db-gatekeeper" ;
21
+ rev = "refs/heads/main" ;
22
+ hash = "sha256-hrYh1dBxk+aN3b/J9mZqk/ZXHmWA/MIqZLVgICT7e90=" ;
23
+ } ;
24
+
25
+ vendorHash = "sha256-G9x2TARSJMn30R6ZOlsggxEtn5t2ezWz1YtkLXdYiAE=" ;
26
+
27
+ buildInputs = [
28
+ pkgs . pam
29
+ ] ++ pkgs . lib . optionals pkgs . stdenv . isDarwin [ pkgs . darwin . apple_sdk . frameworks . Security ] ;
30
+
31
+ buildPhase = ''
32
+ runHook preBuild
33
+ go build -buildmode=c-shared -o pam_jwt_pg.so
34
+ runHook postBuild
35
+ '' ;
36
+
37
+ installPhase = ''
38
+ runHook preInstall
39
+ mkdir -p $out/lib/security
40
+ cp pam_jwt_pg.so $out/lib/security/
41
+ runHook postInstall
42
+ '' ;
43
+
44
+ meta = with pkgs . lib ; {
45
+ description = "PAM module for JWT authentication with PostgreSQL backend" ;
46
+ homepage = "https://github.com/supabase/jit-db-gatekeeper" ;
47
+ license = licenses . mit ;
48
+ platforms = platforms . unix ;
49
+ } ;
12
50
}
You can’t perform that action at this time.
0 commit comments