From 3fdb09b1ee90000c22fcd74096e2b5f9df9e61cc Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 17 Feb 2022 13:01:58 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/default.nix | 12 ++++++++---- 1 file 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 ServerAliveCountMax 30 ''; in nameValuePair serviceName { - path = with pkgs; [borgbackup]; - serviceConfig = { Type = "oneshot"; ExecStart = "${copyBorg}/bin/copy ${escapeShellArg repo} yggdrasil.borgbase:repo"; @@ -44,16 +42,19 @@ let }; }; - copyBorg = pkgs.stdenv.mkDerivation rec { + copyBorg = pkgs.stdenv.mkDerivation { name = "copy"; src = ./copy.py; phases = ["buildPhase" "checkPhase" "installPhase"]; + buildInputs = with pkgs; [makeWrapper]; + python = pkgs.python39.withPackages (ps: with ps; [humanize tqdm dateutil xdg python-unshare halo]); buildPhase = '' - substituteAll $src copy + substitute $src copy \ + --subst-var python ''; doCheck = true; @@ -64,6 +65,9 @@ let installPhase = '' install -m 0755 -D -t $out/bin \ copy + + wrapProgram $out/bin/copy \ + --prefix PATH : ${makeBinPath [borgbackup coreutils]} ''; }; in { -- cgit v1.2.3