Hi! Thanks for this cool new way of defining hardware config. I am not sure, but I think I ran into a bug.
I am not using nixos-hardware on my machine (as my laptop not defined in there), and using facter I observed changes in my available kernel modules.
In short, the following kernel modules did not appear when using facter instead of the generated hardware-configuration.nix:
> "usb_storage"
> "sd_mod"
Hardware config
nix hardware scan config:
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"usb_storage" # < -- missing in facter
"sd_mod" # < -- missing in facter
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/...";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-..".device = "/dev/disk/by-uuid/...";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/...";
fsType = "vfat";
};
swapDevices = [ ];
# 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.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
If I am correct, the facter hardware scan does not include the following 'extra' nixosConfigurations.<< host >>.config.boot.initrd.availableKernelModules, which appear when using hardware-configuration.nix:
> "usb_storage"
> "sd_mod"
Expected behavior
I expect the kernel modules to remain the same, as with hardware-configuration.nix. It might have to do with kernel modules which are generated on initial install via a USB stick, as when I re-generate the config these kernel modules seem to match the ones generated by facter, the missing kernel modules might indeed then be superfluous. I wonder whether this is expected behaviour. Regenerating it generates the following relevant config:
Describe the bug
Hi! Thanks for this cool new way of defining hardware config. I am not sure, but I think I ran into a bug.
I am not using
nixos-hardware
on my machine (as my laptop not defined in there), and using facter I observed changes in my available kernel modules.In short, the following kernel modules did not appear when using facter instead of the generated
hardware-configuration.nix
:Hardware config
nix hardware scan config:
generates the following kernel modules:
Using facter
With the following relevant config:
I observed the following diff:
If I am correct, the facter hardware scan does not include the following 'extra'
nixosConfigurations.<< host >>.config.boot.initrd.availableKernelModules
, which appear when usinghardware-configuration.nix
:Expected behavior
I expect the kernel modules to remain the same, as with
hardware-configuration.nix
. It might have to do with kernel modules which are generated on initial install via a USB stick, as when I re-generate the config these kernel modules seem to match the ones generated byfacter
, the missing kernel modules might indeed then be superfluous. I wonder whether this is expected behaviour. Regenerating it generates the following relevant config:System information
HP HP ZBook Firefly 14 inch G10 Mobile Workstation PC
Linux ... 6.6.56 #1-NixOS SMP PREEMPT_DYNAMIC Thu Oct 10 10:50:06 UTC 2024 x86_64 GNU/Linux
And I am running NixOS unstable. I can share the full report if you want, but I am not sure whether that is relevant.