Skip to content

Failing to run nix-shell #99

@jcheatum

Description

@jcheatum

Describe the bug

When I try to select the shell.nix file in the current directory, it looks like it's just hanging on "Applying environment" forever, similar to #96. Looking at the console in dev tools, I see the following error:

Error: Command failed: nix-shell "/home/jcheatum/code/rmup/shell.nix" --run export
error: no argument specified and no 'shell.nix' or 'default.nix' file found in the working directory

The shell.nix file definitely exists, and it works fine running it manually from the terminal.

To Reproduce
Steps to reproduce the behavior:

  1. Use this shell.nix file:
#!/usr/bin/env -S nix-shell --pure

{ pkgs ? import <nixpkgs> {} }:
  pkgs.mkShell {
    nativeBuildInputs = with pkgs.buildPackages; [
      rustc
      cargo
      alsa-lib.dev
      pkg-config
    ];

    PKG_CONFIG_PATH = "${pkgs.alsa-lib.dev}/lib/pkgconfig";
}
  1. Run "Nix-Env: Select environment" from the ctrl+shift+p prompt
  2. Select the shell.nix file.

Expected behavior
It successfully loads the shell.nix.

Screenshots

Image

Environment:

  • OS: NixOS 25.05
  • VS Code: 1.100.2
  • Version: 1.1.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions