1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 11:39:46 +01:00

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 let
cfg = config.services.kdeconnect; cfg = config.services.kdeconnect;
package = pkgs.plasma5Packages.kdeconnect-kde;
in { in {
meta.maintainers = [ maintainers.adisbladis ]; meta.maintainers = [ maintainers.adisbladis ];
@ -13,6 +12,12 @@ in {
options = { options = {
services.kdeconnect = { services.kdeconnect = {
enable = mkEnableOption "KDE connect"; 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 { indicator = mkOption {
type = types.bool; type = types.bool;
@ -25,7 +30,7 @@ in {
config = mkMerge [ config = mkMerge [
(mkIf cfg.enable { (mkIf cfg.enable {
home.packages = [ package ]; home.packages = [ cfg.package ];
assertions = [ assertions = [
(hm.assertions.assertPlatform "services.kdeconnect" pkgs (hm.assertions.assertPlatform "services.kdeconnect" pkgs
@ -44,7 +49,7 @@ in {
Service = { Service = {
Environment = "PATH=${config.home.profileDirectory}/bin"; Environment = "PATH=${config.home.profileDirectory}/bin";
ExecStart = "${package}/libexec/kdeconnectd"; ExecStart = "${cfg.package}/libexec/kdeconnectd";
Restart = "on-abort"; Restart = "on-abort";
}; };
}; };
@ -72,7 +77,7 @@ in {
Service = { Service = {
Environment = "PATH=${config.home.profileDirectory}/bin"; Environment = "PATH=${config.home.profileDirectory}/bin";
ExecStart = "${package}/bin/kdeconnect-indicator"; ExecStart = "${cfg.package}/bin/kdeconnect-indicator";
Restart = "on-abort"; Restart = "on-abort";
}; };
}; };