Skip to content
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

zshrc not getting sourced? I'm guessing I'm missing a step #7

Closed
sdellysse opened this issue May 15, 2024 · 2 comments
Closed

zshrc not getting sourced? I'm guessing I'm missing a step #7

sdellysse opened this issue May 15, 2024 · 2 comments

Comments

@sdellysse
Copy link

sdellysse commented May 15, 2024

Hi there,

I have added noshell to my /etc/nixos/flake.nix file, and in /etc/passwd I see that my login user has /run/current-system/sw/bin/noshell as it's shell. In my home manager config, I have the following:

      programs.zsh = { enable = true; };
      xdg.configFile."shell".source = "${pkgs.zsh}/bin/zsh";

When I open Konsole with this setup (after rebooting), my ~/.zshrc isn't sourced, and to be honest I'm not entirely sure if zsh is getting invoked at all. When I run zsh from that command line, it then shows my prompt and everything, screenshots below:

image

I'm guessing I'm missing a step or something?

@viperML
Copy link
Owner

viperML commented May 15, 2024

probably #4

@sdellysse
Copy link
Author

yup, that's it. for now, I did this, and I think it works

xdg.configFile."shell" = {
  executable = true;
  text = ''
    #!${pkgs.zsh}/bin/zsh

    if [[ -o interactive ]] ; then
      if [[ -o login ]] ; then
        exec ${pkgs.zsh}/bin/zsh --interactive --login "$@"
      fi

      exec ${pkgs.zsh}/bin/zhs --interactive "$@"
    fi

    if [[ -o login ]] ; then
      exec ${pkgs.zsh}/bin/zsh --login "$@"
    fi

    exec ${pkgs.zsh}/bin/zsh "$@"
  '';

this gives me this output:

image

viperML added a commit that referenced this issue May 16, 2024
viperML added a commit that referenced this issue May 16, 2024
Fixes #4, #7
Closes #5

Co-authored-by: Rutherther <[email protected]>
@viperML viperML closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants