disko cli: fix error about impurity with nix

The script is generated by calling `nix-build` on the `cli.nix` file.
This fails on systems, which have the nix option pure_eval set, as nix
refuses to evaluate an untracked file. This would normally be impure,
but in this case the file is supplied in the same nix store path, i.e.
it's not referencing foreign files. Thus adding the `--impure` argument
should leave the nix call in fact still pure.
This commit is contained in:
Soispha 2023-06-28 17:35:27 +02:00
parent fef67a1ddc
commit 90f24aef89
No known key found for this signature in database
GPG key ID: A5E94010C3A642AD

2
disko
View file

@ -116,8 +116,10 @@ else
abort "disko config must be an existing file or flake must be set"
fi
# The "--impure" is still pure, as the path is withing the nix store.
script=$(nix-build "${libexec_dir}"/cli.nix \
--no-out-link \
--impure \
--argstr mode "$mode" \
"${nix_args[@]}"
)