diff options
Diffstat (limited to 'hosts/vidhar')
-rw-r--r-- | hosts/vidhar/borg/default.nix | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/hosts/vidhar/borg/default.nix b/hosts/vidhar/borg/default.nix index b3a3530c..b1ce23ad 100644 --- a/hosts/vidhar/borg/default.nix +++ b/hosts/vidhar/borg/default.nix | |||
@@ -19,8 +19,6 @@ let | |||
19 | ServerAliveCountMax 30 | 19 | ServerAliveCountMax 30 |
20 | ''; | 20 | ''; |
21 | in nameValuePair serviceName { | 21 | in nameValuePair serviceName { |
22 | path = with pkgs; [borgbackup]; | ||
23 | |||
24 | serviceConfig = { | 22 | serviceConfig = { |
25 | Type = "oneshot"; | 23 | Type = "oneshot"; |
26 | ExecStart = "${copyBorg}/bin/copy ${escapeShellArg repo} yggdrasil.borgbase:repo"; | 24 | ExecStart = "${copyBorg}/bin/copy ${escapeShellArg repo} yggdrasil.borgbase:repo"; |
@@ -44,16 +42,19 @@ let | |||
44 | }; | 42 | }; |
45 | }; | 43 | }; |
46 | 44 | ||
47 | copyBorg = pkgs.stdenv.mkDerivation rec { | 45 | copyBorg = pkgs.stdenv.mkDerivation { |
48 | name = "copy"; | 46 | name = "copy"; |
49 | src = ./copy.py; | 47 | src = ./copy.py; |
50 | 48 | ||
51 | phases = ["buildPhase" "checkPhase" "installPhase"]; | 49 | phases = ["buildPhase" "checkPhase" "installPhase"]; |
52 | 50 | ||
51 | buildInputs = with pkgs; [makeWrapper]; | ||
52 | |||
53 | python = pkgs.python39.withPackages (ps: with ps; [humanize tqdm dateutil xdg python-unshare halo]); | 53 | python = pkgs.python39.withPackages (ps: with ps; [humanize tqdm dateutil xdg python-unshare halo]); |
54 | 54 | ||
55 | buildPhase = '' | 55 | buildPhase = '' |
56 | substituteAll $src copy | 56 | substitute $src copy \ |
57 | --subst-var python | ||
57 | ''; | 58 | ''; |
58 | 59 | ||
59 | doCheck = true; | 60 | doCheck = true; |
@@ -64,6 +65,9 @@ let | |||
64 | installPhase = '' | 65 | installPhase = '' |
65 | install -m 0755 -D -t $out/bin \ | 66 | install -m 0755 -D -t $out/bin \ |
66 | copy | 67 | copy |
68 | |||
69 | wrapProgram $out/bin/copy \ | ||
70 | --prefix PATH : ${makeBinPath [borgbackup coreutils]} | ||
67 | ''; | 71 | ''; |
68 | }; | 72 | }; |
69 | in { | 73 | in { |