2017-12-05 23:23:31 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.parcellite;
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
in {
|
2017-12-05 23:23:31 +01:00
|
|
|
meta.maintainers = [ maintainers.gleber ];
|
|
|
|
|
2020-10-13 18:08:08 +02: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.";
|
|
|
|
};
|
2017-12-05 23:23:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2020-10-13 18:08:08 +02:00
|
|
|
home.packages = [ cfg.package ];
|
2017-12-05 23:23:31 +01:00
|
|
|
|
|
|
|
systemd.user.services.parcellite = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Lightweight GTK+ clipboard manager";
|
|
|
|
After = [ "graphical-session-pre.target" ];
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
2017-12-05 23:23:31 +01:00
|
|
|
|
|
|
|
Service = {
|
2020-10-13 18:08:08 +02:00
|
|
|
ExecStart = "${cfg.package}/bin/${cfg.package.pname}";
|
2017-12-05 23:23:31 +01:00
|
|
|
Restart = "on-abort";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|