nix-community / nix-eval-jobs

Parallel nix evaluator with a streamable json output [maintainers @Mic92, @adisbladis]
GNU General Public License v3.0
154 stars 30 forks source link

Doesn't handle flake paths with "/" in the name #323

Open kjeremy opened 2 months ago

kjeremy commented 2 months ago

We have a lot of auto-generated flake names based on the scheme: "something/package-name". below we have .#cat27x/burn

$ nix flake show
...
└───packages
    └───x86_64-linux
        ├───"cat27x/burn": package 'burn.sh'
...
$ nix run nixpkgs#nix-eval-jobs -- --flake .#cat27x/burn
warning: unknown setting 'allowed-users'
warning: unknown setting 'extra-allowed-users'
warning: unknown setting 'trusted-users'
warning: `--gc-roots-dir' not specified
Using saved setting for 'extra-substituters = ssh-ng://nix-ssh@10.0.36.99 https://ros.cachix.org' from ~/.local/share/nix/trusted-settings.json.
Using saved setting for 'extra-trusted-public-keys = ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo=' from ~/.local/share/nix/trusted-settings.json.
error: flake 'git+file:///home/jkolb/ara/mrak-robot-2' does not provide attribute 'cat27x/burn'

I've also tried .#"cat27x/gcRoot" which doesn't work either.

adisbladis commented 2 months ago

You should be able to specify the full flake attribute: .#packages.x86_64-linux.cat27x/burn.

We don't have the same packages-centric lookup where the current system is inferred. Personally I don't think it would make sense for a tool like nix-eval jobs to have that, as it's a much more versatile and less opinionated tool than nix flake show & friends.

This discrepancy in lookups should be documented, and the error message should contain a hint that full attribute paths needs to be used.