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