-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
croodle: init at 0.6.2 #242287
base: master
Are you sure you want to change the base?
croodle: init at 0.6.2 #242287
Conversation
b9fda7d
to
6fe0873
Compare
|
||
in | ||
|
||
stdenvNoCC.mkDerivation rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use the finalAttrs
pattern here.
Let me share a couple of useful links regarding this:
- History: https://discourse.nixos.org/t/avoid-rec-expresions-in-nixpkgs/8293
- Documentation: https://nixos.org/manual/nixpkgs/unstable/#mkderivation-recursive-attributes
- Recent example of implementation: https://github.com/NixOS/nixpkgs/compare/17f96f7b978e61576cfe16136eb418f74fab9952..9e6ea843e473d34d4f379b8b0d8ef0425a06defe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think the derivation arguments should be moved into the attribute set as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing. Right now, the dataDir
and debug
options can be overridden because they appear in the derivation argument set:
{ lib
, fetchurl
, nixosTests
, stdenvNoCC
, writeText
, dataDir ? "/var/lib/croodle"
, debug ? false
}:
let
configFile = ...
in
stdenvNoCC.mkDerivation (finalAttrs: { ...
If I'm understanding the finalAttrs pattern, I could also do the following:
{ lib
, fetchurl
, nixosTests
, stdenvNoCC
}:
stdenvNoCC.mkDerivation (finalAttrs: { ...
dataDir = "/var/lib/croodle";
debug = false;
Then I could access the values of finalAttrs.dataDir
and finalAttrs.debug
during the patch phase to write the configuration file. They would still be overrideable because of how the derivation wrapped in a lambda works.
Is my understanding correct and would you suggest I do so?
Description of changes
Add package for the croodle web app, a privacy-respecting scheduling and polling app.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)