2023-08-01 18:48:59 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
nixosConfig,
|
|
|
|
...
|
|
|
|
} @ file_inputs: let
|
|
|
|
# Requires secrets.{gitlab_archiver_token, restic_music_env}
|
|
|
|
# expected to be in default locations
|
2023-09-19 17:53:44 +01:00
|
|
|
# Incase home.apps.manualBackupApps is running in container which passes secrets in from host
|
2023-08-01 18:48:59 +01:00
|
|
|
secrets =
|
2023-09-18 03:56:58 +01:00
|
|
|
if file_inputs ? "hostSecrets"
|
|
|
|
then file_inputs.hostSecrets
|
2023-08-01 18:48:59 +01:00
|
|
|
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
|
|
|
|
];
|
|
|
|
}
|