disko icon indicating copy to clipboard operation
disko copied to clipboard

Add necessary kernel modules to the config

Open domenkozar opened this issue 2 years ago • 8 comments

raid, nvme, etc

domenkozar avatar Dec 28 '22 19:12 domenkozar

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.

Mic92 avatar Dec 29 '22 09:12 Mic92

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.

Mic92 avatar Dec 29 '22 09:12 Mic92

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.

Lassulus avatar Dec 29 '22 10:12 Lassulus

I think nixos takes also care of loading raid kernel modules already when it's used.

Mic92 avatar Dec 29 '22 10:12 Mic92

For generic images probably the best option is still just using: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/all-hardware.nix

Mic92 avatar Dec 29 '22 10:12 Mic92

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

Lassulus avatar Dec 29 '22 11:12 Lassulus

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)

phaer avatar Dec 29 '22 11:12 phaer

yes, but afair the heuristic is incomplete and we still need to add extra modules

Lassulus avatar Dec 29 '22 12:12 Lassulus

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).

iFreilicht avatar Sep 20 '24 20:09 iFreilicht

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

Enzime avatar Sep 21 '24 06:09 Enzime

Yes. nixos-facter is not fully integrated into nixos-anywhere yet, but eventually it will be.

Mic92 avatar Sep 21 '24 06:09 Mic92