-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Naming overlays arguments something other than final
and prev
should not be a hard failure
#5146
Comments
Any flake where the
|
You can use |
Someone has fixed the #flake.nix
{
description = "Overlay error message flake";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = { self, nixpkgs, flake-utils }:
{
# Use `self: super:` to make Nix generate the error message
overlay = (self: super: {
myapp = derivation;
});
} // (flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in rec {
apps = { myapp = pkgs.myapp; };
defaultApp = apps.myapp;
}));
} |
I marked this as stale due to inactivity. → More info |
Bump @oxapentane @revol-xut @astro |
In deadnix I still have to implement a workaround so that these lambda args cannot get renamed to |
Seems like they must be named final and prev (NixOS/nix#5146).
Describe the bug
I'm not familiar with the internals and intentions of
nix flake check
, however I was helping @bryanhonof figure out what was wrong when he gotoverlay does not take an argument named 'final'
.There are several issues here:
builtins.functionArgs
does exist, but normally you aren't deliberately trying to break people's code. It's apparently used a lot, for example to handlecallPackage
arguments, but that uses attrset arguments and notasd: asd
style functions, for which functionArgs doesn't even work properly)See also #4416
The responsible code is at
nix/src/nix/flake.cc
Lines 333 to 347 in c000cec
Steps To Reproduce
@bryanhonof can you give a repro for this?
Expected behavior
We will try to alleviate 2. a bit, by PR-ing a better error message.
We also took a short look at fixing the hard-failure problem but the changes looked not-quite-trivial - or at least we didn't offhand see how we should deal with the test suite, etc. I also don't know
nix flake check
how nix flake check is expected to behave, but standard things should be included, like being able to override checks if you decide to maintain everything as a hard failure. - otherwise, the solution is to separate linter issues, and give them as warnings.nix-env --version
outputnix-env (Nix) 2.4pre20210802_47e96bb
The text was updated successfully, but these errors were encountered: