Coder Social home page Coder Social logo

Comments (8)

ocharles avatar ocharles commented on June 12, 2024 1

Here's a "repro" (ish):

[nix-shell:~/tmp]$ mkdir issue-257

[nix-shell:~/tmp]$ cd issue-257/

[nix-shell:~/tmp/issue-257]$ nix flake init

[nix-shell:~/tmp/issue-257]$ nvim flake.nix 

[nix-shell:~/tmp/issue-257]$ nix flake lock
error: source tree referenced by 'git+file:///home/ollie/tmp?dir=issue-257&ref=master&rev=8944c969d1ff3eb07e3f0c5e3a5db349a41e9d54' does not contain a 'issue-257/flake.nix' file

[nix-shell:~/tmp/issue-257]$ git init
Initialized empty Git repository in /home/ollie/tmp/issue-257/.git/

[nix-shell:~/tmp/issue-257]$ git add flake.nix 

[nix-shell:~/tmp/issue-257]$ cat flake.nix 
{
  description = "A very basic flake";

  inputs.nixpkgs-fmt.url = "github:nix-community/nixpkgs-fmt";

  outputs = { self, nixpkgs }: {

    packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;

    defaultPackage.x86_64-linux = self.packages.x86_64-linux.hello;

  };
}

[nix-shell:~/tmp/issue-257]$ nix flake lock
warning: Git tree '/home/ollie/tmp/issue-257' is dirty
error: input 'nixpkgs-fmt/fenix/naersk' follows a non-existent input 'naersk'
(use '--show-trace' to show detailed location information)

[nix-shell:~/tmp/issue-257]$ 

from nixpkgs-fmt.

zimbatm avatar zimbatm commented on June 12, 2024

if I run nix run in the repo, I get:

$ nix run --show-trace
error: in pure evaluation mode, 'fetchTarball' requires a 'sha256' argument

       … while evaluating the file '/nix/store/d28xpy5rjhvy20p0dfdbvl68way34yg0-source/packages.nix':

Where the source is fenix.

Something is broken in flake land

from nixpkgs-fmt.

zimbatm avatar zimbatm commented on June 12, 2024

fenix is loading flake-compat for some reason

from nixpkgs-fmt.

zimbatm avatar zimbatm commented on June 12, 2024

Are you using the "follows" notation in your flake.nix?

I'm asking because the pinned version of fenix has naersk as a dependency, but not the latest one.

from nixpkgs-fmt.

figsoda avatar figsoda commented on June 12, 2024

fenix used to depend on naersk, but the dependency was removed here because of nix-community/naersk#184.

Removing this line should fix the issue:

inputs.fenix.inputs.naersk.follows = "naersk";

from nixpkgs-fmt.

zimbatm avatar zimbatm commented on June 12, 2024

What's weird is that nixpkgs-fmt pins an older version of fenix, and flake is not respecting that for some reason.

from nixpkgs-fmt.

ocharles avatar ocharles commented on June 12, 2024

What's weird is that nixpkgs-fmt pins an older version of fenix, and flake is not respecting that for some reason.

Yes, this is what puzzled me. I thought the whole point was because it worked at one point it should work now, but no such dice!

from nixpkgs-fmt.

tnytown avatar tnytown commented on June 12, 2024

I'm not exactly sure what's happening here, but adding naersk to my dependent flake fixes the issue, viz.

{
  inputs.naersk.url = "github:nix-community/naersk";
}

The flake then evaluates correctly and I can see all my flake inputs:

$ nix flake metadata
warning: Git tree '/home/tny/config' is dirty
Resolved URL:  git+file:///home/tny/config
Locked URL:    git+file:///home/tny/config
Description:   {system, home} configuration flake
Path:          /nix/store/bmz5kg2p1vi8gsn5qkdcs9y9c29lc0gc-source
Last modified: 2021-08-27 16:04:29
Inputs:
<snip>
├───nixpkgs-format: github:nix-community/nixpkgs-fmt/7849a089bd876dc9ddf529513d887593b9be059c
│   ├───fenix: github:nix-community/fenix/fffd864ad08ed95fcb66554513fa07a5f3d626b5
│   │   ├───naersk follows input 'naersk'
│   │   ├───nixpkgs follows input 'nixpkgs'
│   │   └───rust-analyzer-src: github:rust-analyzer/rust-analyzer/87ef340c19ae5ac73fc9b1cd37909d9d8ad53d09
│   ├───flake-utils: github:numtide/flake-utils/b543720b25df6ffdfcf9227afafc5b8c1fabfae8
│   ├───naersk: github:nmattia/naersk/a3f40fe42cc6d267ff7518fa3199e99ff1444ac4
│   │   └───nixpkgs follows input 'nixpkgs'
│   └───nixpkgs follows input 'nixpkgs'

The commit hash shown for fenix (nix-community/fenix@fffd864) seems to line up with the locked hash.

"rev": "fffd864ad08ed95fcb66554513fa07a5f3d626b5",

from nixpkgs-fmt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.