1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00
home-manager/modules/services/kdeconnect.nix

76 lines
1.7 KiB
Nix
Raw Normal View History

2018-06-04 13:59:38 +00:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.kdeconnect;
package = pkgs.kdeconnect;
in
{
meta.maintainers = [ maintainers.adisbladis ];
options = {
services.kdeconnect = {
enable = mkEnableOption "KDE connect";
indicator = mkOption {
type = types.bool;
default = false;
description = "Whether to enable kdeconnect-indicator service.";
};
};
};
config = mkMerge [
(mkIf cfg.enable {
home.packages = [ package ];
systemd.user.services.kdeconnect = {
Unit = {
Description = "Adds communication between your desktop and your smartphone";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
2018-07-29 16:15:50 +00:00
Environment = "PATH=${config.home.profileDirectory}/bin";
2018-06-04 13:59:38 +00:00
ExecStart = "${package}/lib/libexec/kdeconnectd";
Restart = "on-abort";
};
};
})
(mkIf cfg.indicator {
systemd.user.services.kdeconnect-indicator = {
Unit = {
Description = "kdeconnect-indicator";
After = [ "graphical-session-pre.target"
"polybar.service"
"taffybar.service"
"stalonetray.service" ];
PartOf = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
2018-07-29 16:15:50 +00:00
Environment = "PATH=${config.home.profileDirectory}/bin";
2018-06-04 13:59:38 +00:00
ExecStart = "${package}/bin/kdeconnect-indicator";
Restart = "on-abort";
};
};
})
];
}