From c847186e8de24648c884337188e23b394708623c Mon Sep 17 00:00:00 2001 From: Origami404 Date: Mon, 24 Jun 2024 12:57:19 +0800 Subject: [PATCH] [conf] enable btrfs compression, mount @docker --- hardware-configuration.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 5e3503c..acab9ba 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -3,6 +3,9 @@ # to /etc/nixos/configuration.nix instead. { config, lib, pkgs, modulesPath, ... }: +let + btrfs-options = "rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120"; +in { imports = [ (modulesPath + "/installer/scan/not-detected.nix") @@ -16,13 +19,13 @@ fileSystems."/" = { device = "/dev/disk/by-uuid/1b3938f0-358f-4358-b7fb-b448b6eba56a"; fsType = "btrfs"; - options = [ "subvol=@nixos" ]; + options = [ "${btrfs-options},subvol=@nixos" ]; }; fileSystems."/nix" = { device = "/dev/disk/by-uuid/1b3938f0-358f-4358-b7fb-b448b6eba56a"; fsType = "btrfs"; - options = [ "subvol=@nix" ]; + options = [ "${btrfs-options},subvol=@nix" ]; }; fileSystems."/boot/efi" = @@ -33,10 +36,14 @@ fileSystems."/home" = { device = "/dev/disk/by-uuid/1b3938f0-358f-4358-b7fb-b448b6eba56a"; fsType = "btrfs"; - options = [ "subvol=@home" ]; + options = [ "${btrfs-options},subvol=@home" ]; }; - + fileSystems."/var/lib/docker" = + { device = "/dev/disk/by-uuid/1b3938f0-358f-4358-b7fb-b448b6eba56a"; + fsType = "btrfs"; + options = [ "${btrfs-options},subvol=@docker" ]; + }; swapDevices = [ ];