1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

chore: format

This commit is contained in:
2022-03-13 10:31:19 +01:00
parent 730070bc9d
commit a4d002e293
11 changed files with 153 additions and 150 deletions

View File

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

View File

@@ -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 = ''

View File

@@ -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 {