nixfiles/home/manualBackupApps.nix
2023-09-19 17:53:44 +01:00

25 lines
599 B
Nix

{
pkgs,
nixosConfig,
...
} @ file_inputs: let
# Requires secrets.{gitlab_archiver_token, restic_music_env}
# expected to be in default locations
# Incase home.apps.manualBackupApps is running in container which passes secrets in from host
secrets =
if file_inputs ? "hostSecrets"
then file_inputs.hostSecrets
else nixosConfig.services.secrets.secrets;
in {
home.packages = with pkgs; [
restic
(pkgs.writeShellScriptBin "restic-music" ''
env $(cat ${secrets.restic_music_env.path}) \
${pkgs.restic}/bin/restic $@
'')
gitlab_archiver
];
}