-
-
Notifications
You must be signed in to change notification settings - Fork 2k
nixos: optionally use user service for activation (updates #2548) #6981
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
base: master
Are you sure you want to change the base?
Conversation
Don't worry, clearly I didn't have the time to properly develop it |
I relied on my own adaptation of @pasqui23's work - this is especially useful when using PAM-mounts, which i was using on my daily driver. I love to see some progress on this! Keeping my HM fork updated was bothersome, this is nice! |
Home-manager startup at login worked fine with patch #2548. But with this new patch, home-manager doesn't start correctly at login for me. My setup mounts the home directory at login. Patch #2548 fixed a home-manager startup issue with this setup. Question: Did this new patch change anything related to timing (e.g., service startup order) that could affect the fix from #2548? If this new patch breaks the #2548 fix, the old problem (where home-manager doesn't start correctly) will return, and this is a big issue for my setup. |
@mikunimaru I want this patch for the same reason you do -- mounting the home directory at login -- and I did not intentionally change anything that should have broken this usage. I'm guessing one of the changes from home-manager master branch, that weren't included in #2548, is at fault. Can you share more details on the behavior change you are observing? What errors did you get, which operations changed their timing, etc. |
Add an option, `home-manager.useUserService`, to use systemd user services for per-user activation, rather than activating all users' environments on boot using systemd system services. This option enables use of home-manager in configurations where users' home directories are not available until they log in (for example, when using pam_mount).
applied this PR as a patch and it works perfectly to allow so thanks for this and I hope this gets merged soon! |
This is an updated version of PR #2548. I am filing it like this because I was not able to figure out how to file it any other way; it is not my intention to stage a hostile takeover of @pasqui23's work, only to address one (fairly serious) problem and to make the PR mergeable as quickly as possible. I require this feature to be able to use home-manager at all and I'd really like to see it squeak under the bar for 25.05.
Description
Add an option,
home-manager.useUserService
, to use systemd user services for per-user activation, rather than activating all users' environments on boot using systemd system services. This option enables use of home-manager in configurations where users' home directories are not available until they log in (for example, when using pam_mount).The documentation for the new option is:
Changes from PR #2548
Remove the special treatment of
.ssh/config
. As far as I can tell from OpenSSH's documentation, this was never necessary; sshd does not look at.ssh/config
at all, so it does not need to be available pre-login. The file that does need to be available pre-login, on systems that run sshd, isauthorized_keys
, and the NixOS ssh service module already handles that.This is the piece that addresses a serious problem; the special treatment of
.ssh/config
was buggy and was causing any attempt (by me) to build a NixOS configuration from @pasqui23's branch to crash.Expand the documentation of the new option.
Remove the duplicate copy of the installation section of the manual (this appears to have been added by accident).
Squash all patches on the branch, for ease of review, and rebase against current top of trunk (8a31864).
Checklist
Change is backwards compatible.
Code formatted with
nix fmt
or./format
.Code tested through
nix-shell --pure tests -A run.all
or
nix build --reference-lock-file flake.lock ./tests#test-all
using Flakes.(There are a bunch of "trace: evaluation warning:" messages but they all look to be unrelated to this change.)
Test cases updated/added. See example.
(I will happily add some test cases but I could use some advice first as to what sort of testing would be appropriate for a new option with global effects.)
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
Maintainer CC
@rycee @khaneliman @ncfavier