system: add snapper for home and subvol for nix

This commit is contained in:
Kabbone 2022-11-06 12:50:20 +01:00
parent 2fc7225354
commit 115b139f1c
Signed by: Kabbone
SSH Key Fingerprint: SHA256:A5zPB5I6u5V78V51c362BBdCwhDhfDUVbt7NfKdjWBY
2 changed files with 29 additions and 7 deletions

View File

@ -65,6 +65,7 @@
source-code-pro
jetbrains-mono
font-awesome # Icons
hack-font
corefonts # MS
(nerdfonts.override { # Nerdfont Icons override
fonts = [
@ -133,6 +134,15 @@
# com.obsproject.Studio
# com.parsecgaming.parsec
# com.usebottles.bottles
snapper.configs = {
home = {
subvolume = "/home";
extraConfig = ''
TIMELINE_CREATE=yes
TIMELINE_CLEANUP=yes
'';
};
};
};
#xdg.portal = { # Required for flatpak
@ -167,10 +177,10 @@
};
system = { # NixOS settings
autoUpgrade = { # Allow auto update
enable = true;
channel = "https://nixos.org/channels/nixos-unstable";
};
# autoUpgrade = { # Allow auto update
# enable = true;
# channel = "https://nixos.org/channels/nixos-unstable";
# };
stateVersion = "22.05";
};
}

View File

@ -25,19 +25,31 @@
fileSystems."/" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@" ];
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@,discard=async" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home" ];
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
};
fileSystems."/home/.snapshots" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@snapshots,discard=async" ];
};
fileSystems."/srv" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@srv" ];
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@srv,discard=async" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
};
fileSystems."/boot" =