New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: error: value is null while a Boolean was expected for current unstable of nixpkgs and master of home-manager #4035
Comments
I'm using And I meet the same problem. nixos on main [⇡] took 4s
❯ nix-info -m
- system: `"x86_64-linux"`
- host os: `Linux 6.3.1-zen1, NixOS, 23.05 (Stoat), 23.05.20230522.7084250`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.13.3`
- channels(sid): `"nixos"`
- channels(root): `"nixos"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos` |
I believe the issue is something to do with this: home-manager/modules/lib/file-type.nix Lines 60 to 68 in 43ed704
I think the issue occurs when A workaround that worked for me was to modify I tried changing my |
If you have missed it in the trace: From what I have seen, this seems to be caused by And I was able to extract a "good" and a "bad" commit of
diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix
index e90d0a6d202..d3cb22a1f53 100644
--- a/pkgs/build-support/trivial-builders/default.nix
+++ b/pkgs/build-support/trivial-builders/default.nix
@@ -128,23 +128,29 @@ rec {
writeTextFile =
{ name # the name of the derivation
, text
, executable ? false # run chmod +x ?
, destination ? "" # relative path appended to $out eg "/bin/foo"
, checkPhase ? "" # syntax checks, e.g. for scripts
, meta ? { }
, allowSubstitutes ? false
, preferLocalBuild ? true
}:
+ let
+ matches = builtins.match "/bin/([^/]+)" destination;
+ in
runCommand name
- { inherit text executable checkPhase meta allowSubstitutes preferLocalBuild;
+ { inherit text executable checkPhase allowSubstitutes preferLocalBuild;
passAsFile = [ "text" ];
+ meta = lib.optionalAttrs (executable && matches != null) {
+ mainProgram = lib.head matches;
+ } // meta;
}
''
target=$out${lib.escapeShellArg destination}
mkdir -p "$(dirname "$target")"
if [ -e "$textPath" ]; then
mv "$textPath" "$target"
else
echo -n "$text" > "$target"
fi
@@ -343,22 +349,20 @@ rec {
checkPhase =
if checkPhase == null then ''
runHook preCheck
${stdenv.shellDryRun} "$target"
# use shellcheck which does not include docs
# pandoc takes long to build and documentation isn't needed for in nixpkgs usage
${lib.getExe (haskell.lib.compose.justStaticExecutables shellcheck.unwrapped)} "$target"
runHook postCheck
''
else checkPhase;
-
- meta.mainProgram = name;
};
# Create a C binary
writeCBin = name: code:
runCommandCC name
{
inherit name code;
executable = true;
passAsFile = ["code"];
# Pointless to do this on a remote machine. So from my point of view, this seems to be an issue with nixpkgs. This change breaks for anything that uses |
The underlying issue seems to be fixed via NixOS/nixpkgs@4431bab (NixOS/nixpkgs#234862) which is not in the channels yet. I can successfully evaluate my configuration when using nixpkgs-master as I will probably just wait for the fix to propagate into the channels before updating again. |
It doesn't make sense to pass |
I think it is totally fine to have a fix in both… Making HM semantically correct, while at the same time keeping nixpkgs backward compatible. Though I wouldn't mind the latter if the error was less confusing and more obvious. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Are you following the right branch?
Is there an existing issue for this?
Issue description
I'm unable to execute home-manager switch with current nixpkgs unstable and home-manager master.
Output of home-manager switch --show-trace
Also the system issues a warning when enabling
enableNixpkgsReleaseCheck
. home-manager master seems to be on 23.05 instead of 23.11-pre.Workaround: I've now switched nixpkgs from unstable to 23.05.
Maintainer CC
No response
System information
The text was updated successfully, but these errors were encountered: