You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
modules: pre-commit: make pkgs.buildEnv composable
Passing a git-hooks.lib.<SYSTEM>.run derivation as a path to
pkgs.buildEnv results in the following error due to derivations with an
empty file being treated differently from derivations with an empty
directory:
The store path <TARGET> is a file and can't be merged into an
environment using pkgs.buildEnv!
Since Nixpkgs rejected explicitly handling derivations with an empty
file in pkgs.buildEnv [1], affected derivations should transition from
'touch $out' to 'mkdir $out' to be pkgs.buildEnv composable.
This change replaces 'touch $out' with 'mkdir $out' and makes the
following command work:
nix \
build \
--expr '
let
flake = builtins.getFlake (toString ./.);
system = builtins.currentSystem;
in
flake.inputs.nixpkgs.legacyPackages.${system}.buildEnv {
name = "";
paths = [(flake.outputs.lib.${system}.run {src = ./.;})];
}
' \
--impure
[1]: NixOS/nixpkgs#325140
Link: cachix#498
0 commit comments