Set user services using a direct assignment

This commit is contained in:
Manuel Thalmann 2024-05-14 12:47:20 +02:00
parent 66d6880750
commit 7fdac59f45

View file

@ -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);
};
}; };
}; };