nix flake show fails
This is nothing important, i just wanted to tell yall about it, when i try to learn a flake i always run the `nix flake show` to see what is outputted in that flake. (everybody does things differently and trying to read nix code is hard ok????😭🥀)
```
$ nix flake show github:isabelroses/dotfiles
github:isabelroses/dotfiles/8749312cbc0bee6f4a82a2edee866ef660ddbfe1?narHash=sha256-AL5GJEz4M6f0g1055ha6wvOXuEoqmMflh1kaAP8CksA%3D
├───checks
│ ├───aarch64-darwin
│ │ ├───actionlint omitted (use '--all-systems' to show)
│ │ ├───lib omitted (use '--all-systems' to show)
│ │ └───treefmt omitted (use '--all-systems' to show)
│ ├───aarch64-linux
│ │ ├───actionlint omitted (use '--all-systems' to show)
│ │ ├───lib omitted (use '--all-systems' to show)
│ │ └───treefmt omitted (use '--all-systems' to show)
│ ├───x86_64-darwin
│ │ ├───actionlint omitted (use '--all-systems' to show)
│ │ ├───lib omitted (use '--all-systems' to show)
│ │ └───treefmt omitted (use '--all-systems' to show)
│ └───x86_64-linux
│ ├───actionlint: derivation 'actionlint'
│ ├───lib: derivation 'nix-flake-tests-success'
│ └───treefmt: derivation 'treefmt-check'
├───darwinConfigurations: unknown
├───deploy: unknown
├───devShells
│ ├───aarch64-darwin
│ │ ├───default omitted (use '--all-systems' to show)
│ │ └───nixpkgs omitted (use '--all-systems' to show)
│ ├───aarch64-linux
│ │ ├───default omitted (use '--all-systems' to show)
│ │ └───nixpkgs omitted (use '--all-systems' to show)
│ ├───x86_64-darwin
│ │ ├───default omitted (use '--all-systems' to show)
│ │ └───nixpkgs omitted (use '--all-systems' to show)
│ └───x86_64-linux
│ ├───default: development environment 'dotfiles'
│ └───nixpkgs: development environment 'nix-shell'
├───formatter
│ ├───aarch64-darwin omitted (use '--all-systems' to show)
│ ├───aarch64-linux omitted (use '--all-systems' to show)
│ ├───x86_64-darwin omitted (use '--all-systems' to show)
│ └───x86_64-linux: package 'treefmt'
├───lib: unknown
├───nixosConfigurations
│ ├───amaterasu: NixOS configuration
│ ├───athena: NixOS configuration
│ ├───cottage: NixOS configuration
│ ├───hestia: NixOS configuration
│ ├───lilith: NixOS configuration
│ ├───minerva: NixOS configuration
│ ├───skadi: NixOS configuration
│ ├───valkyrie: NixOS configuration
│ └───wisp: NixOS configuration
├───overlays
│ └───default: Nixpkgs overlay
└───packages
├───aarch64-darwin
│ ├───docs omitted (use '--all-systems' to show)
│ ├───iztaller omitted (use '--all-systems' to show)
│ ├───libdoc omitted (use '--all-systems' to show)
│ └───lix omitted (use '--all-systems' to show)
├───aarch64-linux
│ ├───docs omitted (use '--all-systems' to show)
│ ├───iztaller omitted (use '--all-systems' to show)
│ ├───libdoc omitted (use '--all-systems' to show)
│ └───lix omitted (use '--all-systems' to show)
├───x86_64-darwin
│ ├───docs omitted (use '--all-systems' to show)
│ ├───iztaller omitted (use '--all-systems' to show)
│ ├───libdoc omitted (use '--all-systems' to show)
│ └───lix omitted (use '--all-systems' to show)
└───x86_64-linux
├───docs: package 'docs'
├───iztaller: package 'iztaller'
├───libdoc: package 'lib-docs'
error:
… while evaluating the attribute 'optionalValue.value'
at /nix/store/4hd7zwgjvf1gch8alkbvcsbmzpczp9ph-source/lib/modules.nix:1148:5:
1147|
1148| optionalValue = if isDefined then { value = mergedValue; } else { };
| ^
1149| };
… while evaluating a branch condition
at /nix/store/4hd7zwgjvf1gch8alkbvcsbmzpczp9ph-source/lib/modules.nix:1148:21:
1147|
1148| optionalValue = if isDefined then { value = mergedValue; } else { };
| ^
1149| };
… while evaluating definitions from `/nix/store/8lw7ywpxvmmzryn9mnipqhvac4vpwzik-source/modules/transposition.nix':
… while evaluating definitions from `/nix/store/36lvv6zaqlpzd5zwwlhpwv3wqhikpsam-source/modules/flake/packages, via option perSystem':
… while retrieving system-dependent attributes for input lix
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: mismatch in field 'url' of input '{"__final":true,"lastModified":1747007485,"narHash":"sha256-YVC8z1fP0rNb2ZERmaysHdSApQdLP78MOoI8+y0ijX4=","rev":"e4b48ca3f097813aeb2eefe4a78d19c151e61bb1","type":"tarball","url":"https://git.lix.systems/api/v1/repos/lix-project/lix/archive/e4b48ca3f097813aeb2eefe4a78d19c151e61bb1.tar.gz?rev=e4b48ca3f097813aeb2eefe4a78d19c151e61bb1"}', got '{"__final":true,"lastModified":1747007485,"narHash":"sha256-YVC8z1fP0rNb2ZERmaysHdSApQdLP78MOoI8+y0ijX4=","rev":"e4b48ca3f097813aeb2eefe4a78d19c151e61bb1","type":"tarball","url":"https://git.lix.systems/api/v1/repos/lix-project/lix/archive/e4b48ca3f097813aeb2eefe4a78d19c151e61bb1.tar.gz"}'
~ took 18s
$
```
But i cloned the repository, entered `nix develop` environment and tried the `nix flake show` again and it worked and now it works even outside the repository.
To consistently get the error:
```
$ docker run --rm nixos/nix nix --extra-experimental-features "nix-command flakes" flake show github:isabelroses/dotfiles
```
If this flake meant to only be evaluated by `lix` lemme know, i will close the issue.
Thank you for the awesome code.
4 条评论