Skip to content

Commit 3a3a4f2

Browse files
committed
chore: use buildPhase in package
1 parent ae9ceae commit 3a3a4f2

File tree

2 files changed

+43
-86
lines changed

2 files changed

+43
-86
lines changed

flake.lock

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

nix/packages/gatekeeper.nix

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@ let
1717

1818
buildInputs = [ pkgs.pam ];
1919

20-
# Environment variables - choose ONE approach
21-
CGO_ENABLED = "1";
22-
23-
# Build flags
24-
ldflags = [
25-
"-s"
26-
"-w"
27-
];
20+
buildPhase = ''
21+
runHook preBuild
22+
go build -buildmode=c-shared -o pam_jit_pg.so
23+
runHook postBuild
24+
'';
25+
26+
installPhase = ''
27+
runHook preInstall
28+
mkdir -p $out/lib/security
29+
cp pam_jit_pg.so $out/lib/security/
30+
runHook postInstall
31+
'';
2832
};
2933
in
3034

@@ -38,6 +42,6 @@ pkgs.stdenv.mkDerivation {
3842

3943
installPhase = ''
4044
mkdir -p $out/lib/security/
41-
cp ${upstream-gatekeeper}/bin/jit-db-gatekeeper $out/lib/security/pam_jit_pg.so
45+
cp ${upstream-gatekeeper}/lib/security/pam_jit_pg.so $out/lib/security/pam_jit_pg.so
4246
'';
4347
}

0 commit comments

Comments
 (0)