overlay: make finalNix depend on the nix version being used by a package #37
Loading…
Reference in a new issue
No description provided.
Delete branch "fabianhjr/nixos-module:dynamic-nix-choice"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This should address both of the following (where 35 is more general and 36 a specific case)
Please let me know if there is a contributing guide (didn't find one on this repo unu) or if there is anything I should do/change.
@ -68,0 +68,4 @@
# Get the two common inputs of a derivation/package.
inputs = prev.${name}.buildInputs ++ prev.${name}.nativeBuildInputs;
nixDependency = lib.findFirst
(drv: lib.hasPrefix "nix-2." drv.name)
i think we can just look at pname/version (in a safely-fallible manner;
drv.pname ? ""
should be fine for this purpose), since these are nixpkgs derivations. that should make it a little safer for stuff like the prefixes added by cross compilation.tried pname first but isn't available :C
Was thinking on opening a PR to nixpkgs to expose the pname (along with name and version) which would uncurse this a bit
With this change on nixpkgs lix/nixos-module could use pname for this overlay.
https://github.com/NixOS/nixpkgs/pull/344735
f1277e616d
to6def4cc69a
6def4cc69a
to2669bc78a6
@ -68,0 +68,4 @@
# Get the two common inputs of a derivation/package.
inputs = prev.${name}.buildInputs ++ prev.${name}.nativeBuildInputs;
nixDependency = lib.findFirst
(drv: drv.pname == "nix")
it may be the case that stuff like runCommand outputs have no pname or version, which could cause this to explode at eval time if someone puts a runCommand derivation into an input that we are scanning like this:
We would want to do something like
(drv.pname or "") == "nix"
or similaramended the commit to use suggested guarding, thanks for the help
2669bc78a6
tob3457b78ac
merged manually since i apparently borked it oops
Pull request closed