Skip to content

Commit a5ad3e3

Browse files
committed
feat: add gatekeeper
1 parent 75c8517 commit a5ad3e3

File tree

3 files changed

+55
-307
lines changed

3 files changed

+55
-307
lines changed

flake.lock

Lines changed: 0 additions & 306 deletions
This file was deleted.

flake.nix

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,20 @@
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=dev";
3132
};
3233

3334
outputs =
3435
{ flake-utils, ... }@inputs:
35-
inputs.flake-parts.lib.mkFlake { inherit inputs; } (_: {
36+
inputs.flake-parts.lib.mkFlake { inherit inputs; } (args: let
3637
systems = with flake-utils.lib; [
3738
system.x86_64-linux
3839
system.aarch64-linux
3940
system.aarch64-darwin
4041
];
42+
in {
4143

44+
systems = systems;
4245
imports = [
4346
nix/apps.nix
4447
nix/checks.nix
@@ -50,5 +53,16 @@
5053
nix/packages
5154
nix/overlays
5255
];
56+
57+
packages = builtins.listToAttrs (map (system:
58+
let
59+
pkgs = import inputs.nixpkgs { inherit system; };
60+
in {
61+
name = system;
62+
value = {
63+
pamModule = inputs.gatekeeper.packages.${system}.default;
64+
};
65+
}) systems );
66+
5367
});
5468
}

nix/internal/default.nix

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
description = "Gatekeeper PAM";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
7+
gatekeeper.url = "git+ssh://git@github.com/supabase/jit-db-gatekeeper";
8+
};
9+
10+
outputs = { self, nixpkgs, gatekeeper }:
11+
let
12+
pkgs = import nixpkgs { system = "x86_64-linux"; };
13+
in {
14+
packages.x86_64-linux.default = pkgs.stdenv.mkDerivation {
15+
pname = "gatekeeper";
16+
version = "0.1.0";
17+
18+
# Use lib/include from your module
19+
buildInputs = [ gatekeeper.packages.x86_64-linux.default ];
20+
21+
src = ./.;
22+
};
23+
};
24+
}
25+
26+
{ stdenv, go, gcc, pamModulePackage, ... }:
27+
28+
stdenv.mkDerivation {
29+
pname = "consumer";
30+
version = "0.1.0";
31+
32+
buildInputs = [
33+
pamModulePackage # this brings in the .so, headers, etc.
34+
];
35+
36+
buildPhase = ''
37+
echo "Building consumer project..."
38+
ls -lh ${pamModulePackage}/lib/security
39+
'';
40+
}

0 commit comments

Comments
 (0)