From e9ca070fbaaac5b4114d384081e0722ab1025260 Mon Sep 17 00:00:00 2001 From: sefidel Date: Wed, 26 Jan 2022 22:35:48 +0900 Subject: nixos/alpha: zfs --- nixos/alpha/hardware-configuration.nix | 70 ++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 24 deletions(-) (limited to 'nixos/alpha/hardware-configuration.nix') diff --git a/nixos/alpha/hardware-configuration.nix b/nixos/alpha/hardware-configuration.nix index 3e99ea9..51e30a7 100644 --- a/nixos/alpha/hardware-configuration.nix +++ b/nixos/alpha/hardware-configuration.nix @@ -1,17 +1,5 @@ { config, lib, pkgs, ... }: -let - espDev = "/dev/disk/by-uuid/7905-2E41"; - btrfsDev = "/dev/disk/by-uuid/dc47a0a6-3c73-45c1-951c-40032e762180"; - swapDev = "/dev/disk/by-uuid/4a74b247-99e9-42c7-9a86-75aea964bb85"; - dataDev = "/dev/disk/by-uuid/fe7a00a8-0a3c-48de-9d7a-ed7cf172f501"; - - subvolume = name: { - device = btrfsDev; - fsType = "btrfs"; - options = [ "subvol=${name}" "compress=zstd" "noatime" ]; - }; -in { boot.initrd.availableKernelModules = [ "xhci-pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.kernelModules = [ ]; @@ -21,28 +9,62 @@ in hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.enableRedistributableFirmware = true; - fileSystems."/" = subvolume "root"; - fileSystems."/home" = subvolume "home"; - fileSystems."/nix" = subvolume "nix"; - fileSystems."/persist" = subvolume "persist"; - fileSystems."/var/log" = { - device = btrfsDev; - fsType = "btrfs"; - options = [ "subvol=log" "compress=zstd" "noatime" ]; - neededForBoot = true; + fileSystems."/" = { + device = "rpool/root/nixos"; + fsType = "zfs"; }; fileSystems."/boot" = { - device = espDev; + device = "/dev/disk/by-uuid/55B4-0E38"; fsType = "vfat"; }; + fileSystems."/nix" = { + device = "rpool/root/nixos/nix"; + fsType = "zfs"; + }; + + fileSystems."/etc" = { + device = "rpool/root/nixos/etc"; + fsType = "zfs"; + }; + + fileSystems."/var" = { + device = "rpool/root/nixos/var"; + fsType = "zfs"; + }; + + fileSystems."/var/lib" = { + device = "rpool/root/nixos/var/lib"; + fsType = "zfs"; + }; + + fileSystems."/var/log" = { + device = "rpool/root/nixos/var/log"; + fsType = "zfs"; + }; + + fileSystems."/var/spool" = { + device = "rpool/root/nixos/var/spool"; + fsType = "zfs"; + }; + + fileSystems."/home" = { + device = "rpool/home"; + fsType = "zfs"; + }; + + fileSystems."/home/boopy" = { + device = "rpool/home/boopy"; + fsType = "zfs"; + }; + fileSystems."/data" = { - device = dataDev; + device = "/dev/disk/by-uuid/fe7a00a8-0a3c-48de-9d7a-ed7cf172f501"; fsType = "ext4"; }; - swapDevices = [{ device = swapDev; }]; + swapDevices = [ ]; nix.maxJobs = lib.mkDefault 4; powerManagement.cpuFreqGovernor = lib.mkDefault "schedutil"; -- cgit 1.4.1