feat: combined laptop and PC hatdware-config.nix
This commit is contained in:
@@ -1,36 +1,89 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# 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,
|
||||||
|
systemName,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
boot.initrd.availableKernelModules =
|
||||||
|
[ ]
|
||||||
|
++ (lib.optionals (systemName == "pc") [
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"nvme"
|
||||||
|
"usb_storage"
|
||||||
|
"usbhid"
|
||||||
|
"sd_mod"
|
||||||
|
])
|
||||||
|
++ (lib.optionals (systemName == "laptop") [
|
||||||
|
"vmd"
|
||||||
|
"xhci_pci"
|
||||||
|
"nvme"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
]);
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules =
|
||||||
|
[ ]
|
||||||
|
++ (lib.optionals (systemName == "pc") [ "kvm-amd" ])
|
||||||
|
++ (lib.optionals (systemName == "laptop") [ "kvm-intel" ]);
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" = lib.mkMerge [
|
||||||
{ device = "/dev/disk/by-uuid/fdcbb840-4b35-4023-a048-599b0c5161d6";
|
(lib.mkIf (systemName == "pc") {
|
||||||
|
device = "/dev/disk/by-uuid/fdcbb840-4b35-4023-a048-599b0c5161d6";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
};
|
})
|
||||||
|
(lib.mkIf (systemName == "laptop") {
|
||||||
|
device = "/dev/disk/by-uuid/6aa7c67d-a0a5-4928-b16b-9c7991fee7ab";
|
||||||
|
fsType = "ext4";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot" = lib.mkMerge [
|
||||||
{ device = "/dev/disk/by-uuid/E1B6-9089";
|
(lib.mkIf (systemName == "pc") {
|
||||||
|
device = "/dev/disk/by-uuid/E1B6-9089";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
})
|
||||||
|
(lib.mkIf (systemName == "laptop") {
|
||||||
|
device = "/dev/disk/by-uuid/A4F3-8038";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [
|
||||||
|
"fmask=0077"
|
||||||
|
"dmask=0077"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
fileSystems."/home" =
|
fileSystems."/home" = lib.mkMerge [
|
||||||
{ device = "/dev/disk/by-uuid/d226a8ed-10eb-452e-9284-1ff994a7f179";
|
(lib.mkIf (systemName == "pc") {
|
||||||
|
device = "/dev/disk/by-uuid/d226a8ed-10eb-452e-9284-1ff994a7f179";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
};
|
})
|
||||||
|
];
|
||||||
|
|
||||||
swapDevices =
|
swapDevices =
|
||||||
[ { device = "/dev/disk/by-uuid/ccf41b96-c45f-47e0-8541-cd865f5d2ec6"; }
|
[ ]
|
||||||
];
|
++ (lib.optionals (systemName == "pc") [
|
||||||
|
{
|
||||||
|
device = "/dev/disk/by-uuid/ccf41b96-c45f-47e0-8541-cd865f5d2ec6";
|
||||||
|
}
|
||||||
|
])
|
||||||
|
++ (lib.optionals (systemName == "laptop") [
|
||||||
|
{
|
||||||
|
device = "/dev/disk/by-uuid/b416c3bd-861b-4b0c-aa84-6962b2e6a47d";
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# 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
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
@@ -41,5 +94,12 @@
|
|||||||
# networking.interfaces.wlp4s0f0u8.useDHCP = lib.mkDefault true;
|
# networking.interfaces.wlp4s0f0u8.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware = lib.mkMerge [
|
||||||
|
(lib.mkIf (systemName == "pc") {
|
||||||
|
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
})
|
||||||
|
(lib.mkIf (systemName == "laptop") {
|
||||||
|
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user