From 904e298f337ffa700262dc3fe6cb2477dfbc2760 Mon Sep 17 00:00:00 2001 From: teidesu Date: Wed, 7 Aug 2024 19:40:47 +0300 Subject: [PATCH] feat: channel-logger-bot initial --- hosts/koi/configuration.nix | 1 + .../containers/bots/channel-logger-bot.nix | 37 ++++++++++++++++++ secrets/channel-logger-bot-env.age | Bin 0 -> 635 bytes 3 files changed, 38 insertions(+) create mode 100644 hosts/koi/containers/bots/channel-logger-bot.nix create mode 100644 secrets/channel-logger-bot-env.age diff --git a/hosts/koi/configuration.nix b/hosts/koi/configuration.nix index 3106000..5c3441a 100755 --- a/hosts/koi/configuration.nix +++ b/hosts/koi/configuration.nix @@ -30,6 +30,7 @@ ./containers/zond ./containers/teisu.nix ./containers/bots/pcre-sub-bot.nix + ./containers/bots/channel-logger-bot.nix ./vms/hass.nix ./vms/bnuuy.nix # ./vms/windows.nix diff --git a/hosts/koi/containers/bots/channel-logger-bot.nix b/hosts/koi/containers/bots/channel-logger-bot.nix new file mode 100644 index 0000000..149ebf0 --- /dev/null +++ b/hosts/koi/containers/bots/channel-logger-bot.nix @@ -0,0 +1,37 @@ +{ abs, config, ... }: + +let + secrets = import (abs "lib/secrets.nix"); + + UID = 1105; +in { + imports = [ + (secrets.declare [{ + name = "channel-logger-bot-env"; + owner = "channel-logger-bot"; + }]) + ]; + + users.groups.channel-logger-bot = {}; + users.users.channel-logger-bot = { + group = "channel-logger-bot"; + isNormalUser = true; + uid = UID; + }; + + virtualisation.oci-containers.containers.channel-logger-bot = { + image = "ghcr.io/teidesu/channel-logger-bot:latest"; + volumes = [ + "/srv/channel-logger-bot:/app/bot-data" + ]; + environmentFiles = [ + (secrets.file config "channel-logger-bot-env") + ]; + environment.MTCUTE_LOG_LEVEL = "5"; + user = builtins.toString UID; + }; + + systemd.tmpfiles.rules = [ + "d /srv/channel-logger-bot 0755 ${builtins.toString UID} ${builtins.toString UID} -" + ]; +} \ No newline at end of file diff --git a/secrets/channel-logger-bot-env.age b/secrets/channel-logger-bot-env.age new file mode 100644 index 0000000000000000000000000000000000000000..7559a2c13ded944a2e4257c7d7d8f78d2d121e69 GIT binary patch literal 635 zcmV->0)+ixXJsvAZewzJaCB*JZZ2I0=K~XcR@)g|uo1ed z1*Vc)U9gt3Ah-x=!Xa-fZwyra}ujvImeuPHHX zC4}ARVlLjPd3yP{9zp&UBUu8skHWr-dv&$0uWB`_U_e`Q~1zU__nkY1;)< z0OVL9QPAYm^Y-Xv&e`T#?51j7#|R?ym0Mu)yN4Zn8pQMDie!$cuVMKl^N!LpS&R|h V(rQei&|#Lg^O0TD1Zy*r+K#T$9k~Di literal 0 HcmV?d00001