From 64e77aba8fe70bd273743bfa24c0097645a0c228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 1 May 2024 20:59:42 +0300 Subject: [PATCH] btrfs-snap /home --- hosts/mtworx/configuration.nix | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/hosts/mtworx/configuration.nix b/hosts/mtworx/configuration.nix index 91a047b..31a7729 100644 --- a/hosts/mtworx/configuration.nix +++ b/hosts/mtworx/configuration.nix @@ -53,7 +53,35 @@ in { boot.binfmt.emulatedSystems = ["aarch64-linux"]; - systemd.services.zfs-mount.enable = false; + systemd = { + timers = { + btrfs-snap-home-5m = { + enable = true; + wantedBy = ["timers.target"]; + timerConfig.OnCalendar = "*:0/5"; + }; + btrfs-snap-home-1h = { + enable = true; + wantedBy = ["timers.target"]; + timerConfig.OnCalendar = "*:0"; + }; + }; + services = { + zfs-mount.enable = false; + + btrfs-snap-home-5m = { + enable = true; + serviceConfig.Type = "oneshot"; + script = "${pkgs.btrfs-snap}/bin/btrfs-snap -r /home 5m 12"; + }; + + btrfs-snap-home-1h = { + enable = true; + serviceConfig.Type = "oneshot"; + script = "${pkgs.btrfs-snap}/bin/btrfs-snap -r /home 1h 24"; + }; + }; + }; mj = { stateVersion = "23.11";