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

nix develop shell incomplete PATH contents #10615

Open
corpix opened this issue Apr 27, 2024 · 1 comment
Open

nix develop shell incomplete PATH contents #10615

corpix opened this issue Apr 27, 2024 · 1 comment
Labels

Comments

@corpix
Copy link

corpix commented Apr 27, 2024

Describe the bug

Packages specified inside flake devShell packages is not listed in PATH inside nix develop shell.
Is it different from nix-shell? Why?

Steps To Reproduce

Create flake.nix with this content:

{
  inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
 
  outputs = { self, nixpkgs }:
    let
      arch = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${arch}.pkgs;

      inherit (pkgs)
        writeScript
        stdenv
        mkShell
      ;

      inherit (pkgs)
        ocserv
        go
        gnumake
      ;
    in {
      devShells.${arch}.default = mkShell {
        name = "authentik-ocserv";
        packages = [
          ocserv
          go
          gnumake
        ];
      };
    };
}

Enter nix develop, run ocserv, get command not found in response:

 ~/projects/src/git.backbone/corpix/authentik-ocserv  λ  echo $SHELLcf5qqa9yfxj59ki1rb21209x7wja0m-fish-3.7.1/bin/fish
 ~/projects/src/git.backbone/corpix/authentik-ocserv  λ  nix develop                                                                                                                               
Welcome to fish, the friendly interactive shell
 ~/projects/src/git.backbone/corpix/authentik-ocserv  λ  echo $SHELL                                                                                                                               
/nix/store/31cf5qqa9yfxj59ki1rb21209x7wja0m-fish-3.7.1/bin/fish
 ~/projects/src/git.backbone/corpix/authentik-ocserv  λ  ocserv                                                                                                                                    
fish: Unknown command: ocserv
 ~/projects/src/git.backbone/corpix/authentik-ocserv  λ  nix --version
nix (Nix) 2.18.2

Expected behavior

All packages listed under packages of mkShell exists in PATH.

nix-env --version output

nix-env (Nix) 2.18.2

Priorities

Add 👍 to issues you find important.

@corpix corpix added the bug label Apr 27, 2024
@corpix
Copy link
Author

corpix commented Apr 27, 2024

This could possibly be worked around with this ugly hack:

nix develop -c bash -ec 'exec fish'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant