building the system configuration...
error: Package ‘zfs-kernel-2.1.5-5.19.8’ in /nix/store/fr68dr66gmggn62jir7vp1bcnignwxp9-source/pkgs/os-specific/linux/zfs/default.nix:196 is marked as broken, refusing to evaluate.
a) To temporarily allow broken packages, you can use an environment variable
for a single invocation of the nix tools.
$ export NIXPKGS_ALLOW_BROKEN=1
Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
(Flake) command, `--impure` must be passed in order to read this
environment variable.
b) For `nixos-rebuild` you can set
{ nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowBroken = true; }
to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)
All of my other overrides work fine, is it something to do with this being set with a manually imported instance of nixpkgs?
I tried to also set boot.zfs.package, but the option is read-only. is there a way to override this?
I would also like to know why I can use config in my HM configuration, but not the NixOS configuration.
error: Module `/nix/store/l4brpwjfwylhx7zvci0i7schrb4f2ivy-source/system/filesystems.nix' has an unsupported attribute `boot'. This is caused by introducing a top-level `config' or `options' attribute. Add configuration attributes immediately on the top level instead, or move all of them (namely: boot fileSystems services swapDevices) into the explicit `config' attribute.
It would be useful knowledge to know how to override options.
The package you want to target for override is boot.zfs.package, which, if you are using boot.kernelPackages = linuxPackages_latest, would be linuxPackages_latest.zfsUnstable, for example.
However, I don’t know for sure if it will actually work with 5.19 as I haven’t actually tested it, so I would advise caution. I myself have pinning my config to 5.18 for now until the next ZFS version is released.
It works with 5.19.8. I’m using it. I know it doesn’t come from top-level, there’s a link to the relevant source. You can’t override boot.zfs.package. I already tried that. If you know how to override read-only config options, let me know.
I am misunderstanding how overlays work, again. I thought that if I put the overlay in config.overlays during my manual import, any time that derivation would be requested the overrides would take effect. Allegedly not the case.
Didn’t realize it was read-only, however you can still just override the kernel specific package in an overlay.
Not quite in this case, since the derivation at the top-level and the one nested in the kernel packages are distinct from one another. You can still override a nested derivation, but it’s a bit more work. Something like:
Ah. I’ve seen this one before, actually. I didn’t realize that the package was re-exported by linuxPackages_latest, That is interesting. Would you mind pointing me at a line in the repository?
building the system configuration...
error: The option `boot.kernelPackages' is defined multiple times.
Definition values:
- In `/nix/store/7df9h8qqf4iwqx7jr78l16v87833nf40-source/system/filesystems.nix'
- In `/nix/store/fr68dr66gmggn62jir7vp1bcnignwxp9-source/flake.nix'
(use '--show-trace' to show detailed location information)
That second flake (filesystems is in mine) is just nixpkgs itself.
That is a bit strange, are you absolutely positive that is a reference to nixpkgs? I’ve never seen nix point to the flake.nix file before when this error surfaces. But assuming it is actually nixpkgs and there is genuinely nothing you can do (which should be reported and fixed eventually), in that case you could try boot.kernelPackages = lib.mkForce #... to force a higher priority.
If you just do that in the repl and ask it to eval the entire linuxPackages then it will evaluate everything in the top-level of that set, printing any warnings for each derivation that might have one along the way.
On a hunch, I commented out modules.lenovo-thinkpad-p14s-amd-gen2 from the nixos-hardware repository, and it started to build without complaint (using the override you provided).