summaryrefslogtreecommitdiff
path: root/hosts/vidhar/borg/default.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-02-17 13:01:58 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-02-17 13:01:58 +0100
commit3fdb09b1ee90000c22fcd74096e2b5f9df9e61cc (patch)
treeb24dd6d292612bdf242ac7f9dd9314135947f74f /hosts/vidhar/borg/default.nix
parent3e0632e7fb936c86dd0f67e63ab3c4fb9b036d52 (diff)
downloadnixos-3fdb09b1ee90000c22fcd74096e2b5f9df9e61cc.tar
nixos-3fdb09b1ee90000c22fcd74096e2b5f9df9e61cc.tar.gz
nixos-3fdb09b1ee90000c22fcd74096e2b5f9df9e61cc.tar.bz2
nixos-3fdb09b1ee90000c22fcd74096e2b5f9df9e61cc.tar.xz
nixos-3fdb09b1ee90000c22fcd74096e2b5f9df9e61cc.zip
vidhar: ...
Diffstat (limited to 'hosts/vidhar/borg/default.nix')
-rw-r--r--hosts/vidhar/borg/default.nix12
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 };
69in { 73in {