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

View File

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