nichts/modules/services/owncloud.mod.nix

35 lines
875 B
Nix
Raw Permalink Normal View History

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