home-manager-auto-upgrade#8353
Conversation
|
I don't use it since a while Could you remove me as a maintainer please ? I may review later |
I removed you from the maintainers and added me. |
|
Please do not merge this pull request. |
|
@pinage404 |
| - null: use legacy behavior (deprecated) | ||
| - []: run no pre-switch commands |
There was a problem hiding this comment.
thought(non-blocking): i am surprised,i think i have never seen this kind of behavior before in Nix's options
i would not be surprise to have another option like behavior with values legacy or explicit
There was a problem hiding this comment.
Changed to use legacy behavior when preSwitchCommands is not set (=null).
I also find this implementation confusing
| echo "Changing to flake directory $FLAKE_DIR" | ||
| cd "$FLAKE_DIR" | ||
| echo "Update flake inputs" | ||
| nix flake update |
There was a problem hiding this comment.
thought(non-blocking): maybe this should go in the preSwitchScript
What do you think about it ?
There was a problem hiding this comment.
These lines are not included in the latest changes.
There was a problem hiding this comment.
Sorry, i put the comment in the wrong line
| Unit.Description = "Home Manager upgrade"; | ||
| Unit = { | ||
| Description = "Home Manager upgrade"; | ||
| X-SwitchMethod = "keep-old"; |
There was a problem hiding this comment.
question(blocking): i don't understand this line :
- What is the purpose of it ?
- Is it a standard thing of SystemD ?
- Is it a standard thing of Home Manager ?
- Do there is any doc about it somewhere ?
I would prefer to understand every line before approving something
There was a problem hiding this comment.
- What is the purpose of it ?
Prevent restart unit by reloadSystemd hook - Is it a standard thing of SystemD ?
no. X prefix used for systemd's non-standard options - Is it a standard thing of Home Manager ?
yes. - Do there is any doc about it somewhere ?
https://nix-community.github.io/home-manager/options.xhtml#opt-systemd.user.services._name_.Unit.Documentation
|
Maybe it could be worth to add a note in the release notes ? |
It might be good to add. |
| echo "Changing to flake directory $FLAKE_DIR" | ||
| cd "$FLAKE_DIR" | ||
| echo "Update flake inputs" | ||
| nix flake update |
There was a problem hiding this comment.
Sorry, i put the comment in the wrong line
| echo "Update Nix channels" | ||
| nix-channel --update |
There was a problem hiding this comment.
thought(non-blocking): maybe this should go in the preSwitchScript
What do you think about it ?
There was a problem hiding this comment.
I thought nix-channel --update was required for non-flake users.
Is there any other good way to implement it?
There was a problem hiding this comment.
Maybe they could have manually pinned every dependency in their repo and would like to override with a simpler git pull ?
| Unit.Description = "Home Manager upgrade"; | ||
| Unit = { | ||
| Description = "Home Manager upgrade"; | ||
| X-SwitchMethod = "keep-old"; |
There was a problem hiding this comment.
I don't know the standard format for this, i will let home-manager's maintainer check this
khaneliman
left a comment
There was a problem hiding this comment.
Please fixup/squash commits to follow contribution guidelines.
|
pr status ? |
|
could you like to review code @khaneliman |
b4d785a to
2185669
Compare
Add a flags option for passing extra arguments to home-manager switch and a preSwitchCommands option for running commands before the switch. Preserve the legacy flake update behavior behind a deprecation warning, clean up the shell script, and cover the flake path in tests.
Improve the option descriptions for enable, useFlake, flakeDir, and the systemd timer format.
Document the new flags and preSwitchCommands options for the auto-upgrade service.
2185669 to
a525c56
Compare
Migrate the preSwitchCommands default to lib.hm.deprecations.mkStateVersionOptionDefault instead of using a null sentinel. Keep the legacy flake update behavior for older state versions and add tests for the explicit, legacy, and current flake paths.
|
Alright, organized the commits and migrated the default deprecation to use my new state version helper. |
|
thank you for fixing! |
Description
Checklist
Change is backwards compatible.
Code formatted with
nix fmtornix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt.Code tested through
nix run .#tests -- test-allornix-shell --pure tests -A run.all.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
If this PR adds an exciting new feature or contains a breaking change.