summaryrefslogtreecommitdiff
path: root/tools/sops-inventory/default.nix
blob: 0f868629d151e7da007f0a7cfaa62fb240ab3916 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ system, self, uv2nix, gitignore, ... }:

let
  pkgs = self.legacyPackages.${system};
  workspace = uv2nix.lib.workspace.loadWorkspace {
    workspaceRoot = gitignore.lib.gitignoreSource ./.;
  };
  pythonSet = self.lib.pythonSet {
    inherit pkgs;
    python = pkgs.python3;
    overlay = workspace.mkPyprojectOverlay {
      sourcePreference = "wheel";
    };
  };
  virtualEnv = pythonSet.mkVirtualEnv "sops-inventory" workspace.deps.default;
in virtualEnv.overrideAttrs (oldAttrs: {
  buildInputs = (oldAttrs.buildInputs or []) ++ [ pkgs.makeWrapper ];
  postInstall = ''
    ${oldAttrs.postInstall or ""}

    wrapProgram $out/bin/sops-inventory \
      --prefix PATH : ${pkgs.lib.makeBinPath (with pkgs; [git])}
  '';
})