rainbow: use labels to identify partitions
This commit is contained in:
parent
3c8510b5d9
commit
b0cafc6a40
|
@ -2,7 +2,9 @@
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
let btrfs_options = [ "compress=zstd:3" "noatime" ];
|
let
|
||||||
|
btrfs_options = [ "compress=zstd:3" "noatime" ];
|
||||||
|
btrfs_ssd = [ "ssd" "discard=async" ];
|
||||||
in {
|
in {
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
|
||||||
|
@ -13,18 +15,22 @@ in {
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-uuid/a242e1fd-6848-4504-909f-ab8b61f97c8e";
|
device = "/dev/disk/by-label/BTRFS_ROOT";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=@nixos" ] ++ btrfs_options;
|
options = [ "subvol=@nixos" ] ++ btrfs_options ++ btrfs_ssd;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.initrd.luks.devices."main".device =
|
boot.initrd.luks.devices = {
|
||||||
"/dev/disk/by-uuid/9b24d79f-e018-4d70-84a9-5a1b49a6c610";
|
"main" = {
|
||||||
|
bypassWorkqueues = true;
|
||||||
|
device = "/dev/disk/by-label/CRYPT_ROOT";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
fileSystems."/home" = {
|
fileSystems."/home" = {
|
||||||
device = "/dev/disk/by-uuid/a242e1fd-6848-4504-909f-ab8b61f97c8e";
|
device = "/dev/disk/by-label/BTRFS_ROOT";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=@home" ] ++ btrfs_options;
|
options = [ "subvol=@home" ] ++ btrfs_options ++ btrfs_ssd;
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot/efi" = {
|
fileSystems."/boot/efi" = {
|
||||||
|
@ -33,9 +39,9 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/swap" = {
|
fileSystems."/swap" = {
|
||||||
device = "/dev/disk/by-uuid/a242e1fd-6848-4504-909f-ab8b61f97c8e";
|
device = "/dev/disk/by-label/BTRFS_ROOT";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=@swap" ];
|
options = [ "subvol=@swap" ] ++ btrfs_ssd;
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [{
|
swapDevices = [{
|
||||||
|
@ -50,7 +56,7 @@ in {
|
||||||
networking.useDHCP = lib.mkDefault true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||||
hardware.cpu.intel.updateMicrocode =
|
hardware.cpu.intel.updateMicrocode =
|
||||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue