dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

nix flake show fails

Open osbm opened this issue 8 months ago • 5 comments

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.

osbm avatar May 12 '25 16:05 osbm

No errors:

$ docker run --rm ghcr.io/lix-project/lix:latest nix --extra-experimental-features "nix-command flakes" flake show github:isabelroses/dotfiles

Also no errors:

$ docker run --rm osbm/nix nix run nixpkgs#lix -- flake show github:isabelroses/dotfiles

Sorry for the stupid ahh docker commands i cant gc my store rn 🪫🥀

osbm avatar May 12 '25 16:05 osbm

Judging by the leaky __final is that nixos/nix? If so it might be the differing lockfile format between lix and nix.

isabelroses avatar May 12 '25 16:05 isabelroses

Yes, ill update my comment to nixos/nix

osbm avatar May 12 '25 16:05 osbm

I might fix this. But honestly, I'm not inclined to because I would either have to call the package though npins or some other source and I don't think its worth the effort of vendoring.

I may expose my lix-patches though another flake if i ever get round to it. Which would also fix this.

isabelroses avatar May 12 '25 17:05 isabelroses

Like i said this is nothing important. You really dont have to fix it if you don't want, this issue is meant to just inform you. Its totally up to you.

osbm avatar May 12 '25 17:05 osbm

Should be fixed now :D

isabelroses avatar Jun 24 '25 08:06 isabelroses