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