From ffdbefe22c4bc9ab35859e2ebc972f0654a73e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Fri, 23 Nov 2018 10:43:13 +0100 Subject: [PATCH] nextcloud-client: add module Adds the nextcloud-client as a service, simply copying the syntax from owncloud.client. --- modules/misc/news.nix | 7 +++++++ modules/modules.nix | 1 + modules/services/nextcloud-client.nix | 30 +++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 modules/services/nextcloud-client.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 89ec3b41e..a6f1efd9b 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -864,6 +864,13 @@ in to your Home Manager configuration. ''; } + + { + time = "2018-11-25T22:10:15+00:00"; + message = '' + A new module is available: 'services.nextcloud-client'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index b73bc8ead..7a8dd4533 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -82,6 +82,7 @@ let ./services/mbsync.nix ./services/mpd.nix ./services/network-manager-applet.nix + ./services/nextcloud-client.nix ./services/owncloud-client.nix ./services/parcellite.nix ./services/pasystray.nix diff --git a/modules/services/nextcloud-client.nix b/modules/services/nextcloud-client.nix new file mode 100644 index 000000000..3d8dc0bc8 --- /dev/null +++ b/modules/services/nextcloud-client.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + options = { + services.nextcloud-client = { + enable = mkEnableOption "Nextcloud Client"; + }; + }; + + config = mkIf config.services.nextcloud-client.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 = "${pkgs.nextcloud-client}/bin/nextcloud"; + }; + + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + }; + }; +}