From 1bbd31b31e4cf8d87372dee4ab6839a8d830f084 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Tue, 22 Dec 2020 19:09:36 +0100 Subject: [PATCH] WIP: restic rest server --- modules/restic.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/restic.nix b/modules/restic.nix index 6f49214..df454a6 100644 --- a/modules/restic.nix +++ b/modules/restic.nix @@ -33,7 +33,7 @@ let # script to use restic as user without dealing with authentication authScript = pkgs.writeShellScriptBin "restic-auth" '' . <(pass nixos/machines/${config.networking.hostName}/restic-s3 | sed 's/^/export /') - ${pkgs.restic}/bin/restic \ + ${pkgs.unstable.restic}/bin/restic \ --password-command="pass nixos/machines/${config.networking.hostName}/restic-password" \ --repo "${repository}" \ $@ @@ -67,9 +67,14 @@ in }; }; + # custom module + disabledModules = [ "services/backup/restic.nix" ]; + imports = [ (import /home/simon/src/nixpkgs/nixos/modules/services/backup/restic.nix { inherit config lib; pkgs = pkgs.unstable; }) ]; + config = lib.mkIf cfg.enable { services.restic.backups."${name}" = { - inherit repository; + # FIXME: replace with secret once repository uses rest server + repositoryFile = (pkgs.writeText "restic-repository" repository); passwordFile = toString ; s3CredentialsFile = toString ; paths = [