kdeconnect: add package option

This commit is contained in:
Nathaniel Barragan 2024-04-04 21:08:04 +00:00 committed by GitHub
parent 7e91f2a0ba
commit 9de3aab091
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,6 @@ with lib;
let
cfg = config.services.kdeconnect;
package = pkgs.plasma5Packages.kdeconnect-kde;
in {
meta.maintainers = [ maintainers.adisbladis ];
@ -13,6 +12,12 @@ in {
options = {
services.kdeconnect = {
enable = mkEnableOption "KDE connect";
package = mkOption {
type = types.package;
default = pkgs.plasma5Packages.kdeconnect-kde;
example = literalExpression "pkgs.kdePackages.kdeconnect-kde";
description = "The KDE connect package to use";
};
indicator = mkOption {
type = types.bool;
@ -25,7 +30,7 @@ in {
config = mkMerge [
(mkIf cfg.enable {
home.packages = [ package ];
home.packages = [ cfg.package ];
assertions = [
(hm.assertions.assertPlatform "services.kdeconnect" pkgs
@ -44,7 +49,7 @@ in {
Service = {
Environment = "PATH=${config.home.profileDirectory}/bin";
ExecStart = "${package}/libexec/kdeconnectd";
ExecStart = "${cfg.package}/libexec/kdeconnectd";
Restart = "on-abort";
};
};
@ -72,7 +77,7 @@ in {
Service = {
Environment = "PATH=${config.home.profileDirectory}/bin";
ExecStart = "${package}/bin/kdeconnect-indicator";
ExecStart = "${cfg.package}/bin/kdeconnect-indicator";
Restart = "on-abort";
};
};