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,16 +1,24 @@
{ 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 = {
availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
};
kernelModules = [ "kvm-amd" ];
kernelPackages = pkgs.linuxPackages_zen;
loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
grub = { grub = {
enable = true; enable = true;
@ -21,19 +29,41 @@
splashImage = null; splashImage = null;
}; };
}; };
};
# Enable OpenGL fileSystems = {
hardware.opengl = { "/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" ];
};
};
hardware = {
enableRedistributableFirmware = true;
enableAllFirmware = true;
cpu.amd.updateMicrocode = true;
opengl = {
enable = true; enable = true;
driSupport = true; driSupport = true;
driSupport32Bit = true; driSupport32Bit = true;
}; };
};
# This value determines the NixOS release from which the default system.stateVersion = "23.05";
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
} }

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,27 +1,73 @@
{ 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 = {
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" ];
kernelPackages = pkgs.linuxPackages_latest;
loader = {
systemd-boot = { systemd-boot = {
enable = true; enable = true;
}; };
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
};
hardware.opengl = { 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"; } ];
services.thermald.enable = true;
hardware = {
enableRedistributableFirmware = true;
enableAllFirmware = true;
cpu.intel.updateMicrocode = true;
opengl = {
enable = true; enable = true;
driSupport = true; driSupport = true;
driSupport32Bit = true; driSupport32Bit = true;
}; };
};
services.thermald.enable = 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;
}