-
-
Notifications
You must be signed in to change notification settings - Fork 472
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
Still cannot set fish as default shell #1237
Comments
You'll need to add yourself to |
Ah thanks! I added darwin-rebuild switch --flake ~/.config/nix-darwin
building the system configuration...
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:34:12:
33|
34| strict = derivationStrict drvAttrs;
| ^
35|
… while evaluating derivation 'darwin-system-25.05.20241223.de18642+darwin5.a35b08d'
whose name attribute is located at /nix/store/73cnf2k7mji95fcflvay15pdw4skhhk5-source/pkgs/stdenv/generic/make-derivation.nix:375:7
… while evaluating attribute 'activationScript' of derivation 'darwin-system-25.05.20241223.de18642+darwin5.a35b08d'
at /nix/store/9w5mmnkypiqczdlvmc4l2hd4xc3m44bq-source/modules/system/default.nix:97:7:
96|
97| activationScript = cfg.activationScripts.script.text;
| ^
98| activationUserScript = cfg.activationScripts.userScript.text;
… while evaluating the option `system.activationScripts.script.text':
… while evaluating definitions from `/nix/store/9w5mmnkypiqczdlvmc4l2hd4xc3m44bq-source/modules/system/activation-scripts.nix':
… while evaluating the option `system.activationScripts.users.text':
… while evaluating definitions from `/nix/store/9w5mmnkypiqczdlvmc4l2hd4xc3m44bq-source/modules/users':
… while evaluating the option `users.uids':
… while evaluating definitions from `/nix/store/9w5mmnkypiqczdlvmc4l2hd4xc3m44bq-source/modules/users':
… while evaluating the option `users.users.qys.uid':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: The option `users.users.qys.uid' was accessed but has no value defined. Try setting the option. It turns out that I also need to specify my
In addition, the document for
|
Yeah it's fine, there are safeguards in place, I don't have the time at the moment to update the docs, but if you could open a PR to update it I would review it 👍 |
Today is literally the first time I tried Nix, so I don't feel confident enough to update the docs right now (e.g., I'm not sure if the default user id is indeed 501, and if so, why I needed to specify it explicitly; I also think it's better to emit a warning instead of silently ignoring the configuration when we cannot "find" the user). Will try to help in the future though! |
I agree that we should emit a warning, feel free to open a PR |
As a follow up question: how does this work with home-manager? I am confused because there are two
Since In some sense, home-manager works by setting environment variables in these scripts, so it's very important to source them properly. For example, I have $ cat "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
# Only source this once.
if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi
export __HM_SESS_VARS_SOURCED=1
export EDITOR="nvim" Without What's the proper way to source the initialization script created by home-manager in the |
I remember for ZSH you need |
In my case, I specify a posix shell like bash, zsh, and dash as the login shell (or system layer shell). I also enable the option 'programs.fish.enable' in my nix-darwin config file, By doing so, nix-darwin will generate the enviroment setup scripts in /etc/fish for fish but don't set fish as default shell. Then I enable the 'programs.fish.enable' option in my home-manager, At last, I specific fish as the terminal shell (shell options in kitty.conf). So I can use fish like a default shell that all nix env sourced when I open a kitty terminal. |
This is probably a regression of #328, #779, and #811, which were considered fixed:
However, the following configuration doesn't seem to work on a fresh copy of macOS 15.2 (24C101).
After I logout and login again, the default shell is still
/bin/zsh
. Manually callingchsh
fails, and/etc/shells
doesn't seem to be updated:The text was updated successfully, but these errors were encountered: