fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3let 4 5cfg = config . services . copyq ; 6 7in { 8meta . maintainers = [ lib . maintainers . DamienCassou ]; 9 10options . services . copyq = { 11enable = 12lib . mkEnableOption "CopyQ, a clipboard manager with advanced features" ; 13 14package = lib . mkPackageOption pkgs "copyq" { }; 15 16systemdTarget = lib . mkOption { 17type = lib . types . str ; 18default = "graphical-session.target" ; 19example = "sway-session.target" ; 20description = '' 21The systemd target that will automatically start the CopyQ service. 22 23When setting this value to `"sway-session.target"`, 24make sure to also enable {option}`wayland.windowManager.sway.systemd.enable`, 25otherwise the service may never be started. 26'' ; 27}; 28}; 29 30config = lib . mkIf cfg . enable { 31assertions = [ 32( lib . hm . assertions . assertPlatform "services.copyq" pkgs 33lib . platforms . linux ) 34]; 35 36home . packages = [ cfg . package ]; 37 38systemd . user . services . copyq = { 39Unit = { 40Description = "CopyQ clipboard management daemon" ; 41PartOf = [ "graphical-session.target" ]; 42After = [ "graphical-session.target" ]; 43}; 44 45Service = { 46ExecStart = " ${ cfg . package } /bin/copyq" ; 47Restart = "on-failure" ; 48Environment = [ "QT_QPA_PLATFORM=xcb" ]; 49}; 50 51Install = { WantedBy = [ cfg . systemdTarget ]; }; 52}; 53}; 54}