mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-15 17:50:53 +00:00
nixos: reload home conf of logged users
This commit is contained in:
parent
5ee635b188
commit
2d6778ce80
1 changed files with 10 additions and 2 deletions
|
@ -19,6 +19,8 @@ let
|
||||||
} // optionalAttrs cfg.verbose { VERBOSE = "1"; };
|
} // optionalAttrs cfg.verbose { VERBOSE = "1"; };
|
||||||
serviceConfig = baseService username;
|
serviceConfig = baseService username;
|
||||||
};
|
};
|
||||||
|
# we use a service separated from nixos-activation
|
||||||
|
# to keep the logs separate
|
||||||
hmDropIn = "/share/systemd/user/home-manager.service.d";
|
hmDropIn = "/share/systemd/user/home-manager.service.d";
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
@ -111,8 +113,6 @@ in {
|
||||||
})
|
})
|
||||||
(mkIf (cfg.users != { } && cfg.useUserService) {
|
(mkIf (cfg.users != { } && cfg.useUserService) {
|
||||||
systemd.user.services.home-manager = (baseUnit "%u") // {
|
systemd.user.services.home-manager = (baseUnit "%u") // {
|
||||||
wantedBy = [ "default.target" ];
|
|
||||||
|
|
||||||
# user units cannot depend on system units
|
# user units cannot depend on system units
|
||||||
# TODO: Insert in the script logic for waiting on the nix socket via dbus
|
# TODO: Insert in the script logic for waiting on the nix socket via dbus
|
||||||
# like https://github.com/mogorman/systemd-lock-handler
|
# like https://github.com/mogorman/systemd-lock-handler
|
||||||
|
@ -139,6 +139,14 @@ in {
|
||||||
];
|
];
|
||||||
}) cfg.users;
|
}) cfg.users;
|
||||||
environment.pathsToLink = [ hmDropIn ];
|
environment.pathsToLink = [ hmDropIn ];
|
||||||
|
|
||||||
|
# Without this will not reload home conf
|
||||||
|
# of logged user on system activation
|
||||||
|
# it will also start the unit on startup
|
||||||
|
system.userActivationScripts.home-manager = {
|
||||||
|
text = "${pkgs.systemd}/bin/systemctl --user restart home-manager";
|
||||||
|
deps = [ ];
|
||||||
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue