Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nix-index from a fixed output derivation does not work #256

Open
vkryachko opened this issue Oct 11, 2024 · 0 comments
Open

Use nix-index from a fixed output derivation does not work #256

vkryachko opened this issue Oct 11, 2024 · 0 comments

Comments

@vkryachko
Copy link

Hi, not sure if it's a known issue, but it would be great if output of nix-index on the same revision of nixpkgs would produce the same hash, it is not the case today, i.e. try running to this flake:

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

  outputs = { self, nixpkgs}: 
    let pkgs = nixpkgs.legacyPackages.x86_64-linux;
    in {
      packages.x86_64-linux.default = pkgs.runCommand "my-index" {
        nativeBuildInputs = [ pkgs.nix-index pkgs.nix ];
        outputHash = "";
        outputHashAlgo = "sha256";
        outputHashMode = "recursive";
      } ''
        export NIX_STATE_DIR="$(mktemp -d)"
        nix-shell || true # makes nix populate state dir

        nix-index --db $out -s x86_64-linux --filter-prefix '/bin/' -f ${nixpkgs}

      '';
    };
}

Produced hash will be different every time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant