aboutsummaryrefslogtreecommitdiff
path: root/home-manager/modules/services/nextcloud-client.nix
blob: 3d8dc0bc80bb4fafe80a096cbb45a67c34cf3a83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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" ];
      };
    };
  };
}