mirror of
https://github.com/nix-community/home-manager
synced 2025-02-02 14:25:04 +01:00
6a9f87b3aa
As per systemd.special(7)[0] graphical-session-pre.target is strictly for units that set up things for a graphical session. Most notably, these are usually started *before* the compositor/session is actually ready. While Home Manager's current implementation of graphical-session.target allows these units to work regardless of what systemd.special(7) specifies, other setups like ones with uwsm[1] do not allow these units to start properly. [0]: https://www.freedesktop.org/software/systemd/man/latest/systemd.special.html#graphical-session-pre.target [1]: https://github.com/Vladimir-csp/uwsm Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
39 lines
847 B
Nix
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.target" ];
|
|
PartOf = [ "graphical-session.target" ];
|
|
};
|
|
|
|
Service = {
|
|
Environment = [ "PATH=${config.home.profileDirectory}/bin" ];
|
|
ExecStart = "${cfg.package}/bin/owncloud";
|
|
};
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
};
|
|
};
|
|
}
|