Set user services using a direct assignment
This commit is contained in:
parent
66d6880750
commit
7fdac59f45
1 changed files with 23 additions and 21 deletions
|
@ -14,30 +14,32 @@
|
||||||
systemd.user = lib.optionalAttrs cfg.enable {
|
systemd.user = lib.optionalAttrs cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
services.rclone = {
|
services = {
|
||||||
Unit = {
|
rclone = {
|
||||||
Description = "rclone Starter";
|
Unit = {
|
||||||
Documentation = "man:rclone(1)";
|
Description = "rclone Starter";
|
||||||
};
|
Documentation = "man:rclone(1)";
|
||||||
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
|
|
||||||
ExecStartPre =
|
ExecStartPre =
|
||||||
let
|
let
|
||||||
script = pkgs.writeShellScriptBin "rclone-pre" ''
|
script = pkgs.writeShellScriptBin "rclone-pre" ''
|
||||||
sleep 10
|
sleep 10
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
(lib.getExe script);
|
(lib.getExe script);
|
||||||
|
|
||||||
ExecStart =
|
ExecStart =
|
||||||
let
|
let
|
||||||
script = pkgs.writeShellScriptBin "rclone" ''
|
script = pkgs.writeShellScriptBin "rclone" ''
|
||||||
systemctl --user start rclone.target
|
systemctl --user start rclone.target
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
(lib.getExe script);
|
(lib.getExe script);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue