alejandra
alejandra copied to clipboard
`error: attribute 'x86_64-linux' in selection path '"x86_64-linux"' not found` building 3.0.0
With the latest unstable nixpkgs
pkgs ?
import
(
fetchTarball
{
name = "nixos-22.11pre405560.2da64a81275";
url = "https://github.com/NixOS/nixpkgs/archive/2da64a81275b68fdad38af669afeda43d401e94b.tar.gz";
sha256 = "1k71lmzdaa48yqkmsnd22n177qmxxi4gj2qcmdbv0mc6l4f27wd0";
}
)
{},
and latest alejandra
- repo: https://github.com/kamadorueda/alejandra
rev: ef03f7ef74ec97fd91a016a51c9c9667fb315652 # 3.0.0
hooks:
- id: alejandra
stages: [commit]
alejandra fails to build on NixOS 22.05:
$ pre-commit run --all-files alejandra
alejandra (Nix)..........................................................Failed
- hook id: alejandra
- exit code: 1
+ command -v nix-build
/run/current-system/sw/bin/nix-build
+ '!command' -v nix-instantiate
/home/victor/.cache/pre-commit/repoogox7jk3/.pre-commit-entry.sh: line 10: !command: command not found
+ echo INFO: computing current system
INFO: computing current system
++ nix-instantiate --eval --expr builtins.currentSystem
+ system='"x86_64-linux"'
+ echo INFO: building Alejandra
INFO: building Alejandra
+ nix-build --attr '"x86_64-linux"' --out-link result-alejandra https://github.com/kamadorueda/alejandra/tarball/3.0.0
error: attribute 'x86_64-linux' in selection path '"x86_64-linux"' not found
(The !command
expression looks like a syntax error; presumably what was meant was ! command
. That's a separate issue though - the expression is
if !command -v nix-instantiate; then
echo 'ERROR: this pre-commit hook requires "nix-instantiate" to be installed first'
exit 1
fi
, which is falsy either way. It's just falsy for the wrong reason. Fix PR.)