mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
509dbf8d45
Change `After=` setting in the user service to only launch after the full `graphical-session.target`.
40 lines
819 B
Nix
40 lines
819 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.megasync;
|
|
|
|
in {
|
|
meta.maintainers = [ maintainers.GaetanLepage ];
|
|
|
|
options = {
|
|
services.megasync = {
|
|
enable = mkEnableOption "Megasync client";
|
|
|
|
package = mkPackageOption pkgs "megasync" { };
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
assertions = [
|
|
(lib.hm.assertions.assertPlatform "services.megasync" pkgs
|
|
lib.platforms.linux)
|
|
];
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
systemd.user.services.megasync = {
|
|
Unit = {
|
|
Description = "megasync";
|
|
After = [ "graphical-session.target" ];
|
|
PartOf = [ "graphical-session.target" ];
|
|
};
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
|
|
Service = { ExecStart = "${cfg.package}/bin/megasync"; };
|
|
};
|
|
};
|
|
}
|