Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
61 lines (59 loc) · 2.05 KB
/
Copy pathflake.nix
File metadata and controls
61 lines (59 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
description = "Pentect — local secret masking boundary for AI agents";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { nixpkgs, ... }:
let
release = builtins.fromJSON (builtins.readFile ./packaging/release.json);
systems = builtins.attrNames release.systems;
forAllSystems = function: nixpkgs.lib.genAttrs systems function;
packageFor = system:
let
pkgs = import nixpkgs { inherit system; };
source = release.systems.${system};
in
pkgs.stdenvNoCC.mkDerivation {
pname = "pentect";
inherit (release) version;
src = pkgs.fetchurl {
inherit (source) url sha256;
};
dontUnpack = true;
nativeBuildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.autoPatchelfHook ];
buildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.glibc
pkgs.stdenv.cc.cc.lib
];
installPhase = ''
runHook preInstall
install -Dm755 "$src" "$out/bin/pentect"
cat > "$out/bin/.pentect-managed-install.json" <<'JSON'
{"version":1,"manager":"nix","update":"nix profile upgrade pentect","uninstall":"nix profile remove pentect"}
JSON
runHook postInstall
'';
meta = {
description = "Local secret masking boundary for AI agents";
homepage = "https://github.com/EdamAme-x/pentect";
license = pkgs.lib.licenses.mit;
mainProgram = "pentect";
sourceProvenance = [ pkgs.lib.sourceTypes.binaryNativeCode ];
};
};
in
{
packages = forAllSystems (system: {
default = packageFor system;
pentect = packageFor system;
});
apps = forAllSystems (system: {
default = {
type = "app";
program = "${packageFor system}/bin/pentect";
};
pentect = {
type = "app";
program = "${packageFor system}/bin/pentect";
};
});
};
}