test an alias for restic

This commit is contained in:
Andreas Zweili 2022-03-01 15:01:50 +01:00
parent 2d1386be04
commit 5144d0b3b2

View File

@ -1,4 +1,7 @@
{ config, inputs, custom, pkgs, ... }:
let
password_file = "/home/${custom.username}/.nixos/secrets/passwords/restic.key";
repository = "rest:http://10.7.89.30:8000";
{
environment.systemPackages = with pkgs;
[
@ -20,8 +23,8 @@
Type = "oneshot";
};
environment = {
RESTIC_PASSWORD_FILE = "/home/${custom.username}/.nixos/secrets/passwords/restic.key";
RESTIC_REPOSITORY = "rest:http://10.7.89.30:8000";
RESTIC_PASSWORD_FILE = password_file;
RESTIC_REPOSITORY = repository;
};
script = ''
${pkgs.restic}/bin/restic \
@ -38,4 +41,12 @@
--keep-yearly 75 \
'';
};
environment.shellAliases = {
restic-list = ''
restic \
--repo ${repository}} \
--passord-file ${password_file} \
snapshots --host ${config.network.hostName}
'';
};
}