fork/home-manager
git clone https://git.julia.blue/fork/home-manager
17dc5939
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . services . kdeconnect ; 8package = pkgs . plasma5Packages . kdeconnect-kde ; 9 10in { 11meta . maintainers = [ maintainers . adisbladis ]; 12 13options = { 14services . kdeconnect = { 15enable = mkEnableOption "KDE connect" ; 16 17indicator = mkOption { 18type = types . bool ; 19default = false ; 20description = "Whether to enable kdeconnect-indicator service." ; 21}; 22 23}; 24}; 25 26config = mkMerge [ 27( mkIf cfg . enable { 28home . packages = [ package ]; 29 30assertions = [ 31( hm . assertions . assertPlatform "services.kdeconnect" pkgs 32platforms . linux ) 33]; 34 35systemd . user . services . kdeconnect = { 36Unit = { 37Description = 38"Adds communication between your desktop and your smartphone" ; 39After = [ "graphical-session-pre.target" ]; 40PartOf = [ "graphical-session.target" ]; 41}; 42 43Install = { WantedBy = [ "graphical-session.target" ]; }; 44 45Service = { 46Environment = "PATH= ${ config . home . profileDirectory } /bin" ; 47ExecStart = " ${ package } /libexec/kdeconnectd" ; 48Restart = "on-abort" ; 49}; 50}; 51}) 52 53( mkIf cfg . indicator { 54assertions = [ 55( hm . assertions . assertPlatform "services.kdeconnect" pkgs 56platforms . linux ) 57]; 58 59systemd . user . services . kdeconnect-indicator = { 60Unit = { 61Description = "kdeconnect-indicator" ; 62After = [ 63"graphical-session-pre.target" 64"polybar.service" 65"taffybar.service" 66"stalonetray.service" 67]; 68PartOf = [ "graphical-session.target" ]; 69}; 70 71Install = { WantedBy = [ "graphical-session.target" ]; }; 72 73Service = { 74Environment = "PATH= ${ config . home . profileDirectory } /bin" ; 75ExecStart = " ${ package } /bin/kdeconnect-indicator" ; 76Restart = "on-abort" ; 77}; 78}; 79}) 80 81]; 82}