kdeconnect: add module

This commit is contained in:
adisbladis 2018-06-04 21:59:38 +08:00 committed by Nikita Uvarov
parent ed0cd78e05
commit 53f10f4d46
No known key found for this signature in database
GPG key ID: F7A5FB3A7C10EF96
3 changed files with 84 additions and 0 deletions

View file

@ -657,6 +657,14 @@ in
GTK+ theme, and not much else. GTK+ theme, and not much else.
''; '';
} }
{
time = "2018-06-05T01:36:45+00:00";
message = ''
A new module is available: 'services.kdeconnect'.
'';
}
]; ];
}; };
} }

View file

@ -56,6 +56,7 @@ let
./services/gnome-keyring.nix ./services/gnome-keyring.nix
./services/gpg-agent.nix ./services/gpg-agent.nix
./services/kbfs.nix ./services/kbfs.nix
./services/kdeconnect.nix
./services/keepassx.nix ./services/keepassx.nix
./services/keybase.nix ./services/keybase.nix
./services/mbsync.nix ./services/mbsync.nix

View file

@ -0,0 +1,75 @@
{ 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 = {
Environment = "PATH=%h/.nix-profile/bin";
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 = {
Environment = "PATH=%h/.nix-profile/bin";
ExecStart = "${package}/bin/kdeconnect-indicator";
Restart = "on-abort";
};
};
})
];
}