clipmenu: add module

PR #1309
This commit is contained in:
Damien Cassou 2020-06-07 19:59:50 +02:00 committed by Robert Helgesson
parent 561b3d5650
commit 43ef16c3e1
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
4 changed files with 54 additions and 0 deletions

2
.github/CODEOWNERS vendored
View File

@ -101,6 +101,8 @@
/modules/services/cbatticon.nix @pmiddend
/modules/services/clipmenu.nix @DamienCassou
/modules/services/dunst.nix @rycee
/modules/services/emacs.nix @tadfisher

View File

@ -1552,6 +1552,14 @@ in
It can be enabled through the option 'services.emacs.socketActivation.enable'.
'';
}
{
time = "2020-06-12T17:48:01+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.clipmenu'
'';
}
];
};
}

View File

@ -120,6 +120,7 @@ let
(loadModule ./programs/zsh.nix { })
(loadModule ./services/blueman-applet.nix { })
(loadModule ./services/cbatticon.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/clipmenu.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/compton.nix { })
(loadModule ./services/dunst.nix { })
(loadModule ./services/dwm-status.nix { condition = hostPlatform.isLinux; })

View File

@ -0,0 +1,43 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.clipmenu;
in {
meta.maintainers = [ maintainers.DamienCassou ];
options.services.clipmenu = {
enable = mkEnableOption "clipmenu, the clipboard management daemon";
package = mkOption {
type = types.package;
default = pkgs.clipmenu;
defaultText = "pkgs.clipmenu";
description = "clipmenu derivation to use.";
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
systemd.user.services.clipmenu = {
Unit = {
Description = "Clipboard management daemon";
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${cfg.package}/bin/clipmenud";
Environment = "PATH=${
makeBinPath
(with pkgs; [ coreutils findutils gnugrep gnused systemd ])
}";
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
};
}