mirror of
https://github.com/nix-community/home-manager
synced 2024-12-28 20:59:47 +01:00
megasync: add module
This commit is contained in:
parent
e412025fff
commit
0e9e86b179
4 changed files with 51 additions and 0 deletions
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -427,6 +427,8 @@ Makefile @thiagokokada
|
|||
|
||||
/modules/services/mbsync.nix @pjones
|
||||
|
||||
/modules/services/megasync.nix @GaetanLepage
|
||||
|
||||
/modules/services/mopidy.nix @foo-dogsquared
|
||||
/tests/modules/services/mopidy @foo-dogsquared
|
||||
|
||||
|
|
|
@ -853,6 +853,14 @@ in
|
|||
'Host' blocks
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2022-12-16T15:01:20+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.megasync'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -238,6 +238,7 @@ let
|
|||
./services/lorri.nix
|
||||
./services/mako.nix
|
||||
./services/mbsync.nix
|
||||
./services/megasync.nix
|
||||
./services/mopidy.nix
|
||||
./services/mpd.nix
|
||||
./services/mpdris2.nix
|
||||
|
|
40
modules/services/megasync.nix
Normal file
40
modules/services/megasync.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ 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-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||
|
||||
Service = { ExecStart = "${cfg.package}/bin/megasync"; };
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue