Skip to content

Nix crashes on conflicting home-manager options #14361

@jakubkaczor

Description

@jakubkaczor

Describe the bug

Nix crashes.

Context

I have the following home-manager Zellij configuration. I think this is not minimal configuration triggering the issue. I suppose zellij.enabled = true and following the Steps To Reproduce would be sufficient.

    zellij = {
      enable = true;
      enableZshIntegration = true;
    };
    nushell.extraConfig = ''
      if $env.ZELLIJ? == null {
        if $env.ZELLIJ_AUTO_ATTACH? == "true" {
          ${config.programs.zellij.package}/bin/zellij attach -c
        } else {
          ${config.programs.zellij.package}/bin/zellij
        }

        if $env.ZELLIJ_AUTO_EXIT? == "true" {
          exit
        }
      }
    '';

Steps To Reproduce

  1. Set home.sessionVariables.ZELLIJ_AUTO_EXIT = "true"; in home-manager configuration.
  2. Home-manager switch.

Expected behavior

Nix not crashing, but simply reporting an error message.

Metadata

> nix-env --version
nix-env (Nix) 2.28.5

Checklist

  • checked [latest Nix manual] ([source])
  • checked [open bug issues and pull requests] for possible duplicates

I was asked in the stdout to report a bug and include the following output.

error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'home-manager-generation'
         whose name attribute is located at /nix/store/6bwyhcqsr8pj2gyvdzsr742v9jf2zn52-source/pkgs/stdenv/generic/make-derivation.nix:480:13

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'
         at /nix/store/6bwyhcqsr8pj2gyvdzsr742v9jf2zn52-source/pkgs/build-support/trivial-builders/default.nix:80:17:
           79|         enableParallelBuilding = true;
           80|         inherit buildCommand name;
             |                 ^
           81|         passAsFile = [ "buildCommand" ] ++ (derivationArgs.passAsFile or [ ]);

       … while evaluating the option `home.activation.checkFilesChanged.data':

       … while evaluating definitions from `/nix/store/a4la088hi5id7sw77gy9zdvwn83dgczz-source/modules/files.nix':

       … while evaluating the option `home.file."Library/Fonts/.home-manager-fonts-version".onChange':

       … while evaluating definitions from `/nix/store/a4la088hi5id7sw77gy9zdvwn83dgczz-source/modules/targets/darwin/fonts.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: The option `home.sessionVariables.ZELLIJ_AUTO_EXIT' has conflicting definition values:
       - In `/nix/store/v2ihm623javngxbmzy5gmgmjq4r2j56w-source/modules/programs/zellij.nix': "true"
       - In `/nix/store/a4la088hi5id7sw77gy9zdvwn83dgczz-source/modules/programs/zellij.nix': "false"
       Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.
Nix crashed. This is a bug. Please report this at https://github.com/NixOS/nix/issues with the following information included:

Exception: std::__1::system_error: mutex lock failed: Invalid argument
Stack trace:
 0# nix::(anonymous namespace)::onTerminate() in /nix/store/g4fn2b8j3cfs3vci0fam4iws8nikd4wn-nix-2.28.5/bin/nix
 1# std::__terminate(void (*)()) in /nix/store/sg5gfy9cj0991jbd4xfyrl21rmqib9r2-libcxx-19.1.7/lib/libc++abi.1.0.dylib
 2# __cxa_get_exception_ptr in /nix/store/sg5gfy9cj0991jbd4xfyrl21rmqib9r2-libcxx-19.1.7/lib/libc++abi.1.0.dylib
 3# __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) in /nix/store/sg5gfy9cj0991jbd4xfyrl21rmqib9r2-libcxx-19.1.7/lib/libc++abi.1.0.dylib
 4# std::__1::__throw_system_error[abi:ne190107](std::__1::error_code, char const*) in /nix/store/sg5gfy9cj0991jbd4xfyrl21rmqib9r2-libcxx-19.1.7/lib/libc++.1.0.dylib
 5# std::__1::__throw_system_error[abi:ne190107](std::__1::error_code, char const*) in /nix/store/sg5gfy9cj0991jbd4xfyrl21rmqib9r2-libcxx-19.1.7/lib/libc++.1.0.dylib
 6# std::__1::mutex::try_lock() in /nix/store/sg5gfy9cj0991jbd4xfyrl21rmqib9r2-libcxx-19.1.7/lib/libc++.1.0.dylib
 7# nix::updateWindowSize() in /nix/store/g4fn2b8j3cfs3vci0fam4iws8nikd4wn-nix-2.28.5/lib/libnixutil.dylib
 8# nix::signalHandlerThread(unsigned int) in /nix/store/g4fn2b8j3cfs3vci0fam4iws8nikd4wn-nix-2.28.5/lib/libnixutil.dylib
 9# void* std::__1::__thread_proxy[abi:fe190107]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(unsigned int), unsigned int>>(void*) in /nix/store/g4fn2b8j3cfs3vci0fam4iws8nikd4wn-nix-2.28.5/lib/libnixutil.dylib
10# _pthread_start in /usr/lib/system/libsystem_pthread.dylib

/Users/<username>/.nix-profile/bin/home-manager: line 544:  2267 Abort trap: 6           nix build "${extraArgs[@]}" "${PASSTHROUGH_OPTS[@]}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions