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

Can not evaluate input if no lock-file #79

Open
LittleAmara opened this issue May 5, 2023 · 2 comments
Open

Can not evaluate input if no lock-file #79

LittleAmara opened this issue May 5, 2023 · 2 comments
Labels
A-flake Area: flake related C-bug Catagory: bug

Comments

@LittleAmara
Copy link

LittleAmara commented May 5, 2023

Hey, I don't know if it is the desired behaviour but if an input of a flake does not have a lock file then nil will throw this (see image below).
image

A simple flake to reproduce:

{
  description = "A very basic flake";
  inputs = {
    poetry2nix.url = "github:nix-community/poetry2nix";
  };

  outputs = { self, nixpkgs }: {

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

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

  };
}

Edit:
I'm on version 2023-05-02

@RaitoBezarius
Copy link

Just run into this too:

LSP[nil_ls] Flake input "home-manager" cannot be evaluated: `nix flake show path:/nix/store/1h8yz1jsh2pck91kfhrpxvkci6m0c1iy-source` failed with exit status: 1. Stderr:                                             
copying '/nix/store/1h8yz1jsh2pck91kfhrpxvkci6m0c1iy-source'...                                                                                                                                                      
evaluating file '/nix/store/1h8yz1jsh2pck91kfhrpxvkci6m0c1iy-source/flake.nix'                                                                                                                                       
downloading 'https://channels.nixos.org/flake-registry.json'...                                                                                                                                                      
downloading 'https://api.github.com/repos/NixOS/nixpkgs/commits/nixpkgs-unstable'...                                                                                                                                 
downloading 'https://api.github.com/repos/NixOS/nixpkgs/tarball/0b6445b611472740f02eae9015150c07c5373340'...                                                                                                         
evaluating file '/nix/store/bwps706g6ywl1811r7bwv32py12129ci-source/flake.nix'                                                                                                                                       
warning: creating lock file '/nix/store/1h8yz1jsh2pck91kfhrpxvkci6m0c1iy-source/flake.lock'                                                                                                                          
error: opening file '/nix/store/1h8yz1jsh2pck91kfhrpxvkci6m0c1iy-source/flake.lock': Read-only file system                                                                                                           
(use '--show-trace' to show detailed location information)

@oxalica oxalica added C-bug Catagory: bug A-flake Area: flake related labels May 6, 2023
@oxalica
Copy link
Owner

oxalica commented May 6, 2023

Seems we need --inputs-from <current-flake> <input_name> instead of directly using the input store path. But this would dump the current flake more often (we don't have lazy dumping yet NixOS/nix#6530), which is bad for big repo like nixpkgs.

BTW: You can temporarily disable the evaluation workspace-wide via nix.flake.autoEvalInputs = false since 21d0870

oxalica added a commit that referenced this issue May 9, 2023
This is too costly for huge flakes with lots of packages or leavy tests,
and also have issues on locked transitive inputs (#79).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-flake Area: flake related C-bug Catagory: bug
Projects
None yet
Development

No branches or pull requests

3 participants