| 15 Nov 2022 |
@elvishjerricco:matrix.org | Maybe we could still do a refactor to that effect though. Something like system.fsPackageByName.${fsType}, and then have the modules that add to system.fsPackages do so like [config.system.fsPackageByName.${fsType}]; | 19:38:15 |
@elvishjerricco:matrix.org | then we just always have fsPackageByName set for any FS supported, regardless of if it's in use | 19:39:01 |
@elvishjerricco:matrix.org | But barring a big ole refactor like that, I think we can do it by available kernel modules. Like boot.initrd.fsPackages = map fsPackageForMod config.boot.initrd.availableKernelModules; | 19:43:04 |
@andreas.schraegle:helsinki-systems.de | In reply to @elvishjerricco:matrix.org because, as I can see if that commit's diff, we have dosftools in system.fsPackages, which almost certainly no one needs in initrd people with ESPs might need it | 22:19:57 |
@elvishjerricco:matrix.org | Andreas Schrägle: I can't think of a scenario where initrd even needs to mount the ESP, let alone do anything you would do with dosfstools to it | 22:20:34 |
@elvishjerricco:matrix.org | dosfstools would be for like... messing with the ESP somehow | 22:20:56 |
@andreas.schraegle:helsinki-systems.de | I can easly think of some. They're all pretty dumb, but that doesn't mean people wouldn't build them.
Anyways, it's sort of besides the point. https://github.com/NixOS/nixpkgs/pull/201266 fixed an issue an broke stage 1 systemd. So what do we do? | 22:21:41 |
@elvishjerricco:matrix.org | I think we should probably remove fsPackages from here, and instead have an expression that maps over boot.initrd.kernelModules ++ boot.initrd.availableKernelModules to determine the fs packages to include | 22:23:37 |
@elvishjerricco:matrix.org | I don't think we should revert that PR (though that was my initial reaction) | 22:24:51 |
@elvishjerricco:matrix.org | I'll throw something together... | 22:25:18 |
K900 | I did a bad | 22:25:29 |
K900 | For now | 22:25:32 |
@elvishjerricco:matrix.org | ? | 22:25:36 |
@andreas.schraegle:helsinki-systems.de | hm. we could also just filter out pkgs.util-linux from system.fsPackages 😬 | 22:25:55 |
K900 | initrd.systemd.extraBin = lib.mkForce {}; | 22:26:12 |
@elvishjerricco:matrix.org | nah; including all fsPackages is wrong anyway, since it in theory includes stage-2-exclusive FSes | 22:26:18 |
@andreas.schraegle:helsinki-systems.de | mapping over boot.initrd.kernelModules ++ boot.initrd.availableKernelModules sounds fragile, IMHO. maybe introducing boot.initrd.fsPackages and setting it in the filesystem modules might work? | 22:28:07 |
K900 | We can map over fileSystems and filter on requiredForBoot or whatever that flag is | 22:28:35 |
@elvishjerricco:matrix.org | In reply to @andreas.schraegle:helsinki-systems.de mapping over boot.initrd.kernelModules ++ boot.initrd.availableKernelModules sounds fragile, IMHO. maybe introducing boot.initrd.fsPackages and setting it in the filesystem modules might work? A boot.initrd.fsPackages option would be functionally identical to boot.initrd.systemd.initrdBin | 22:28:47 |
@elvishjerricco:matrix.org | Mapping over fileSystems is better than the kernel modules I think, K900 | 22:29:08 |
K900 | I'm pretty sure the kernel modules get added based on that anyway | 22:29:24 |
K900 | So it's just skipping an indirection | 22:29:28 |
@elvishjerricco:matrix.org | yea | 22:29:29 |
@elvishjerricco:matrix.org | Anyone know where the translation fsType -> kernel module happens? | 22:29:42 |
@elvishjerricco:matrix.org | Could help inform how to do this | 22:29:47 |
K900 | I found it once | 22:29:49 |
K900 | But I don't remember where | 22:29:58 |
K900 | ...or how | 22:30:14 |
@elvishjerricco:matrix.org | Probably something to do with boot.initrd.supportedFilesystems | 22:32:26 |
@andreas.schraegle:helsinki-systems.de | the pattern seems to be that they're all set here: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/boot/stage-1.nix#L748
and them the filesystem modules do use that, e.g. here: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/tasks/filesystems/xfs.nix | 22:34:10 |