2017-12-05 22:23:31 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.parcellite;
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
in {
|
2017-12-05 22:23:31 +00:00
|
|
|
meta.maintainers = [ maintainers.gleber ];
|
|
|
|
|
2020-10-13 16:08:08 +00:00
|
|
|
options.services.parcellite = {
|
|
|
|
enable = mkEnableOption "Parcellite";
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.parcellite;
|
2021-10-09 09:14:08 +00:00
|
|
|
defaultText = literalExpression "pkgs.parcellite";
|
|
|
|
example = literalExpression "pkgs.clipit";
|
2020-10-13 16:08:08 +00:00
|
|
|
description = "Parcellite derivation to use.";
|
|
|
|
};
|
2017-12-05 22:23:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2021-07-07 21:24:27 +00:00
|
|
|
assertions = [
|
|
|
|
(lib.hm.assertions.assertPlatform "services.parcellite" pkgs
|
|
|
|
lib.platforms.linux)
|
|
|
|
];
|
|
|
|
|
2020-10-13 16:08:08 +00:00
|
|
|
home.packages = [ cfg.package ];
|
2017-12-05 22:23:31 +00:00
|
|
|
|
|
|
|
systemd.user.services.parcellite = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Lightweight GTK+ clipboard manager";
|
2021-05-22 02:15:12 +00:00
|
|
|
Requires = [ "tray.target" ];
|
|
|
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
2017-12-05 22:23:31 +00:00
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
2017-12-05 22:23:31 +00:00
|
|
|
|
|
|
|
Service = {
|
2020-10-13 16:08:08 +00:00
|
|
|
ExecStart = "${cfg.package}/bin/${cfg.package.pname}";
|
2017-12-05 22:23:31 +00:00
|
|
|
Restart = "on-abort";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|