mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 12:03:25 +00:00
ddf35436b7
* nextcloud-client: add runInBackground option * nextcloud-client: Change runInBackground description Co-authored-by: Sumner Evans <me@sumnerevans.com> * nextcloud-client: Use optionalString for the runInBackground option Co-authored-by: Sumner Evans <me@sumnerevans.com> * nextcloud-client: Remove "defaultText" in the runInBackground option * nextcloud-client: Fixed formatting * nextcloud-client: Rename runInBackground to startInBackground Co-authored-by: Sumner Evans <me@sumnerevans.com>
47 lines
1.1 KiB
Nix
47 lines
1.1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.nextcloud-client;
|
|
|
|
in {
|
|
options = {
|
|
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.";
|
|
};
|
|
|
|
startInBackground = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description =
|
|
"Whether to start the Nextcloud client in the background.";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
systemd.user.services.nextcloud-client = {
|
|
Unit = {
|
|
Description = "Nextcloud Client";
|
|
After = [ "graphical-session-pre.target" ];
|
|
PartOf = [ "graphical-session.target" ];
|
|
};
|
|
|
|
Service = {
|
|
Environment = "PATH=${config.home.profileDirectory}/bin";
|
|
ExecStart = "${cfg.package}/bin/nextcloud"
|
|
+ (optionalString cfg.startInBackground " --background");
|
|
};
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
};
|
|
};
|
|
}
|