I am getting a strange error when applying any overlay to haskellPackages.crypton. It seems to happen to literally any overlay implemented via the nixpkgs.overlays option. Example of a very simple overlay below with the error message:
error:
… while calling the 'head' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:1:35741:
… while evaluating the attribute 'value'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:34707:
… while evaluating the option `system.build.toplevel':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix':
… while evaluating the option `warnings':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd.nix':
… while evaluating the option `systemd.services.libvirtd-config.serviceConfig':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd.nix':
… while evaluating the option `systemd.services.libvirtd-config.script':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/virtualisation/libvirtd.nix':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: attribute 'pandoc-cli' missing
at /nix/store/lnz81i2lfvk77az9hzgxdxg198b9yc56-nixos/nixos/pkgs/by-name/pa/pandoc/package.nix:8:25:
7| installShellFiles,
8| selectPandocCLI ? (p: p.pandoc-cli), # The version of pandoc-cli choosen from haskellPackages.
| ^
9| }:
I suspect the issue is with how I am dealing with a package set VS pkgs.package as I have overlaid before, but I haven’t been able to find anything on how to overlay packages from package sets.
With you’re first attempt you’re replacing the entire haskellPackages set with one that contains a single package. The second attempt makes sense, but I don’t think it works due to implementation details. The correct way should be something like this:
error:
… while calling the 'head' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:1:35741:
… while evaluating the attribute 'value'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:34707:
… while evaluating the option `system.build.toplevel':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix':
… while evaluating the option `warnings':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd.nix':
… while evaluating the option `systemd.services.libvirtd-config.serviceConfig':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd.nix':
… while evaluating the option `systemd.services.libvirtd-config.script':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/virtualisation/libvirtd.nix':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: expected a set but found a function: «lambda @ /etc/nixos/configuration.nix:707:76»
The problematic line is is crypton = self.haskell.lib.compose.overrideCabal hsuper.crypton (oldAttrs: {