mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
systemd: do not install systemd files when user is root (#2454)
For the user root, there are no user services provided by systemd. Therefore, these files will never be used.
This commit is contained in:
parent
15ae861e1b
commit
c2aa831491
3 changed files with 26 additions and 1 deletions
|
|
@ -258,7 +258,8 @@ in {
|
|||
|
||||
# If we run under a Linux system we assume that systemd is
|
||||
# available, in particular we assume that systemctl is in PATH.
|
||||
(mkIf pkgs.stdenv.isLinux {
|
||||
# Do not install any user services if username is root.
|
||||
(mkIf (pkgs.stdenv.isLinux && config.home.username != "root") {
|
||||
xdg.configFile = mkMerge [
|
||||
(lib.listToAttrs ((buildServices "service" cfg.services)
|
||||
++ (buildServices "slices" cfg.slices)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue