disko
disko copied to clipboard
Add necessary kernel modules to the config
raid, nvme, etc
I am not so sure this is possible without a complete kernel module database and all dependencies (that might change between kernel versions). nixos-generate-config does this by looking at what drivers are used by block devices, however I don't think we can do this statically in a maintainable way.
Our long-term plan is to have some form of nixos-generate-config that will get this information from the target machine and combine this with profiles i.e. hetzner server in nixos-remote.
we can add nvme if those devices are used, probably the same for mmcblk. for some lvm raids we also need kernel modules. those we can set.
I think nixos takes also care of loading raid kernel modules already when it's used.
For generic images probably the best option is still just using: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/all-hardware.nix
I think nixos takes also care of loading raid kernel modules already when it's used.
not all of them https://github.com/nix-community/disko/blob/master/tests/lvm-raid.nix#L10
I think nixos takes also care of loading raid kernel modules already when it's used.
not all of them https://github.com/nix-community/disko/blob/master/tests/lvm-raid.nix#L10
Shouldn't that be somewhat redundant with https://github.com/nix-community/disko/blob/df3a607ad7ee431f4831a51af2c464aa8a8813f4/types.nix#L926 or am I missing something? (types.nix only explicitly sets it for initrd though)
yes, but afair the heuristic is incomplete and we still need to add extra modules
Are there any real-world implications regarding this? I feel like the issue is formulated very generally and not actionable. I'm thinking of closing it in favor of individual reports (which I haven't found yet, but I'm still working my way through the issues).
Our long-term plan is to have some form of nixos-generate-config that will get this information from the target machine and combine this with profiles i.e. hetzner server in nixos-remote.
This now exists at https://github.com/numtide/nixos-facter
Yes. nixos-facter is not fully integrated into nixos-anywhere yet, but eventually it will be.