Skip to content

Commit a13b166

Browse files
samrosestaaldraad
authored andcommitted
fix: clean up nix flake and lock, drop overlay
1 parent e4a9904 commit a13b166

File tree

5 files changed

+55
-85
lines changed

5 files changed

+55
-85
lines changed

flake.lock

Lines changed: 5 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
2929
nixpkgs-go124.url = "github:Nixos/nixpkgs/d2ac4dfa61fba987a84a0a81555da57ae0b9a2b0";
3030
nixpkgs-pgbackrest.url = "github:nixos/nixpkgs/nixos-unstable-small";
31-
gatekeeper.url = "git+ssh://git@github.com/supabase/jit-db-gatekeeper?ref=sam/add-flake-parts&rev=34ba4a222c15b2480b837bbb3076508f36c9296f";
32-
gatekeeper.inputs.nixpkgs.follows = "nixpkgs";
3331
};
3432

3533
outputs =

nix/overlays/default.nix

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,5 @@
2828
inherit (final) rust-bin;
2929
};
3030

31-
# place the gatekeeper module in the expected libpam location
32-
gatekeeper = self.packages.${final.system}.gatekeeper;
33-
linux-pam = prev.linux-pam.overrideAttrs (old: {
34-
postInstall =
35-
(old.postInstall or "")
36-
+ ''
37-
mkdir -p $out/lib/security
38-
cp ${final.gatekeeper}/lib/security/*.so $out/lib/security/
39-
'';
40-
});
4131
};
4232
}

nix/packages/default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
imports = [
44
./postgres.nix
5-
./gatekeeper.nix
5+
# ./gatekeeper.nix
66
];
77
perSystem =
88
{
@@ -36,6 +36,7 @@
3636
cleanup-ami = pkgs.callPackage ./cleanup-ami.nix { };
3737
dbmate-tool = pkgs.callPackage ./dbmate-tool.nix { inherit (self.supabase) defaults; };
3838
docs = pkgs.callPackage ./docs.nix { };
39+
gatekeeper = pkgs.callPackage ./gatekeeper.nix { inherit inputs pkgs; };
3940
supabase-groonga = pkgs.callPackage ./groonga { };
4041
http-mock-server = pkgs.callPackage ./http-mock-server.nix { };
4142
local-infra-bootstrap = pkgs.callPackage ./local-infra-bootstrap.nix { };

nix/packages/gatekeeper.nix

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,50 @@
1-
{ inputs, ... }:
21
{
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+
};
1250
}

0 commit comments

Comments
 (0)