2020-06-07 17:59:50 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.clipmenu;
|
|
|
|
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ maintainers.DamienCassou ];
|
|
|
|
|
|
|
|
options.services.clipmenu = {
|
2023-07-01 23:45:18 +00:00
|
|
|
enable = mkEnableOption "clipmenu, the clipboard management daemon";
|
2020-06-07 17:59:50 +00:00
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.clipmenu;
|
|
|
|
defaultText = "pkgs.clipmenu";
|
2023-07-01 23:45:18 +00:00
|
|
|
description = "clipmenu derivation to use.";
|
2020-06-07 17:59:50 +00:00
|
|
|
};
|
2022-08-15 17:19:16 +00:00
|
|
|
|
|
|
|
launcher = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = null;
|
|
|
|
example = "rofi";
|
2023-07-01 23:45:18 +00:00
|
|
|
description = ''
|
2023-06-30 23:30:13 +00:00
|
|
|
Launcher command, if not set, {command}`dmenu`
|
2022-08-15 17:19:16 +00:00
|
|
|
will be used by default.
|
|
|
|
'';
|
|
|
|
};
|
2020-06-07 17:59:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2021-07-07 21:24:27 +00:00
|
|
|
assertions = [
|
|
|
|
(lib.hm.assertions.assertPlatform "services.clipmenu" pkgs
|
|
|
|
lib.platforms.linux)
|
|
|
|
];
|
|
|
|
|
2020-06-07 17:59:50 +00:00
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
2022-08-15 17:19:16 +00:00
|
|
|
home.sessionVariables =
|
|
|
|
mkIf (cfg.launcher != null) { CM_LAUNCHER = cfg.launcher; };
|
|
|
|
|
2020-06-07 17:59:50 +00:00
|
|
|
systemd.user.services.clipmenu = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Clipboard management daemon";
|
|
|
|
After = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
|
|
|
ExecStart = "${cfg.package}/bin/clipmenud";
|
2023-11-02 03:36:53 +00:00
|
|
|
Environment = [
|
|
|
|
"PATH=${
|
2020-06-07 17:59:50 +00:00
|
|
|
makeBinPath
|
|
|
|
(with pkgs; [ coreutils findutils gnugrep gnused systemd ])
|
2023-11-02 03:36:53 +00:00
|
|
|
}"
|
|
|
|
];
|
2020-06-07 17:59:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|