Skip to content

nix-env-selector does not work with flakes #87

Closed
@samuela

Description

@samuela

Describe the bug
This bug manifests with similar symptoms as in #56... specifically stuck in the "Applying environment..." state, but AFAICT has a different root cause and I am therefore opening a separate issue.

When selecting a flake.nix from the nix-env-selector drop-down, the error

[Extension Host] Error: Command failed: nix-shell "/home/skainswo/dev/sshenanigans/flake.nix" --run export
error: nix-shell requires a single derivation
Try 'nix-shell --help' for more information.

    at ChildProcess.exithandler (node:child_process:420:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:322:12)

is shown in the developer console, and the tray icon stays in the "Applying environment..." spinner forever.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a project with a flake. For example, I am currently attempting to use nix-env-selector with https://github.com/samuela/sshenanigans.
  2. Run Nix-Env: Select environment... and select flake.nix from the drop down.
  3. Observe the error and infinity spinner......

Expected behavior
The environment equivalent to nix develop to be applied.

Screenshots
n/a

Environment:

  • OS: macOS 14.1.1, running over SSH on a NixOS 23.05
  • VS Code: Version: 1.85.1 (Universal), Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
  • Version: v1.0.10

Additional context
n/a

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