-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
nh: fix auto clean #6325
base: master
Are you sure you want to change the base?
nh: fix auto clean #6325
Conversation
- Fix `PATH` variable - Remove flake path assertion - Add warning when HM's `nix.gc.automatic` is enabled
assertions = [{ | ||
assertion = (cfg.flake != null) -> !(lib.hasSuffix ".nix" cfg.flake); | ||
message = "nh.flake must be a directory, not a nix file"; | ||
}]; |
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 have my HM configuration in a folder called .config.nix
. So by this assertion, it can't be used.
IMO home-manager shouldn't try to guess what paths it doesn't have access to in build time are.
@@ -52,15 +52,11 @@ in { | |||
}; | |||
|
|||
config = { | |||
warnings = lib.optionals (!(cfg.clean.enable -> !osConfig.nix.gc.automatic)) |
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.
On standalone install osConfig
is null, so this fails to evaluate
message = "nh.flake must be a directory, not a nix file"; | ||
}]; | ||
warnings = | ||
(lib.optional (cfg.clean.enable && (osConfig.nix.gc.automatic or false)) |
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 might be missing something, but we want to raise a warning if both of these values are true
, right? Then I think &&
is easier to read and reason about than !(cfg.clean.enable -> !osConfig.nix.gc.automatic)
.
Please correct me if there are other cases.
@JohnRTitor please have a look 🙇 |
Changes mostly look good. I am busy this week due to work, I'll try to look at them in the weekend or next week. |
Description
PATH
environment variablenix.gc.automatic
is enabledChecklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
ornix develop --ignore-environment .#all
using Flakes.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Maintainer CC
@JohnRTitor