add snapper

This commit is contained in:
LavaDesu 2021-07-10 09:00:21 +07:00
parent 34ce469784
commit ce0954fc61
Signed by: cilly
GPG key ID: 6500251E087653C9
3 changed files with 25 additions and 0 deletions

View file

@ -20,6 +20,7 @@
./networking.nix
./packages.nix
./security.nix
./snapper.nix
../../users/rin
];

View file

@ -42,6 +42,12 @@
options = [ "autodefrag" "compress=zstd:3" "nossd" "nossd_spread" "relatime" "subvolid=260" ];
};
fileSystems."/home/.snapshots" =
{ device = "/dev/disk/by-uuid/8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d";
fsType = "btrfs";
options = [ "autodefrag" "compress=zstd:3" "nossd" "nossd_spread" "relatime" "subvolid=319" ];
};
fileSystems."/root" =
{ device = "/dev/disk/by-uuid/8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d";
fsType = "btrfs";

18
hosts/winter/snapper.nix Normal file
View file

@ -0,0 +1,18 @@
{ config, lib, ... }: {
services.snapper = {
configs.home = {
fstype = "btrfs";
subvolume = "/home";
extraConfig = lib.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "${k}=${v}") {
TIMELINE_CLEANUP = "yes";
TIMELINE_CREATE = "yes";
TIMELINE_MIN_AGE = "1800";
TIMELINE_LIMIT_HOURLY = "5";
TIMELINE_LIMIT_DAILY = "7";
TIMELINE_LIMIT_WEEKLY = "0";
TIMELINE_LIMIT_MONTHLY = "0";
TIMELINE_LIMIT_YEARLY = "0";
});
};
};
}