diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2021-01-02 21:44:21 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2021-01-03 16:21:34 +0100 |
commit | 3b5ab82fa714a0d483a7b90d60f9f7c857646e33 (patch) | |
tree | 0aa24694ff2f4079c325e6eda18e3a6259b6b700 /hosts | |
parent | eb2cb6f263dffb82da86372b14d6fcd7077fe9fe (diff) | |
download | nixos-3b5ab82fa714a0d483a7b90d60f9f7c857646e33.tar nixos-3b5ab82fa714a0d483a7b90d60f9f7c857646e33.tar.gz nixos-3b5ab82fa714a0d483a7b90d60f9f7c857646e33.tar.bz2 nixos-3b5ab82fa714a0d483a7b90d60f9f7c857646e33.tar.xz nixos-3b5ab82fa714a0d483a7b90d60f9f7c857646e33.zip |
sif: borgbackup
Diffstat (limited to 'hosts')
-rw-r--r-- | hosts/sif/default.nix | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/hosts/sif/default.nix b/hosts/sif/default.nix index 4e9826bd..9271515f 100644 --- a/hosts/sif/default.nix +++ b/hosts/sif/default.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { flake, pkgs, customUtils, lib, config, ... }: | 1 | { flake, pkgs, customUtils, lib, config, path, ... }: |
2 | { | 2 | { |
3 | imports = with flake.nixosModules.systemProfiles; [ | 3 | imports = with flake.nixosModules.systemProfiles; [ |
4 | ./hw.nix | 4 | ./hw.nix |
@@ -259,6 +259,30 @@ | |||
259 | SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="${systemd}/bin/systemctl --no-block start ac-plugged.service" | 259 | SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="${systemd}/bin/systemctl --no-block start ac-plugged.service" |
260 | ''; | 260 | ''; |
261 | 261 | ||
262 | services.borgbackup = { | ||
263 | snapshots = "btrfs"; | ||
264 | prefix = "yggdrasil.midgard.sif."; | ||
265 | targets = { | ||
266 | "munin" = { | ||
267 | repo = "borg.munin:borg"; | ||
268 | paths = [ "/home/gkleen" ]; | ||
269 | prune = { | ||
270 | "home" = | ||
271 | [ "--keep-within" "24H" | ||
272 | "--keep-daily" "31" | ||
273 | "--keep-monthly" "12" | ||
274 | "--keep-yearly" "-1" | ||
275 | ]; | ||
276 | }; | ||
277 | keyFile = "/run/secrets/borg-repokey--borg_munin__borg"; | ||
278 | }; | ||
279 | }; | ||
280 | }; | ||
281 | sops.secrets.borg-repokey--borg_munin__borg = { | ||
282 | sopsFile = /. + path + "/modules/borgbackup/repokeys/borg_munin__borg.yaml"; | ||
283 | key = "key"; | ||
284 | }; | ||
285 | |||
262 | services.btrfs.autoScrub = { | 286 | services.btrfs.autoScrub = { |
263 | enable = true; | 287 | enable = true; |
264 | fileSystems = [ "/" "/home" ]; | 288 | fileSystems = [ "/" "/home" ]; |