1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-30 19:54:34 +00:00
home-manager/modules/services/megasync.nix

35 lines
819 B
Nix
Raw Normal View History

2022-12-06 17:21:08 +01:00
{ config, lib, pkgs, ... }:
2025-03-14 13:17:43 +08:00
let cfg = config.services.megasync;
2022-12-06 17:21:08 +01:00
in {
2025-03-14 13:17:43 +08:00
meta.maintainers = [ lib.maintainers.GaetanLepage ];
2022-12-06 17:21:08 +01:00
options = {
services.megasync = {
2025-03-14 13:17:43 +08:00
enable = lib.mkEnableOption "Megasync client";
2022-12-06 17:21:08 +01:00
2025-03-14 13:17:43 +08:00
package = lib.mkPackageOption pkgs "megasync" { };
2022-12-06 17:21:08 +01:00
};
};
2025-03-14 13:17:43 +08:00
config = lib.mkIf cfg.enable {
2022-12-06 17:21:08 +01:00
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" ];
2022-12-06 17:21:08 +01:00
PartOf = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = { ExecStart = "${cfg.package}/bin/megasync"; };
};
};
}