Skip to content

throw "USER environment variable is not set. Run with --impure and ensure USER is exported." #21

@vorburger

Description

@vorburger

In a Codespace I'm using with Nix, this doesn't quite work... even though the Nix based Container Test CI passes:

2026-03-21 08:59:56.538Z: copying path '/nix/store/z4bfwjlbd6bhasl6hndq9wi6y7xfsbqg-home-manager-0-unstable-2026-03-13' from 'https://cache.nixos.org'...

2026-03-21 08:59:57.906Z: error:
       … while calling the 'throw' builtin
         at /nix/store/2fhrvwyzf7jsky5lg3532agdpv91554x-source/dotfiles/home-manager/flake.nix:26:11:
           25|         if u != "" then u else
           26|           throw "USER environment variable is not set. Run with --impure and ensure USER is exported.";
             |           ^
           27|       envHOME = builtins.getEnv "HOME";

       error: USER environment variable is not set. Run with --impure and ensure USER is exported.

2026-03-21 08:59:57.997Z: error:
       … while calling the 'throw' builtin
         at /nix/store/2fhrvwyzf7jsky5lg3532agdpv91554x-source/dotfiles/home-manager/flake.nix:26:11:
           25|         if u != "" then u else
           26|           throw "USER environment variable is not set. Run with --impure and ensure USER is exported.";
             |           ^
           27|       envHOME = builtins.getEnv "HOME";

       error: USER environment variable is not set. Run with --impure and ensure USER is exported.

2026-03-21 08:59:58.077Z: error:
       … while calling the 'throw' builtin
         at /nix/store/2fhrvwyzf7jsky5lg3532agdpv91554x-source/dotfiles/home-manager/flake.nix:26:11:
           25|         if u != "" then u else
           26|           throw "USER environment variable is not set. Run with --impure and ensure USER is exported.";
             |           ^
           27|       envHOME = builtins.getEnv "HOME";

       error: USER environment variable is not set. Run with --impure and ensure USER is exported.

2026-03-21 08:59:58.160Z: error:
       … while calling the 'throw' builtin
         at /nix/store/2fhrvwyzf7jsky5lg3532agdpv91554x-source/dotfiles/home-manager/flake.nix:26:11:
           25|         if u != "" then u else
           26|           throw "USER environment variable is not set. Run with --impure and ensure USER is exported.";
             |           ^
           27|       envHOME = builtins.getEnv "HOME";

       error: USER environment variable is not set. Run with --impure and ensure USER is exported.

2026-03-21 08:59:58.171Z: 
2026-03-21 08:59:58.171Z: 
2026-03-21 08:59:58.171Z: Exit code 1
2026-03-21 08:59:58.174Z: Stop: Run in container: # Clone & install dotfiles
2026-03-21 08:59:58.187Z: Outcome: success User: code WorkspaceFolder: /workspaces/enola2
2026-03-21 08:59:58.194Z: devcontainer process exited with exit code 0

=================================================================================
2026-03-21 08:59:58.195Z: Finished configuring codespace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions