2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.services.greenclip;
|
|
|
|
in {
|
|
|
|
|
|
|
|
options.services.greenclip = {
|
2024-09-19 14:19:46 +00:00
|
|
|
enable = lib.mkEnableOption "Greenclip, a clipboard manager";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
package = lib.mkPackageOption pkgs [ "haskellPackages" "greenclip" ] { };
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2020-04-24 23:36:52 +00:00
|
|
|
systemd.user.services.greenclip = {
|
|
|
|
enable = true;
|
|
|
|
description = "greenclip daemon";
|
|
|
|
wantedBy = [ "graphical-session.target" ];
|
|
|
|
after = [ "graphical-session.target" ];
|
2024-04-21 15:54:59 +00:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${cfg.package}/bin/greenclip daemon";
|
|
|
|
Restart = "always";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
};
|
|
|
|
}
|