2018-06-04 15:59:38 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.kdeconnect;
|
2022-09-28 21:07:39 +02:00
|
|
|
package = pkgs.plasma5Packages.kdeconnect-kde;
|
2018-06-04 15:59:38 +02:00
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
in {
|
2018-06-04 15:59:38 +02:00
|
|
|
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 ];
|
|
|
|
|
2022-04-24 16:25:54 +02:00
|
|
|
assertions = [
|
|
|
|
(hm.assertions.assertPlatform "services.kdeconnect" pkgs
|
|
|
|
platforms.linux)
|
|
|
|
];
|
|
|
|
|
2018-06-04 15:59:38 +02:00
|
|
|
systemd.user.services.kdeconnect = {
|
|
|
|
Unit = {
|
2020-02-02 00:39:17 +01:00
|
|
|
Description =
|
|
|
|
"Adds communication between your desktop and your smartphone";
|
2018-06-04 15:59:38 +02:00
|
|
|
After = [ "graphical-session-pre.target" ];
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
2018-06-04 15:59:38 +02:00
|
|
|
|
|
|
|
Service = {
|
2018-07-29 18:15:50 +02:00
|
|
|
Environment = "PATH=${config.home.profileDirectory}/bin";
|
2019-08-18 22:02:17 +02:00
|
|
|
ExecStart = "${package}/libexec/kdeconnectd";
|
2018-06-04 15:59:38 +02:00
|
|
|
Restart = "on-abort";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
|
|
|
|
|
|
|
(mkIf cfg.indicator {
|
2022-04-24 16:25:54 +02:00
|
|
|
assertions = [
|
|
|
|
(hm.assertions.assertPlatform "services.kdeconnect" pkgs
|
|
|
|
platforms.linux)
|
|
|
|
];
|
|
|
|
|
2018-06-04 15:59:38 +02:00
|
|
|
systemd.user.services.kdeconnect-indicator = {
|
|
|
|
Unit = {
|
|
|
|
Description = "kdeconnect-indicator";
|
2020-02-02 00:39:17 +01:00
|
|
|
After = [
|
|
|
|
"graphical-session-pre.target"
|
|
|
|
"polybar.service"
|
|
|
|
"taffybar.service"
|
|
|
|
"stalonetray.service"
|
|
|
|
];
|
2018-06-04 15:59:38 +02:00
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
2018-06-04 15:59:38 +02:00
|
|
|
|
|
|
|
Service = {
|
2018-07-29 18:15:50 +02:00
|
|
|
Environment = "PATH=${config.home.profileDirectory}/bin";
|
2018-06-04 15:59:38 +02:00
|
|
|
ExecStart = "${package}/bin/kdeconnect-indicator";
|
|
|
|
Restart = "on-abort";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
|
|
|
|
|
|
|
];
|
|
|
|
}
|