Use alejandra formatter / fix warnings
This commit is contained in:
parent
c5b1041bbb
commit
693d4e3c70
70 changed files with 1424 additions and 1547 deletions
|
|
@ -4,53 +4,56 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
username = config.mods.nextcloud.username;
|
||||
password =
|
||||
if (config.sops.secrets ? nextcloud.path) then config.sops.secrets.nextcloud.path else "";
|
||||
if (config.sops.secrets ? nextcloud.path)
|
||||
then config.sops.secrets.nextcloud.path
|
||||
else "";
|
||||
url = config.mods.nextcloud.url;
|
||||
synclist = config.mods.nextcloud.synclist;
|
||||
in
|
||||
lib.mkIf config.mods.nextcloud.enable {
|
||||
systemd.user = {
|
||||
services = (
|
||||
builtins.listToAttrs (
|
||||
map (opts: {
|
||||
name = "${opts.name}";
|
||||
value = {
|
||||
Unit = {
|
||||
Description = "Auto sync Nextcloud";
|
||||
After = "network-online.target";
|
||||
lib.mkIf config.mods.nextcloud.enable {
|
||||
systemd.user = {
|
||||
services = (
|
||||
builtins.listToAttrs (
|
||||
map (opts: {
|
||||
name = "${opts.name}";
|
||||
value = {
|
||||
Unit = {
|
||||
Description = "Auto sync Nextcloud";
|
||||
After = "network-online.target";
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.nextcloud-client}/bin/nextcloudcmd -h --path ${opts.remote} ${opts.local} https://${username}:$(bat ${password})@${url}'";
|
||||
TimeoutStopSec = "180";
|
||||
KillMode = "process";
|
||||
KillSignal = "SIGINT";
|
||||
};
|
||||
Install.WantedBy = ["multi-user.target"];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.nextcloud-client}/bin/nextcloudcmd -h --path ${opts.remote} ${opts.local} https://${username}:$(bat ${password})@${url}'";
|
||||
TimeoutStopSec = "180";
|
||||
KillMode = "process";
|
||||
KillSignal = "SIGINT";
|
||||
})
|
||||
synclist
|
||||
)
|
||||
);
|
||||
timers = (
|
||||
builtins.listToAttrs (
|
||||
map (opts: {
|
||||
name = "${opts.name}";
|
||||
value = {
|
||||
Unit.Description = "Automatic sync files with Nextcloud when booted up after 1 minute then rerun every 60 minutes";
|
||||
Timer.OnBootSec = "1min";
|
||||
Timer.OnUnitActiveSec = "60min";
|
||||
Install.WantedBy = [
|
||||
"multi-user.target"
|
||||
"timers.target"
|
||||
];
|
||||
};
|
||||
Install.WantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
}) synclist
|
||||
)
|
||||
);
|
||||
timers = (
|
||||
builtins.listToAttrs (
|
||||
map (opts: {
|
||||
name = "${opts.name}";
|
||||
value = {
|
||||
Unit.Description = "Automatic sync files with Nextcloud when booted up after 1 minute then rerun every 60 minutes";
|
||||
Timer.OnBootSec = "1min";
|
||||
Timer.OnUnitActiveSec = "60min";
|
||||
Install.WantedBy = [
|
||||
"multi-user.target"
|
||||
"timers.target"
|
||||
];
|
||||
};
|
||||
}) synclist
|
||||
)
|
||||
);
|
||||
startServices = true;
|
||||
};
|
||||
}
|
||||
})
|
||||
synclist
|
||||
)
|
||||
);
|
||||
startServices = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue