nextcloud-client: add package option

This commit is contained in:
Tino Breddin 2021-01-15 11:57:58 +01:00 committed by Robert Helgesson
parent 2c0e3f61da
commit 4e86d65aee
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -2,12 +2,25 @@
with lib; with lib;
{ let
cfg = config.services.nextcloud-client;
in {
options = { options = {
services.nextcloud-client = { enable = mkEnableOption "Nextcloud Client"; }; services.nextcloud-client = {
enable = mkEnableOption "Nextcloud Client";
package = mkOption {
type = types.package;
default = pkgs.nextcloud-client;
defaultText = literalExample "pkgs.nextcloud-client";
description = "The package to use for the nextcloud client binary.";
};
};
}; };
config = mkIf config.services.nextcloud-client.enable { config = mkIf cfg.enable {
systemd.user.services.nextcloud-client = { systemd.user.services.nextcloud-client = {
Unit = { Unit = {
Description = "Nextcloud Client"; Description = "Nextcloud Client";
@ -17,7 +30,7 @@ with lib;
Service = { Service = {
Environment = "PATH=${config.home.profileDirectory}/bin"; Environment = "PATH=${config.home.profileDirectory}/bin";
ExecStart = "${pkgs.nextcloud-client}/bin/nextcloud"; ExecStart = "${cfg.package}/bin/nextcloud";
}; };
Install = { WantedBy = [ "graphical-session.target" ]; }; Install = { WantedBy = [ "graphical-session.target" ]; };