-
Notifications
You must be signed in to change notification settings - Fork 139
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
Rebuilding with custom packages fails #54
Comments
This is off topic so sorry in advance 😄, but how could I use an overlay that I added in overlays in a custom package in pkgs? |
I just ran into this exact error message. The secret sauce for me was changing the function declaration in
To
|
Thanks @proglottis, I had the same issue and this fixed it. |
Can anyone explain why this is the case? And if this will ever be added to the repository, because without it the overlay doesn't work. |
Thank you, this helped me too. I'm sure when @Misterio77 returns he'll give it a look. |
@proglottis Thank you so much for this. I spent too much time trying to figure it out and I didn't make even a step in the right direction. Nix is so hard 😢 |
That also solved it for me. But I would really like know why. |
This is because in this line in additions = final: _prev: import ../pkgs { pkgs = final; }; we call our function defined in However, looking at our function definition pkgs : {
...
} our single argument will become Changing this as @proglottis suggested works because we are changing the function definition to receive as an argument a set with a certain attribute requirement ( Another way to fix this is to keep additions = final: _prev: import ../pkgs final; or if we really only want to pass pkgs (which is probably what is intended here): additions = final: _prev: import ../pkgs final.pkgs; |
I wrote a simple shell script using
writeShellApplication
in a file calleddefault.nix
, inside a folder calledcustompackage
in thepkgs
folder, and then added it topkgs/default.nix
like this:custompackage = pkgs.callPackage ./custompackage {};
After that, I tried adding it to environment.systemPackages or home.packages, but either way, rebuilding fails with:
attribute 'callPackage' missing
I'm using the standard template, and it does build if
pkgs/default.nix
has no package.The text was updated successfully, but these errors were encountered: