From a64a8d0e6bebcee859e890800338f0046dd8174b Mon Sep 17 00:00:00 2001 From: iFargle Date: Mon, 25 Dec 2023 16:06:25 +0900 Subject: [PATCH] Update disks --- nixos/common/services/snapper.nix | 2 +- nixos/hosts/framework-server/disks.nix | 8 +++++++- nixos/hosts/nixos-desktop/disks.nix | 16 ++++------------ nixos/hosts/nixos-framework/disks.nix | 18 +++++------------- nixos/hosts/nuc-server/disks.nix | 18 +++++------------- 5 files changed, 22 insertions(+), 40 deletions(-) diff --git a/nixos/common/services/snapper.nix b/nixos/common/services/snapper.nix index fed7d874..f56126df 100644 --- a/nixos/common/services/snapper.nix +++ b/nixos/common/services/snapper.nix @@ -9,7 +9,7 @@ root = { TIMELINE_CREATE = true; TIMELINE_CLEANUP = true; - SUBVOLUME = "/"; + SUBVOLUME = "/root"; }; home = { TIMELINE_CREATE = true; diff --git a/nixos/hosts/framework-server/disks.nix b/nixos/hosts/framework-server/disks.nix index 7a5151ca..30d4d3db 100644 --- a/nixos/hosts/framework-server/disks.nix +++ b/nixos/hosts/framework-server/disks.nix @@ -1,4 +1,10 @@ -{ +{ + 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"; diff --git a/nixos/hosts/nixos-desktop/disks.nix b/nixos/hosts/nixos-desktop/disks.nix index b37433f4..2459fd9f 100644 --- a/nixos/hosts/nixos-desktop/disks.nix +++ b/nixos/hosts/nixos-desktop/disks.nix @@ -1,5 +1,9 @@ { 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"; @@ -47,18 +51,6 @@ mountpoint = "/nix"; mountOptions = [ "compress=zstd" "noatime" ]; }; # nix - "/.snapshots" = { - mountpoint = "/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # root snapshots - "/home/.snapshots" = { - mountpoint = "/home/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # home snapshots - "/nix/.snapshots" = { - mountpoint = "/nix/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # nix snapshots }; # subvolumes }; # content.content }; # content diff --git a/nixos/hosts/nixos-framework/disks.nix b/nixos/hosts/nixos-framework/disks.nix index bb53b07c..e3a56f72 100644 --- a/nixos/hosts/nixos-framework/disks.nix +++ b/nixos/hosts/nixos-framework/disks.nix @@ -1,5 +1,9 @@ { 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"; @@ -35,7 +39,7 @@ type = "btrfs"; extraArgs = [ "-f" ]; subvolumes = { - "/" = { + "/root" = { mountpoint = "/"; mountOptions = [ "compress=zstd" "noatime" ]; }; # root @@ -47,18 +51,6 @@ mountpoint = "/nix"; mountOptions = [ "compress=zstd" "noatime" ]; }; # nix - "/.snapshots" = { - mountpoint = "/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # root snapshots - "/home/.snapshots" = { - mountpoint = "/home/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # home snapshots - "/nix/.snapshots" = { - mountpoint = "/nix/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # nix snapshots }; # subvolumes }; # content.content }; # content diff --git a/nixos/hosts/nuc-server/disks.nix b/nixos/hosts/nuc-server/disks.nix index e4fada1a..4bf5f1b2 100644 --- a/nixos/hosts/nuc-server/disks.nix +++ b/nixos/hosts/nuc-server/disks.nix @@ -1,5 +1,9 @@ { 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"; @@ -35,7 +39,7 @@ type = "btrfs"; extraArgs = [ "-f" ]; subvolumes = { - "/" = { + "/root" = { mountpoint = "/"; mountOptions = [ "compress=zstd" "noatime" ]; }; # root @@ -47,18 +51,6 @@ mountpoint = "/nix"; mountOptions = [ "compress=zstd" "noatime" ]; }; # nix - "/.snapshots" = { - mountpoint = "/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # root snapshots - "/home/.snapshots" = { - mountpoint = "/home/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # home snapshots - "/nix/.snapshots" = { - mountpoint = "/nix/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # nix snapshots }; # subvolumes }; # content.content }; # content