diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-06-22 21:13:23 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-06-22 21:13:23 +0200 |
| commit | ba907ef7b4f5962a11c20adb4036b6ddad26a000 (patch) | |
| tree | 25f1aa3d84ef13a69afa9fc1f648822224429de6 /modules/borgcopy/default.nix | |
| parent | 173f53c48c42fbf8efc23b1393a71e9e688bfcec (diff) | |
| download | nixos-ba907ef7b4f5962a11c20adb4036b6ddad26a000.tar nixos-ba907ef7b4f5962a11c20adb4036b6ddad26a000.tar.gz nixos-ba907ef7b4f5962a11c20adb4036b6ddad26a000.tar.bz2 nixos-ba907ef7b4f5962a11c20adb4036b6ddad26a000.tar.xz nixos-ba907ef7b4f5962a11c20adb4036b6ddad26a000.zip | |
...
Diffstat (limited to 'modules/borgcopy/default.nix')
| -rw-r--r-- | modules/borgcopy/default.nix | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/modules/borgcopy/default.nix b/modules/borgcopy/default.nix index 8e1afc27..af021777 100644 --- a/modules/borgcopy/default.nix +++ b/modules/borgcopy/default.nix | |||
| @@ -1,25 +1,32 @@ | |||
| 1 | { config, pkgs, lib, utils, flakeInputs, ... }: | 1 | { config, pkgs, lib, utils, flake, flakeInputs, ... }: |
| 2 | 2 | ||
| 3 | with lib; | 3 | with lib; |
| 4 | 4 | ||
| 5 | let | 5 | let |
| 6 | copyBorg = | 6 | copyBorg = let |
| 7 | with pkgs.poetry2nix; | 7 | workspace = flakeInputs.uv2nix.lib.workspace.loadWorkspace { workspaceRoot = ./.; }; |
| 8 | mkPoetryApplication { | 8 | pythonSet = flake.lib.pythonSet { |
| 9 | projectDir = cleanPythonSources { src = ./.; }; | 9 | inherit pkgs; |
| 10 | python = pkgs.python312; | ||
| 11 | overlay = workspace.mkPyprojectOverlay { | ||
| 12 | sourcePreference = "wheel"; | ||
| 13 | }; | ||
| 14 | }; | ||
| 15 | virtualEnv = pythonSet.mkVirtualEnv "copy_borg" workspace.deps.default; | ||
| 16 | in virtualEnv.overrideAttrs (oldAttrs: { | ||
| 17 | meta = (oldAttrs.meta or {}) // { | ||
| 18 | mainProgram = "copy_borg"; | ||
| 19 | }; | ||
| 10 | 20 | ||
| 11 | overrides = overrides.withDefaults (self: super: { | 21 | nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [ pkgs.makeWrapper ]; |
| 12 | pyprctl = super.pyprctl.overridePythonAttrs (oldAttrs: { | ||
| 13 | buildInputs = (oldAttrs.buildInputs or []) ++ [super.setuptools]; | ||
| 14 | }); | ||
| 15 | inherit (pkgs.python3Packages) python-unshare; | ||
| 16 | }); | ||
| 17 | 22 | ||
| 18 | postInstall = '' | 23 | postInstall = '' |
| 19 | wrapProgram $out/bin/copy_borg \ | 24 | ${oldAttrs.postInstall or ""} |
| 20 | --prefix PATH : ${makeBinPath (with pkgs; [util-linux borgbackup])}:${config.security.wrapperDir} | 25 | |
| 21 | ''; | 26 | wrapProgram $out/bin/copy_borg \ |
| 22 | }; | 27 | --prefix PATH : ${makeBinPath (with pkgs; [util-linux borgbackup])}:${config.security.wrapperDir} |
| 28 | ''; | ||
| 29 | }); | ||
| 23 | 30 | ||
| 24 | copyService = name: opts: nameValuePair "copy-borg@${utils.escapeSystemdPath name}" { | 31 | copyService = name: opts: nameValuePair "copy-borg@${utils.escapeSystemdPath name}" { |
| 25 | restartIfChanged = false; | 32 | restartIfChanged = false; |
