mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-14 10:30:52 -06:00
test: setting up nas structure
This commit is contained in:
parent
8cd193ec49
commit
4225970826
747 changed files with 2938 additions and 4347 deletions
65
modules/nixos/homelab/restic/default.nix
Executable file
65
modules/nixos/homelab/restic/default.nix
Executable file
|
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
config,
|
||||
flake,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (flake.config.services) instances;
|
||||
inherit (flake.config.people) user0;
|
||||
envFile = "backblaze/env";
|
||||
repoFile = "backblaze/repo";
|
||||
passFile = "restic/pass";
|
||||
in
|
||||
{
|
||||
services.restic = {
|
||||
backups = {
|
||||
remote = {
|
||||
environmentFile = config.sops.secrets.${envFile}.path;
|
||||
initialize = true;
|
||||
passwordFile = config.sops.secrets.${passFile}.path;
|
||||
repositoryFile = config.sops.secrets.${repoFile}.path;
|
||||
timerConfig = {
|
||||
OnCalendar = "0/4:00";
|
||||
Persistent = true;
|
||||
};
|
||||
paths =
|
||||
let
|
||||
inst = instance: instances.${instance}.mntPaths.path0;
|
||||
in
|
||||
[
|
||||
"/home/${user0}/.ssh"
|
||||
(inst "firefly-iii")
|
||||
(inst "forgejo")
|
||||
(inst "mastodon")
|
||||
(inst "opencloud1")
|
||||
(inst "minecraft0")
|
||||
(inst "minecraft1")
|
||||
(inst "vaultwarden")
|
||||
((inst "jellyfin") + "/cache")
|
||||
((inst "jellyfin") + "/data")
|
||||
((inst "jellyfin") + "/media/music")
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sops = {
|
||||
secrets = builtins.listToAttrs (
|
||||
map
|
||||
(secret: {
|
||||
name = secret;
|
||||
value = {
|
||||
path = "/run/secrets/${secret}";
|
||||
owner = "root";
|
||||
group = "root";
|
||||
mode = "0600";
|
||||
};
|
||||
})
|
||||
[
|
||||
envFile
|
||||
repoFile
|
||||
passFile
|
||||
]
|
||||
);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue