Skip to content

Better handling if nix-command is not enabled #1110

Open
@ninjalf2

Description

@ninjalf2

After installing obelisk on a clean install of Ubuntu 24.10, I get this error when running ob run:

user@vm:~/emptydir$ ob run
./.obelisk/impl: command not cached, building ...
DONE Built on ./.obelisk/impl [command]
Process exited with code 1; /nix/store/7wfnj6hg24p9v212qfx81a16f6rnaqzy-nix-2.11.0/bin/nix eval --impure --expr $'(let a = import ./. {}; in toString (a.reflex.nixpkgs.lib.isDerivation a.passthru.staticFilesImpure))' --raw

Then, running the command myself I find out that it's because nix-command is not enabled:

user@vm:~/emptydir$ /nix/store/7wfnj6hg24p9v212qfx81a16f6rnaqzy-nix-2.11.0/bin/nix eval --impure --expr $'(let a = import ./. {}; in toString (a.reflex.nixpkgs.lib.isDerivation a.passthru.staticFilesImpure))' --raw
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features

After setting experimental-features = nix-command in my /etc/nix/nix.conf and restarting the Nix daemon then it works and my local dev server is up and running. Great!

But the error message that I got initially was not very helpful and even though it did not take much work to find the cause, it should be detected somewhere automatically and the user should be handed an error message that actually explains what is wrong.

EDIT: Related to #1085, #1061, #1010, #1072, and possibly more. Sorry for not checking beforehand. Feel free to close it if necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions