diff --git a/.agenix_config.nix b/.agenix_config.nix index 69aa4dc..c1dea44 100644 Binary files a/.agenix_config.nix and b/.agenix_config.nix differ diff --git a/Makefile b/Makefile index c43625d..994bb3b 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,8 @@ NIX_LOCK := nix flake lock DEPS_MY := \ myneovim \ - vnetod + vnetod \ + yagpt_ts_bot DEPS_NIXOS := \ nixpkgs \ diff --git a/flake.lock b/flake.lock index e2a93d0..94492e2 100644 --- a/flake.lock +++ b/flake.lock @@ -672,7 +672,8 @@ "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", "vnetod": "vnetod", - "wired": "wired" + "wired": "wired", + "yagpt_tg_bot": "yagpt_tg_bot" } }, "rust-overlay": { @@ -823,6 +824,29 @@ "repo": "wired-notify", "type": "github" } + }, + "yagpt_tg_bot": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1687989096, + "narHash": "sha256-BwQ3tx3aXcOg0QzAdBgloINwzlz9EZsB2DePVlOHGEs=", + "ref": "refs/heads/main", + "rev": "d96a2d8416f29f122650b198b8c0ea1a7b2a71e7", + "revCount": 3, + "type": "git", + "url": "https://git.pleshevski.ru/pleshevskiy/yandexgpt_tg_bot" + }, + "original": { + "type": "git", + "url": "https://git.pleshevski.ru/pleshevskiy/yandexgpt_tg_bot" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index ab246ec..05c844f 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,12 @@ inputs.flake-utils.follows = "flake-utils"; }; + yagpt_tg_bot = { + url = "git+https://git.pleshevski.ru/pleshevskiy/yandexgpt_tg_bot"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; + mailserver = { url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/nixos/hosts/canigou/default.nix b/nixos/hosts/canigou/default.nix index f0a91ca..621fc3e 100644 --- a/nixos/hosts/canigou/default.nix +++ b/nixos/hosts/canigou/default.nix @@ -16,6 +16,7 @@ in ./services/wireguard.nix ./services/miniflux.nix + ./services/telegram-bot.nix ]; boot.kernelPackages = pkgs.linuxPackages_6_1; diff --git a/nixos/hosts/canigou/services/telegram-bot.nix b/nixos/hosts/canigou/services/telegram-bot.nix new file mode 100644 index 0000000..5813a9c --- /dev/null +++ b/nixos/hosts/canigou/services/telegram-bot.nix @@ -0,0 +1,12 @@ +{ config, ... }: + +{ + services.yandexgpt_telegram_bot = { + enabled = true; + environmentFile = config.age.secrets.yandexgpt-tg-bot-env.path; + }; + + age.secrets.yandexgpt-tg-bot-env = { + file = ../../../../secrets/yandexgpt-tg-bot-env.age; + }; +} diff --git a/nixos/hosts/default.nix b/nixos/hosts/default.nix index f8bac7d..ddf5680 100644 --- a/nixos/hosts/default.nix +++ b/nixos/hosts/default.nix @@ -2,6 +2,7 @@ let hardware = inputs.hardware.nixosModules; + yagpt_tg_bot = inputs.yagpt_tg_bot.nixosModules; in { home = { @@ -9,6 +10,7 @@ in extraModules = [ hardware.common-gpu-amd + yagpt_tg_bot.default ../modules/nix.nix ../modules/wireguard-client.nix ../../home/users/jan @@ -52,6 +54,10 @@ in canigou = { system = "x86_64-linux"; + extraModules = [ + yagpt_tg_bot.default + ]; + targetHost = (import ./canigou/data.secret.nix).addr; }; } diff --git a/secrets/yandexgpt-tg-bot-env.age b/secrets/yandexgpt-tg-bot-env.age new file mode 100644 index 0000000..0c581c9 Binary files /dev/null and b/secrets/yandexgpt-tg-bot-env.age differ