Skip to content

Recent update seems to introduce issue with shell check and home-manager on macOS? #126

Open
@victorhooi

Description

@victorhooi

I recently ran a nix flake update, followed by a nix run ./#build-switch - and I now seem to be getting an NixOS error regarding the shell configuration?

❯ nix run ./#build-switch
warning: Git tree '/Users/foobar/nixos-config' is dirty
Running build-switch for aarch64-darwin
Starting build...
warning: Git tree '/Users/foobar/nixos-config' is dirty
error:
       … while evaluating the attribute 'value'
         at /nix/store/hfz1qqd0z8amlgn8qwich1dvkmldik36-source/lib/modules.nix:816:9:
          815|     in warnDeprecation opt //
          816|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          817|         inherit (res.defsFinal') highestPrio;

       … while calling the 'addErrorContext' builtin
         at /nix/store/hfz1qqd0z8amlgn8qwich1dvkmldik36-source/lib/modules.nix:816:17:
          815|     in warnDeprecation opt //
          816|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |                 ^
          817|         inherit (res.defsFinal') highestPrio;

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

       error:
       Failed assertions:
       - users.users.foobar.shell is set to fish, but
       programs.fish.enable is not true. This will cause the fish
       shell to lack the basic Nix directories in its PATH and might make
       logging in as that user impossible. You can fix it with:
       programs.fish.enable = true;

       If you know what you're doing and you are fine with the behavior,
       set users.users.foobar.ignoreShellProgramCheck = true;
       instead.

I do have the following in modules/shared/home-manager.nix:

 40   fish = {
 41     enable = true;
 42 #    loginShellInit = ''
 43 #      if [[ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish ]]; then
 44 #        source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish
 45 #        source /nix/var/nix/profiles/default/etc/profile.d/nix.fish
 46 #      fi
 47 #   '';
 48   };

However, it seems like NixOS itself might not be aware of the home-manager module?

NixOS/nixpkgs#280726

I'm pretty confused here as to the best way to fix this - is there some other place I should be setting fish.enable = true, on top of within home-manager.nix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions