Github path to flake.nix does not exist

Hello!

I’ve been having this issue for a few weeks now, and I haven’t managed to find any useful resources online. I want to rebuild my configuration, but then this error occurs:

error: path '«github:Gerg-L/mnw/0871dbf63a53610c95db04439ed8ea4d6ec9c160?narHash=sha256-VKKe8r4pwCGWZ3Yr9CPN129R4S3CKLSrlYqdYz3vKpM%3D»/flake.nix' does not exist

I’ve tried updating my flake inputs several times, and every time I do, the error simply occurs with a different source (for example, I previously had the same error with the flake-parts repo). My flake.nix inputs:

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    home-manager = {
      url = "github:nix-community/home-manager/master";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nvf = {
      url = "github:NotAShelf/nvf";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    niri = {
      url = "github:sodiboo/niri-flake";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

I’ve attempted to recreate the lock file multiple times, I’ve tried figuring out how exactly the path that throws the error was composed (as in where the hashes even come from, I’m aware that 0871dbf is the commit hash), but I still haven’t gotten any further in troubleshooting.

I would be very grateful for any help or valuables resources to learn from. Thank you in advance!

The pointed at commit does have a flake.nix. So it is very likely that you have some broken store paths.

Pleare run sudo nix-store --verify --check-contents --repair and see if it reports any unfixable errors. If there are unfixable errors, nix-store --gc might be able to remove the errornous paths, while another sudo nix-store --verify --check-contents --repair will confirm wether that worked or not.

If broken store paths are alive, things are a bit more delicate.

2 Likes

Class, thank you so much! Running sudo nix-store --verify --check-contents --repair did the trick. Is there anywhere that I could read more about how something like this occurs? I managed to rebuild the exact same configuration without errors before, how does the store usually break like this?

The most common issue is a power cut during non atomic filesystem operations in the store.

Then we have manual messups, and even if nixOS and nix do a lot to make you not able to mess up things, it’s quite common.

And then we have damaged filesystems and hardware.

This is in order of perceived occurrence based on my experiences here and my discord.

2 Likes