fork/home-manager
git clone https://git.julia.blue/fork/home-manager
8745cc9a
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . services . parcellite ; 8 9in { 10meta . maintainers = [ maintainers . gleber ]; 11 12options . services . parcellite = { 13enable = mkEnableOption "Parcellite" ; 14 15extraOptions = mkOption { 16type = types . listOf types . str ; 17default = [ ]; 18example = [ "--no-icon" ]; 19description = '' 20Command line arguments passed to Parcellite. 21'' ; 22}; 23 24package = mkOption { 25type = types . package ; 26default = pkgs . parcellite ; 27defaultText = literalExpression "pkgs.parcellite" ; 28example = literalExpression "pkgs.clipit" ; 29description = "Parcellite derivation to use." ; 30}; 31}; 32 33config = mkIf cfg . enable { 34assertions = [ 35( lib . hm . assertions . assertPlatform "services.parcellite" pkgs 36lib . platforms . linux ) 37]; 38 39home . packages = [ cfg . package ]; 40 41systemd . user . services . parcellite = { 42Unit = { 43Description = "Lightweight GTK+ clipboard manager" ; 44Requires = [ "tray.target" ]; 45After = [ "graphical-session-pre.target" "tray.target" ]; 46PartOf = [ "graphical-session.target" ]; 47}; 48 49Install = { WantedBy = [ "graphical-session.target" ]; }; 50 51Service = { 52ExecStart = " ${ cfg . package } /bin/ ${ cfg . package . pname } ${ 53escapeShellArgs cfg . extraOptions 54} " ; 55Restart = "on-abort" ; 56}; 57}; 58}; 59}