fork/home-manager
git clone https://git.julia.blue/fork/home-manager
831b4fa3
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . services . clipmenu ; 8 9in { 10meta . maintainers = [ maintainers . DamienCassou ]; 11 12options . services . clipmenu = { 13enable = mkEnableOption "clipmenu, the clipboard management daemon" ; 14 15package = mkOption { 16type = types . package ; 17default = pkgs . clipmenu ; 18defaultText = "pkgs.clipmenu" ; 19description = "clipmenu derivation to use." ; 20}; 21 22launcher = mkOption { 23type = types . nullOr types . str ; 24default = null ; 25example = "rofi" ; 26description = '' 27Launcher command, if not set, {command}`dmenu` 28will be used by default. 29'' ; 30}; 31}; 32 33config = mkIf cfg . enable { 34assertions = [ 35( lib . hm . assertions . assertPlatform "services.clipmenu" pkgs 36lib . platforms . linux ) 37]; 38 39home . packages = [ cfg . package ]; 40 41home . sessionVariables = 42mkIf ( cfg . launcher != null ) { CM_LAUNCHER = cfg . launcher ; }; 43 44systemd . user . services . clipmenu = { 45Unit = { 46Description = "Clipboard management daemon" ; 47After = [ "graphical-session.target" ]; 48}; 49 50Service = { 51ExecStart = " ${ cfg . package } /bin/clipmenud" ; 52Environment = [ 53"PATH= ${ 54makeBinPath 55( with pkgs ; [ coreutils findutils gnugrep gnused systemd ]) 56} " 57]; 58}; 59 60Install = { WantedBy = [ "graphical-session.target" ]; }; 61}; 62}; 63}