25 lines
636 B
Nix
25 lines
636 B
Nix
|
{
|
||
|
pkgs,
|
||
|
nixosConfig,
|
||
|
...
|
||
|
} @ file_inputs: let
|
||
|
# Requires secrets.{gitlab_archiver_token, restic_music_env}
|
||
|
# expected to be in default locations
|
||
|
# Incase home.apps.manual-backup-apps is running in container which passes secrets in from host
|
||
|
secrets =
|
||
|
if builtins.elem "host_secrets" (builtins.attrNames file_inputs)
|
||
|
then file_inputs.host_secrets
|
||
|
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
|
||
|
];
|
||
|
}
|