nix/hm: add systemd.target in home-manager (#532)
* nix: add systemd.target
* fix: format
* Update README.md
* Update hm-module.nix
cf2b1d8405/example-units/hyprpaper.service (L19)
* fix
* Update README.md
This commit is contained in:
parent
a608e2afe1
commit
a17b76dea1
2 changed files with 14 additions and 4 deletions
|
|
@ -213,7 +213,10 @@ For NixOS users, a home manager module is also available.
|
||||||
```nix
|
```nix
|
||||||
programs.caelestia = {
|
programs.caelestia = {
|
||||||
enable = true;
|
enable = true;
|
||||||
systemd.enable = false; # if you prefer starting from your compositor
|
systemd = {
|
||||||
|
enable = false; # if you prefer starting from your compositor
|
||||||
|
target = "graphical-session.target";
|
||||||
|
};
|
||||||
settings = {
|
settings = {
|
||||||
bar.status = {
|
bar.status = {
|
||||||
showBattery = false;
|
showBattery = false;
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,13 @@ in {
|
||||||
default = true;
|
default = true;
|
||||||
description = "Enable the systemd service for Caelestia shell";
|
description = "Enable the systemd service for Caelestia shell";
|
||||||
};
|
};
|
||||||
|
target = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
The systemd target that will automatically start the Caelestia shell.
|
||||||
|
'';
|
||||||
|
default = "graphical-session.target";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = types.attrsOf types.anything;
|
type = types.attrsOf types.anything;
|
||||||
|
|
@ -65,8 +72,8 @@ in {
|
||||||
systemd.user.services.caelestia = lib.mkIf cfg.systemd.enable {
|
systemd.user.services.caelestia = lib.mkIf cfg.systemd.enable {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Caelestia Shell Service";
|
Description = "Caelestia Shell Service";
|
||||||
After = ["graphical-session.target"];
|
After = [cfg.systemd.target];
|
||||||
PartOf = ["graphical-session.target"];
|
PartOf = [cfg.systemd.target];
|
||||||
X-Restart-Triggers = lib.mkIf (cfg.settings != {}) [
|
X-Restart-Triggers = lib.mkIf (cfg.settings != {}) [
|
||||||
"${config.xdg.configFile."caelestia/shell.json".source}"
|
"${config.xdg.configFile."caelestia/shell.json".source}"
|
||||||
];
|
];
|
||||||
|
|
@ -86,7 +93,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = ["graphical-session.target"];
|
WantedBy = [cfg.systemd.target];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue