diff --git a/hosts/koi/configuration.nix b/hosts/koi/configuration.nix index 97316cf..1ae1db2 100755 --- a/hosts/koi/configuration.nix +++ b/hosts/koi/configuration.nix @@ -27,6 +27,7 @@ ./containers/sharkey ./containers/pds ./containers/zond + ./containers/bots/pcre-sub-bot.nix ./vms/hass.nix ./vms/bnuuy.nix # ./vms/windows.nix @@ -75,9 +76,8 @@ allowedBridges = [ "br0" ]; }; - virtualisation.docker = { - enable = true; - }; + virtualisation.docker.enable = true; + virtualisation.oci-containers.backend = "docker"; boot.extraModprobeConfig = '' options kvm_amd avic=1 nested=0 diff --git a/hosts/koi/containers/bots/pcre-sub-bot.nix b/hosts/koi/containers/bots/pcre-sub-bot.nix new file mode 100644 index 0000000..f771c20 --- /dev/null +++ b/hosts/koi/containers/bots/pcre-sub-bot.nix @@ -0,0 +1,36 @@ +{ abs, config, ... }: + +let + secrets = import (abs "lib/secrets.nix"); + + UID = 1101; +in { + imports = [ + (secrets.declare [{ + name = "pcresub-bot-env"; + owner = "pcre-sub-bot"; + }]) + ]; + + users.groups.pcre-sub-bot = {}; + users.users.pcre-sub-bot = { + group = "pcre-sub-bot"; + isNormalUser = true; + uid = UID; + }; + + virtualisation.oci-containers.containers.pcre-sub-bot = { + image = "ghcr.io/teidesu/pcre-sub-bot:sha-d010ea7@sha256:d30a1adf852f1953bb4015d55f0031a41bd65657abc4880ecd1dfcb67a77a678"; + volumes = [ + "/srv/pcre-sub-bot:/app/bot-data" + ]; + environmentFiles = [ + (secrets.file config "pcresub-bot-env") + ]; + user = builtins.toString UID; + }; + + systemd.tmpfiles.rules = [ + "d /srv/pcre-sub-bot 0777 pcre-sub-bot pcre-sub-bot -" + ]; +} \ No newline at end of file diff --git a/secrets/pcresub-bot-env.age b/secrets/pcresub-bot-env.age new file mode 100644 index 0000000..8a9c26b --- /dev/null +++ b/secrets/pcresub-bot-env.age @@ -0,0 +1,7 @@ +age-encryption.org/v1 +-> ssh-ed25519 sj88Xw dS5IBa9GylKmRN5qjkcH8r6Zf1X9f/3ulsWqeeTDsxk +LrhgkPSkURf6XdV1zt3BdfVXhjbB4L1CbXfi+ANHzoA +--- u5wPM3DOfKBoYvsbTFo5xhe6liFVkwwfV2pAFF2Za6k +e¼ò>2™ 5šV}áYi´…Ìo™£3†%Rlx'ó²6ÞעS»ç%,äQ”F‘ÊA”êÂHr˜ +}ìWýLR.0S·HhWŽñÚ»ïô¯³ÑU3ôŸ©0YiÎÄ&<±/@åÅÖøXÌŒHÑF-bpvëTQÊ_“íK’ÅzOæÁñ¦¿›õv&¯Òj¡o +c ýÈÊ‹ƒ¹qY?p \ No newline at end of file