merge hardwarconfig and device config

This commit is contained in:
twoneis 2024-06-05 23:53:34 +02:00
parent 652be424f1
commit 719247450d
4 changed files with 113 additions and 127 deletions

View file

@ -1,39 +1,69 @@
{ pkgs, ... }: { { pkgs, ... }: {
imports = [ imports = [
./hardware-config.nix
./options.nix ./options.nix
]; ];
networking.hostName = "ellaca"; nixpkgs.hostPlatform = "x86_64-linux";
# Select kernel version networking = {
boot.kernelPackages = pkgs.linuxPackages_zen; hostName = "ellaca";
useDHCP = true;
};
# Bootloader. boot = {
boot.loader = { initrd = {
efi.canTouchEfiVariables = true; availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
grub = { };
enable = true;
efiSupport = true; kernelModules = [ "kvm-amd" ];
device = "nodev"; kernelPackages = pkgs.linuxPackages_zen;
useOSProber = true;
font = null; loader = {
splashImage = null; efi.canTouchEfiVariables = true;
grub = {
enable = true;
efiSupport = true;
device = "nodev";
useOSProber = true;
font = null;
splashImage = null;
};
}; };
}; };
# Enable OpenGL fileSystems = {
hardware.opengl = { "/boot" = {
enable = true; device = "/dev/disk/by-uuid/7ABC-9C12";
driSupport = true; fsType = "vfat";
driSupport32Bit = true; };
"/" = {
device = "/dev/disk/by-uuid/b6e6bca7-1435-4b41-b174-8550eace7c32";
fsType = "btrfs";
options = [ "subvol=rootfs" "compress=zstd" "noatime" ];
};
"/nix" = {
device = "/dev/disk/by-uuid/b6e6bca7-1435-4b41-b174-8550eace7c32";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" "noatime" ];
};
"/ext" = {
device = "/dev/disk/by-uuid/3ed92a26-775a-4e39-ac1c-84b2822cd3dd";
fsType = "btrfs";
options = [ "subvol=ext" "compress=zstd" "noatime" ];
};
}; };
# This value determines the NixOS release from which the default hardware = {
# settings for stateful data, like file locations and database versions enableRedistributableFirmware = true;
# on your system were taken. Its perfectly fine and recommended to leave enableAllFirmware = true;
# this value at the release version of the first install of this system. cpu.amd.updateMicrocode = true;
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). opengl = {
system.stateVersion = "23.05"; # Did you read the comment? enable = true;
driSupport = true;
driSupport32Bit = true;
};
};
system.stateVersion = "23.05";
} }

View file

@ -1,43 +0,0 @@
{ config, lib, ... }: {
boot = {
initrd = {
availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
kernelModules = [ ];
};
kernelModules = [ "kvm-amd" ];
extraModulePackages = [ ];
};
fileSystems = {
"/boot" = {
device = "/dev/disk/by-uuid/7ABC-9C12";
fsType = "vfat";
};
"/" = {
device = "/dev/disk/by-uuid/b6e6bca7-1435-4b41-b174-8550eace7c32";
fsType = "btrfs";
options = [ "subvol=rootfs" "compress=zstd" "noatime" ];
};
"/nix" = {
device = "/dev/disk/by-uuid/b6e6bca7-1435-4b41-b174-8550eace7c32";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" "noatime" ];
};
"/ext" = {
device = "/dev/disk/by-uuid/3ed92a26-775a-4e39-ac1c-84b2822cd3dd";
fsType = "btrfs";
options = [ "subvol=ext" "compress=zstd" "noatime" ];
};
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp7s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,28 +1,74 @@
{ pkgs, ... }: { { pkgs, ... }: {
imports = [ imports = [
./hardware-config.nix
./options.nix ./options.nix
]; ];
networking.hostName = "pleniscenta"; nixpkgs.hostPlatform = "x86_64-linux";
boot.kernelPackages = pkgs.linuxPackages_latest; networking = {
hostName = "pleniscenta";
useDHCP = true;
};
boot.loader = { boot = {
systemd-boot = { initrd = {
enable = true; availableKernelModules = [ "ahci" "xhci_pci" "ums_realtek" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
luks.devices."root".device = "/dev/disk/by-uuid/470a6d23-9f08-4c4d-afbb-63d6df1ab6a6";
};
kernelModules = [ "kvm-intel" ];
kernelPackages = pkgs.linuxPackages_latest;
loader = {
systemd-boot = {
enable = true;
};
efi.canTouchEfiVariables = true;
}; };
efi.canTouchEfiVariables = true;
}; };
hardware.opengl = { fileSystems = {
enable = true; "/boot" = {
driSupport = true; device = "/dev/disk/by-uuid/4A39-D0DF";
driSupport32Bit = true; fsType = "vfat";
};
"/" = {
device = "/dev/disk/by-uuid/75e6536a-4836-4f50-86b3-f9250edca3c0";
fsType = "btrfs";
options = [ "subvol=root" "compress=zstd" "noatime" ];
};
"/nix" = {
device = "/dev/disk/by-uuid/75e6536a-4836-4f50-86b3-f9250edca3c0";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" "noatime" ];
};
"/persist" = {
device = "/dev/disk/by-uuid/75e6536a-4836-4f50-86b3-f9250edca3c0";
fsType = "btrfs";
options = [ "subvol=persist" "compress=zstd" "noatime" ];
};
"/swap" = {
device = "/dev/disk/by-uuid/75e6536a-4836-4f50-86b3-f9250edca3c0";
fsType = "btrfs";
options = [ "subvol=swap" "noatime" ];
};
}; };
swapDevices = [ { device = "/swap/swapfile"; } ];
services.thermald.enable = true; services.thermald.enable = true;
hardware = {
enableRedistributableFirmware = true;
enableAllFirmware = true;
cpu.intel.updateMicrocode = true;
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
};
system.stateVersion = "24.05"; system.stateVersion = "24.05";
} }

View file

@ -1,47 +0,0 @@
{ config, lib, ... }: {
boot = {
initrd = {
availableKernelModules = [ "ahci" "xhci_pci" "ums_realtek" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
luks.devices."root".device = "/dev/disk/by-uuid/470a6d23-9f08-4c4d-afbb-63d6df1ab6a6";
};
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
hardware.enableRedistributableFirmware = true;
hardware.enableAllFirmware = true;
fileSystems = {
"/boot" = {
device = "/dev/disk/by-uuid/4A39-D0DF";
fsType = "vfat";
};
"/" = {
device = "/dev/disk/by-uuid/75e6536a-4836-4f50-86b3-f9250edca3c0";
fsType = "btrfs";
options = [ "subvol=root" "compress=zstd" "noatime" ];
};
"/nix" = {
device = "/dev/disk/by-uuid/75e6536a-4836-4f50-86b3-f9250edca3c0";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" "noatime" ];
};
"/persist" = {
device = "/dev/disk/by-uuid/75e6536a-4836-4f50-86b3-f9250edca3c0";
fsType = "btrfs";
options = [ "subvol=persist" "compress=zstd" "noatime" ];
};
"/swap" = {
device = "/dev/disk/by-uuid/75e6536a-4836-4f50-86b3-f9250edca3c0";
fsType = "btrfs";
options = [ "subvol=swap" "noatime" ];
};
};
swapDevices = [ { device = "/swap/swapfile"; } ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}