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 {
|
2021-07-07 23:24:27 +02:00
|
|
|
assertions = [
|
|
|
|
(lib.hm.assertions.assertPlatform "services.parcellite" pkgs
|
|
|
|
lib.platforms.linux)
|
|
|
|
];
|
|
|
|
|
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";
|
2021-05-22 04:15:12 +02:00
|
|
|
Requires = [ "tray.target" ];
|
|
|
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
2017-12-05 23:23:31 +01:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|