mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
chore: format
This commit is contained in:
@@ -15,14 +15,14 @@ with lib; let
|
||||
mode = "0400"; # readonly (user)
|
||||
text =
|
||||
(foldlAttrs (accum: {
|
||||
name,
|
||||
value,
|
||||
}: ''
|
||||
${accum}
|
||||
name,
|
||||
value,
|
||||
}: ''
|
||||
${accum}
|
||||
|
||||
[${name}] ${mkProfileEntry value}'')
|
||||
"# Generated by nixos-networkmanager-profiles"
|
||||
profileAttrs)
|
||||
[${name}] ${mkProfileEntry value}'')
|
||||
"# Generated by nixos-networkmanager-profiles"
|
||||
profileAttrs)
|
||||
+ "\n";
|
||||
};
|
||||
|
||||
|
||||
@@ -33,9 +33,10 @@ in {
|
||||
config = {
|
||||
services.tinc.networks.${netname} = {
|
||||
name = cfg.nodename;
|
||||
hosts = builtins.mapAttrs
|
||||
(name: _: builtins.readFile "${<retiolum/hosts>}/${name}")
|
||||
(builtins.readDir <retiolum/hosts>);
|
||||
hosts =
|
||||
builtins.mapAttrs
|
||||
(name: _: builtins.readFile "${<retiolum/hosts>}/${name}")
|
||||
(builtins.readDir <retiolum/hosts>);
|
||||
rsaPrivateKeyFile = toString <system-secrets/retiolum.key>;
|
||||
ed25519PrivateKeyFile = toString <system-secrets/retiolum.ed25519>;
|
||||
extraConfig = ''
|
||||
|
||||
@@ -14,16 +14,16 @@ with lib; let
|
||||
serviceConfig.Type = "oneshot";
|
||||
wants = ["network-online.target"];
|
||||
script = strings.concatStringsSep "\n" (["QUOTE=$(${bot.command})" "if [ -n \"$QUOTE\" ]; then"]
|
||||
++ map (chatId: ''
|
||||
${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
|
||||
-d chat_id="${chatId}" \
|
||||
-d text="$QUOTE" ${
|
||||
lib.strings.optionalString (bot.parseMode != null)
|
||||
"-d parse_mode=${bot.parseMode}"
|
||||
}
|
||||
'')
|
||||
bot.chatIds
|
||||
++ ["fi"]);
|
||||
++ map (chatId: ''
|
||||
${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
|
||||
-d chat_id="${chatId}" \
|
||||
-d text="$QUOTE" ${
|
||||
lib.strings.optionalString (bot.parseMode != null)
|
||||
"-d parse_mode=${bot.parseMode}"
|
||||
}
|
||||
'')
|
||||
bot.chatIds
|
||||
++ ["fi"]);
|
||||
};
|
||||
in {
|
||||
options.niveum.telegramBots = mkOption {
|
||||
|
||||
Reference in New Issue
Block a user