mirror of
https://github.com/nix-community/home-manager
synced 2024-12-25 03:09:47 +01:00
480d589cdd
See #5854
39 lines
851 B
Nix
39 lines
851 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" ]; };
|
|
};
|
|
};
|
|
}
|