merge normal and hardware configuration

This commit is contained in:
Pim Kunis 2023-11-22 18:54:05 +01:00
parent e19e738b04
commit 0d316fe7d2
3 changed files with 39 additions and 30 deletions

View file

@ -1,15 +1,33 @@
{ pkgs, config, ... }: { { pkgs, config, lib, modulesPath, ... }: {
imports = [ imports = [
./hardware-configuration.nix (modulesPath + "/installer/scan/not-detected.nix")
./modules/disk-config.nix ./modules/disk-config.nix
./modules/agenix.nix ./modules/agenix.nix
./modules/custom.nix ./modules/custom.nix
]; ];
boot.loader = { boot = {
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
initrd = {
availableKernelModules = [
"ahci"
"xhci_pci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
kernelModules = [ ];
};
loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
};
time.timeZone = "Europe/Amsterdam"; time.timeZone = "Europe/Amsterdam";
@ -88,7 +106,10 @@
}; };
}; };
nixpkgs.config.allowUnfree = true; nixpkgs = {
config.allowUnfree = true;
hostPlatform = "x86_64-linux";
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
neofetch neofetch
@ -102,13 +123,16 @@
file file
]; ];
networking.firewall.enable = false; networking = {
firewall.enable = false;
useDHCP = false;
networking.nftables = { nftables = {
enable = true; enable = true;
checkRuleset = true; checkRuleset = true;
ruleset = builtins.readFile ./nftables.conf; ruleset = builtins.readFile ./nftables.conf;
}; };
};
system.stateVersion = "23.05"; system.stateVersion = "23.05";
@ -158,4 +182,7 @@
}; };
virtualisation.libvirtd.enable = true; virtualisation.libvirtd.enable = true;
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View file

@ -51,9 +51,7 @@
disko.nixosModules.disko disko.nixosModules.disko
agenix.nixosModules.default agenix.nixosModules.default
./configuration.nix ./configuration.nix
{ { networking.hostName = machine.name; }
networking.hostName = machine.name;
}
]; ];
}); });

View file

@ -1,16 +0,0 @@
# TODO: merge with configuration.nix
{ config, lib, modulesPath, ... }: {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "ahci" "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
networking.useDHCP = false;
nixpkgs.hostPlatform = "x86_64-linux";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}