Update snapshots and snapshot intervals in snapper

This commit is contained in:
iFargle 2023-12-28 18:36:09 +09:00
parent 2eba4b2c12
commit f332325d07
5 changed files with 44 additions and 27 deletions

View file

@ -1,15 +1,9 @@
{ lib, pkgs, desktop, ... }: { { lib, pkgs, desktop, ... }: {
environment.systemPackages = [ pkgs.snapper ] ++ lib.optional (builtins.isString desktop) pkgs.snapper-gui; 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 = { services.snapper = {
snapshotRootOnBoot = true; snapshotRootOnBoot = true;
cleanupInterval = "1d"; cleanupInterval = "7d";
snapshotInterval = "hourly"; snapshotInterval = "hourly";
configs = { configs = {
root = { root = {

View file

@ -1,11 +1,5 @@
{ {
imports = [ ../../common/services/snapper.nix ]; 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 # extra configs not present in the standard config above
services.snapper.configs.Storage = { services.snapper.configs.Storage = {

View file

@ -1,9 +1,5 @@
{ {
imports = [ ../../common/services/snapper.nix ]; 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.enable = true;
services.btrfs.autoScrub.interval = "weekly"; services.btrfs.autoScrub.interval = "weekly";
@ -51,6 +47,23 @@
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [ "compress=zstd" "noatime" ];
}; # nix }; # 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 }; # subvolumes
}; # content.content }; # content.content
}; # content }; # content

View file

@ -1,10 +1,5 @@
{ {
imports = [ ../../common/services/snapper.nix ]; 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.enable = true;
services.btrfs.autoScrub.interval = "weekly"; services.btrfs.autoScrub.interval = "weekly";
@ -52,6 +47,19 @@
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [ "compress=zstd" "noatime" ];
}; # nix }; # 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 }; # subvolumes
}; # content.content }; # content.content
}; # content }; # content

View file

@ -1,10 +1,5 @@
{ {
imports = [ ../../common/services/snapper.nix ]; 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.enable = true;
services.btrfs.autoScrub.interval = "weekly"; services.btrfs.autoScrub.interval = "weekly";
@ -52,6 +47,19 @@
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [ "compress=zstd" "noatime" ];
}; # nix }; # 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 }; # subvolumes
}; # content.content }; # content.content
}; # content }; # content