2020-10-12 00:22:58 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.parcellite;
|
|
|
|
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ maintainers.gleber ];
|
|
|
|
|
2021-07-02 22:36:30 +00:00
|
|
|
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.";
|
|
|
|
};
|
2020-10-12 00:22:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2021-07-02 22:36:30 +00:00
|
|
|
home.packages = [ cfg.package ];
|
2020-10-12 00:22:58 +00:00
|
|
|
|
|
|
|
systemd.user.services.parcellite = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Lightweight GTK+ clipboard manager";
|
2021-07-02 22:36:30 +00:00
|
|
|
Requires = [ "tray.target" ];
|
|
|
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
2020-10-12 00:22:58 +00:00
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
|
|
|
|
|
|
Service = {
|
2021-07-02 22:36:30 +00:00
|
|
|
ExecStart = "${cfg.package}/bin/${cfg.package.pname}";
|
2020-10-12 00:22:58 +00:00
|
|
|
Restart = "on-abort";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|