diff --git a/systems/hikari3/configuration.nix b/systems/hikari3/configuration.nix index a33ed14..51a324e 100644 --- a/systems/hikari3/configuration.nix +++ b/systems/hikari3/configuration.nix @@ -88,6 +88,98 @@ 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 = "*:0/15"; + + 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 = "*:0/15"; + + 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.