2017-08-26 16:00:55 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2022-10-09 10:59:43 +02:00
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.owncloud-client;
|
|
|
|
|
|
|
|
in {
|
2017-08-26 16:00:55 +02:00
|
|
|
options = {
|
2022-10-09 10:59:43 +02:00
|
|
|
services.owncloud-client = {
|
2023-07-02 01:45:18 +02:00
|
|
|
enable = mkEnableOption "Owncloud Client";
|
2022-10-09 10:59:43 +02:00
|
|
|
|
2023-07-02 01:45:18 +02:00
|
|
|
package = mkPackageOption pkgs "owncloud-client" { };
|
2022-10-09 10:59:43 +02:00
|
|
|
};
|
2017-08-26 16:00:55 +02:00
|
|
|
};
|
|
|
|
|
2022-10-09 10:59:43 +02:00
|
|
|
config = mkIf cfg.enable {
|
2022-04-24 16:25:54 +02:00
|
|
|
assertions = [
|
|
|
|
(hm.assertions.assertPlatform "services.owncloud-client" pkgs
|
|
|
|
platforms.linux)
|
|
|
|
];
|
|
|
|
|
2017-08-26 16:00:55 +02:00
|
|
|
systemd.user.services.owncloud-client = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Owncloud Client";
|
|
|
|
After = [ "graphical-session-pre.target" ];
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
2018-07-29 18:15:50 +02:00
|
|
|
Environment = "PATH=${config.home.profileDirectory}/bin";
|
2022-10-09 10:59:43 +02:00
|
|
|
ExecStart = "${cfg.package}/bin/owncloud";
|
2017-08-26 16:00:55 +02:00
|
|
|
};
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
2017-08-26 16:00:55 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|