diff --git a/nixos/common/services/snapper.nix b/nixos/common/services/snapper.nix index 959ef0a9..4f82c675 100644 --- a/nixos/common/services/snapper.nix +++ b/nixos/common/services/snapper.nix @@ -1,15 +1,9 @@ { lib, pkgs, desktop, ... }: { environment.systemPackages = [ pkgs.snapper ] ++ lib.optional (builtins.isString desktop) pkgs.snapper-gui; - # You need to make the snapshot directories manually: - # sudo rm -rf /.snapshots /home/.snapshots /nix/.snapshots - # sudo btrfs subvolume create /.snapshots - # sudo btrfs subvolume create /nix/.snapshots - # sudo btrfs subvolume create /home/.snapshots - services.snapper = { snapshotRootOnBoot = true; - cleanupInterval = "1d"; + cleanupInterval = "7d"; snapshotInterval = "hourly"; configs = { root = { diff --git a/nixos/hosts/framework-server/disks.nix b/nixos/hosts/framework-server/disks.nix index bbf32579..2baf2cff 100644 --- a/nixos/hosts/framework-server/disks.nix +++ b/nixos/hosts/framework-server/disks.nix @@ -1,11 +1,5 @@ { imports = [ ../../common/services/snapper.nix ]; - # You need to make the snapshot directories manually: - # sudo rm -rf /.snapshots /home/.snapshots /nix/.snapshots - # sudo btrfs subvolume create /.snapshots - # sudo btrfs subvolume create /nix/.snapshots - # sudo btrfs subvolume create /home/.snapshots - # sudo btrfs subvolume create /Storage/.snapshots # extra configs not present in the standard config above services.snapper.configs.Storage = { diff --git a/nixos/hosts/nixos-desktop/disks.nix b/nixos/hosts/nixos-desktop/disks.nix index 2459fd9f..49c8d44c 100644 --- a/nixos/hosts/nixos-desktop/disks.nix +++ b/nixos/hosts/nixos-desktop/disks.nix @@ -1,9 +1,5 @@ { imports = [ ../../common/services/snapper.nix ]; - # You need to make the snapshot directories manually: - # sudo btrfs subvolume create /.snapshots - # sudo btrfs subvolume create /nix/.snapshots - # sudo btrfs subvolume create /home/.snapshots services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.interval = "weekly"; @@ -51,6 +47,23 @@ mountpoint = "/nix"; mountOptions = [ "compress=zstd" "noatime" ]; }; # nix + "/games" = { + mountpoint = "/games"; + mountOptions = [ "noatime" ]; + }; # games + # SNAPSHOT SUBVOLS + "/root/.snapshots" = { + mountpoint = "/.snapshots"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; # root + "/home/.snapshots" = { + mountpoint = "/home/.snapshots"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; # home + "/nix/.snapshots" = { + mountpoint = "/nix/.snapshots"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; # nix }; # subvolumes }; # content.content }; # content diff --git a/nixos/hosts/nixos-framework/disks.nix b/nixos/hosts/nixos-framework/disks.nix index 259a7554..5d888bbe 100644 --- a/nixos/hosts/nixos-framework/disks.nix +++ b/nixos/hosts/nixos-framework/disks.nix @@ -1,10 +1,5 @@ { imports = [ ../../common/services/snapper.nix ]; - # You need to make the snapshot directories manually: - # sudo rm -rf /.snapshots /home/.snapshots /nix/.snapshots - # sudo btrfs subvolume create /.snapshots - # sudo btrfs subvolume create /nix/.snapshots - # sudo btrfs subvolume create /home/.snapshots services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.interval = "weekly"; @@ -52,6 +47,19 @@ mountpoint = "/nix"; mountOptions = [ "compress=zstd" "noatime" ]; }; # nix + # SNAPSHOT SUBVOLS + "/root/.snapshots" = { + mountpoint = "/.snapshots"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; # root + "/home/.snapshots" = { + mountpoint = "/home/.snapshots"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; # home + "/nix/.snapshots" = { + mountpoint = "/nix/.snapshots"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; # nix }; # subvolumes }; # content.content }; # content diff --git a/nixos/hosts/nuc-server/disks.nix b/nixos/hosts/nuc-server/disks.nix index e6b75dbe..609f6371 100644 --- a/nixos/hosts/nuc-server/disks.nix +++ b/nixos/hosts/nuc-server/disks.nix @@ -1,10 +1,5 @@ { imports = [ ../../common/services/snapper.nix ]; - # You need to make the snapshot directories manually: - # sudo rm -rf /.snapshots /home/.snapshots /nix/.snapshots - # sudo btrfs subvolume create /.snapshots - # sudo btrfs subvolume create /nix/.snapshots - # sudo btrfs subvolume create /home/.snapshots services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.interval = "weekly"; @@ -52,6 +47,19 @@ mountpoint = "/nix"; mountOptions = [ "compress=zstd" "noatime" ]; }; # nix + # SNAPSHOT SUBVOLS + "/root/.snapshots" = { + mountpoint = "/.snapshots"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; # root + "/home/.snapshots" = { + mountpoint = "/home/.snapshots"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; # home + "/nix/.snapshots" = { + mountpoint = "/nix/.snapshots"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; # nix }; # subvolumes }; # content.content }; # content