2025-03-08 14:36:33 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
2025-07-20 01:23:48 +02:00
|
|
|
}:
|
|
|
|
let
|
2025-03-08 14:36:33 +01:00
|
|
|
inherit (lib.meta) getExe';
|
|
|
|
inherit (lib.modules) mkIf;
|
2025-04-09 15:31:18 +02:00
|
|
|
|
2025-04-09 15:31:18 +02:00
|
|
|
cfg = config.modules.system.services.owncloud;
|
2025-07-20 01:23:48 +02:00
|
|
|
in
|
|
|
|
{
|
2025-04-09 15:31:18 +02:00
|
|
|
options.modules.system.services.owncloud.enable = lib.mkEnableOption "owncloud";
|
2025-03-08 14:36:33 +01:00
|
|
|
|
|
|
|
config = {
|
2025-04-09 15:31:18 +02:00
|
|
|
systemd.user.services.owncloud = mkIf cfg.enable {
|
|
|
|
description = "Owncloud client service";
|
2025-03-08 14:36:33 +01:00
|
|
|
|
|
|
|
# makes the graphical session start this service when it starts
|
2025-07-20 01:23:48 +02:00
|
|
|
wantedBy = [ "graphical-session.target" ];
|
2025-03-08 14:36:33 +01:00
|
|
|
# when graphical session restarts or gets stopped, this also gets restarted/stopped.
|
2025-07-20 01:23:48 +02:00
|
|
|
partOf = [ "graphical-session.target" ];
|
2025-03-08 14:36:33 +01:00
|
|
|
# gets started only after graphical session
|
2025-07-20 01:23:48 +02:00
|
|
|
after = [ "graphical-session.target" ];
|
2025-03-08 14:36:33 +01:00
|
|
|
|
|
|
|
serviceConfig = {
|
2025-04-09 15:31:18 +02:00
|
|
|
ExecStart = "${getExe' pkgs.owncloud-client "owncloud"}";
|
2025-03-08 14:36:33 +01:00
|
|
|
Restart = "always";
|
|
|
|
RestartSec = 30;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|