{ lib, config, pkgs, ... }: with lib; let cfg = config.modules.desktop.clipse; in { options.modules.desktop.clipse = { enable = mkEnableOption "Enable clipse, a generic clipboard manager"; package = mkOption { type = types.package; default = pkgs.clipse; example = "pkgs.clipse"; }; }; config = mkIf cfg.enable { hm.systemd.user.services.clipse = { Unit = { Description = "clipse, a generic clipboard manager"; After = [ "graphical-session-pre.target" ]; PartOf = [ "graphical-session.target" ]; }; Install = { WantedBy = [ "graphical-session.target" ]; }; Service = { Type = "simple"; ExecStart = "${lib.getExe cfg.package} -listen-shell"; Restart = "on-failure"; RestartSec = 5; }; }; }; }