-
-
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
defaultApp should have type 'derivation' - add better error message? #6448
Comments
We played around with language like “Apps can only be in and must be in the apps output attribute and have type app”. It’s an if-and-only-if situation. The other issue is the usage of defaultApp which is being deprecated and probably led to more confusion. Currently only “app.” should have apps. |
The other issue is the usage of defaultApp which is being deprecated and probably led to more confusion. Currently only “app.” should have apps.
I think that even if it’s deprecated, it would be nice to have
`defaultApp` be checked properly (I mean it’s _only_ deprecated, not
removed)
|
For anyone searching for this error due to using nix 2.8 with a flake.nix with rec {
# snip
packages.my-project = naersk-lib.buildPackage {
pname = "my-project";
root = ./.;
};
defaultPackage = packages.my-project;
# `nix run`
apps.my-project = utils.lib.mkApp {
drv = packages.my-project;
};
defaultApp = apps.my-project;
# snip
} (taken directly from the readme of nix-community/naersk) You should replace # snip
rec {
packages.default = naersk-lib.buildPackage {
pname = "my-project";
root = ./.;
};
apps.default = utils.lib.mkApp { drv = packages.default;};
}
# snip |
see NixOS/nix#6448 (comment) In nix 2.8 defaultPackage and defaultApp have to be replated to packages.default and apps.default
Yay, breaking changes on minor version updates! Cause: NixOS/nix#6448 (comment) I'll try submitting this package to nixpkgs, so the maintanence of the build instructions can be done separately. Until then this makes trying out process-compose for the latest nix users a breeze.
Allows `nix run .#` to work. See NixOS/nix#6448 (comment) for nix flake arcana.
Error message: ``` error: attribute 'defaultApp.x86_64-linux' should have type 'app' ``` Fix with help of NixOS/nix#6448.
Describe the bug
Hi. Can we add better error message? I just wasted a couple of hours finding out why that doesn't work on nix 2.8.
Steps To Reproduce
The text was updated successfully, but these errors were encountered: