depot/third_party/home-manager/modules/services/owncloud-client.nix
Default email 75fa0ae5af Project import generated by Copybara.
GitOrigin-RevId: c3ab5ea047e6dc73df530948f7367455749d8906
2023-08-08 12:19:01 +02:00

39 lines
847 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.owncloud-client;
in {
options = {
services.owncloud-client = {
enable = mkEnableOption "Owncloud Client";
package = mkPackageOption pkgs "owncloud-client" { };
};
};
config = mkIf cfg.enable {
assertions = [
(hm.assertions.assertPlatform "services.owncloud-client" pkgs
platforms.linux)
];
systemd.user.services.owncloud-client = {
Unit = {
Description = "Owncloud Client";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Environment = "PATH=${config.home.profileDirectory}/bin";
ExecStart = "${cfg.package}/bin/owncloud";
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
};
}