-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/nh: init #294923
nixos/nh: init #294923
Conversation
Idk why the bot adds the |
4daaf6a
to
f02b017
Compare
6b300a9
to
1c5e611
Compare
Fixed some issues resulting of not using the |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/3619 |
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.
Hi mate,
I'm not that old yet to review NixOS module correctly. I need more XP. I'll leave this to one of the other maintainer.
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.
From my view:
- Usually in program modules, there's a let-binding at the top with
let
cfg = config.programs.nh;
in
which helps avoid redundancy / improve readability
- The other
mdDoc
usages can be removed as well
Otherwise seems ok to me
All of them? |
config = { | ||
warnings = | ||
if (!(cfg.clean.enable -> !config.nix.gc.automatic)) then [ | ||
"programs.nh.clean.enable and nix.gc.automatic are both enabled. Please use one or the other to avoid conflict." |
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.
"programs.nh.clean.enable and nix.gc.automatic are both enabled. Please use one or the other to avoid conflict." | |
"programs.nh.clean.enable and nix.gc.automatic conflict with each other, please decide for one of them." |
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.
This is less correct than the original; what was the intention behind this suggestion?
warnings = | ||
if (!(cfg.clean.enable -> !config.nix.gc.automatic)) then [ |
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.
Shouldn't this be an assertion?
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.
Was suggested by @eclairevoyant before: #294923 (comment)
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 don't think we need to arbitrarily block settings if they don't actually conflict. Warning seems better IMO.
{ | ||
assertion = cfg.clean.enable -> cfg.enable; | ||
message = "programs.nh.clean.enable requires programs.nh.enable"; | ||
} |
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.
Why not set this option to true?
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 don't think other modules work this way.
(oops) |
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.
Seems fine otherwise
thanks |
This reverts commit 60c019a.
Description of changes
Mostly a copy of the upstream module: https://github.com/viperML/nh/blob/master/module.nix
Marking as draft to get reactions about it. I need to add the release notes.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 馃憤 reaction to pull requests you find important.