feat: Move kernel package override to specific system configs

This commit moves the kernel package version override from the base nixos service to specific system configurations. Now, the latest linux packages will be used only in the system configurations where the override has been explicitly added. This approach gives us more flexibility to handle different kernel package versions for different systems.
This commit is contained in:
Harald Hoyer 2024-06-03 13:21:50 +02:00
parent 9c50d1379a
commit a7484b3891
3 changed files with 3 additions and 1 deletions

View file

@ -134,7 +134,6 @@ in
timeout = 2; timeout = 2;
}; };
initrd.systemd.enable = true; initrd.systemd.enable = true;
kernelPackages = lib.mkOverride 0 pkgs.linuxPackages_latest;
}; };
system.autoUpgrade = { system.autoUpgrade = {

View file

@ -5,6 +5,8 @@ with lib.metacfg;
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
boot.kernel.sysctl."net.ipv4.conf.all.route_localnet" = 1; boot.kernel.sysctl."net.ipv4.conf.all.route_localnet" = 1;
boot.kernelPackages = lib.mkOverride 0 pkgs.linuxPackages_latest;
networking.firewall.extraCommands = '' networking.firewall.extraCommands = ''
iptables -t nat -A OUTPUT -o lo -p tcp --dport 8081 -j DNAT --to-destination 192.168.122.1:8081 iptables -t nat -A OUTPUT -o lo -p tcp --dport 8081 -j DNAT --to-destination 192.168.122.1:8081
iptables -t nat -A POSTROUTING -j MASQUERADE iptables -t nat -A POSTROUTING -j MASQUERADE

View file

@ -10,6 +10,7 @@
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "uas" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "uas" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelPackages = lib.mkOverride 0 pkgs.linuxPackages_latest;
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.kernelParams = [ boot.kernelParams = [
"lockdown=confidentiality" "lockdown=confidentiality"