diff --git a/systems/hikari3/configuration.nix b/systems/hikari3/configuration.nix index 12e7b50..e103dcf 100644 --- a/systems/hikari3/configuration.nix +++ b/systems/hikari3/configuration.nix @@ -11,6 +11,8 @@ ./cachix.nix ./web-development + + ./private/borgbackups.nix ]; # Bootloader. @@ -88,98 +90,6 @@ enable = true; user = "daniels"; }; - - borgbackup.jobs = { - # TODO: Add another "systemBackup" job, see: https://discourse.nixos.org/t/nixos-server-what-to-backup/25547/6 - projectBackup = { - paths = "/var/projects/"; - user = "daniels"; - group = "users"; - - repo = "/run/media/daniels/TimeMachine/Projects"; - removableDevice = true; - doInit = false; - - exclude = [ - "*/node_modules/*" - "*/typo3temp/*" - "*/var/cache/*" - ]; - - prune = { - keep = { - within = "1d"; - weekly = 4; - monthly = 2; - }; - }; - - compression = "auto,lzma"; - startAt = "8/4:00"; - - encryption = { - mode = "repokey"; - passCommand = "${pkgs.libsecret}/bin/secret-tool lookup password borgbackup.timemachine.projects"; - }; - - environment = { - DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/1000/bus"; - }; - }; - danielsHomeBackup = { - paths = "/home/daniels/"; - user = "daniels"; - group = "users"; - - repo = "/run/media/daniels/TimeMachine/DanielsHome"; - removableDevice = true; - doInit = false; - - exclude = [ - "/home/daniels/.cache" - "/home/daniels/.config/chromium" - "/home/daniels/.dbus" - "/home/daniels/.gvfs" - "/home/daniels/.icons" - "/home/daniels/.java" - "/home/daniels/.local/bin" - "/home/daniels/.local/lib" - "/home/daniels/.local/share/vim/" - "/home/daniels/.local/share/icons/" - "/home/daniels/.local/share/mime/" - "/home/daniels/.local/share/containers/" - "/home/daniels/.local/state" - "/home/daniels/.mozilla" - "/home/daniels/.nix-profile/" - "/home/daniels/.node" - "/home/daniels/.npm" - "/home/daniels/.node-gyp" - "/home/daniels/.rnd" - "/home/daniels/Downloads/" - "/home/daniels/Music/" - ]; - - prune = { - keep = { - within = "2d"; - weekly = 4; - monthly = 6; - }; - }; - - compression = "auto,lzma"; - startAt = "8/4:00"; - - encryption = { - mode = "repokey"; - passCommand = "${pkgs.libsecret}/bin/secret-tool lookup password borgbackup.timemachine.danielsHome"; - }; - - environment = { - DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/1000/bus"; - }; - }; - }; }; # Enable sound with pipewire. diff --git a/systems/hikari3/private/borgbackups.nix b/systems/hikari3/private/borgbackups.nix new file mode 100644 index 0000000..a24917e Binary files /dev/null and b/systems/hikari3/private/borgbackups.nix differ