mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
4f70f49cec
This target is for systemd units that require a system tray to be running. This also fixes taffybar.service: previously, systemd would consider it to be active (running) before it was actually ready to accept tray icons.
43 lines
1,007 B
Nix
43 lines
1,007 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.parcellite;
|
|
|
|
in {
|
|
meta.maintainers = [ maintainers.gleber ];
|
|
|
|
options.services.parcellite = {
|
|
enable = mkEnableOption "Parcellite";
|
|
|
|
package = mkOption {
|
|
type = types.package;
|
|
default = pkgs.parcellite;
|
|
defaultText = literalExample "pkgs.parcellite";
|
|
example = literalExample "pkgs.clipit";
|
|
description = "Parcellite derivation to use.";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = [ cfg.package ];
|
|
|
|
systemd.user.services.parcellite = {
|
|
Unit = {
|
|
Description = "Lightweight GTK+ clipboard manager";
|
|
Requires = [ "tray.target" ];
|
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
|
PartOf = [ "graphical-session.target" ];
|
|
};
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
|
|
Service = {
|
|
ExecStart = "${cfg.package}/bin/${cfg.package.pname}";
|
|
Restart = "on-abort";
|
|
};
|
|
};
|
|
};
|
|
}
|