packages/ircbot: add bot to devShell services

This commit is contained in:
Max Headroom 2022-09-25 19:28:19 +02:00
parent 7a6f7b5cc0
commit 43d852f11d
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,5 @@
{
"server": "127.0.0.1",
"port": 6668,
"tls": false
}

View file

@ -4,6 +4,7 @@ let
python = pkgs.python3;
procfile = pkgs.writeText "Procfile" ''
ircd: ${pkgs.ngircd}/bin/ngircd --config ${ircdConfig} --nodaemon
bot: ${python.interpreter} main.py
'';
ircdConfig = pkgs.writeText "ngircd.conf" ''
@ -29,6 +30,12 @@ let
Name = op
Password = op
'';
botConfig = pkgs.writeText "ircbot-config.json" (builtins.toJSON {
server = "127.0.0.1";
port = 6668;
tls = false;
});
in
{
projectShells.ircbot = {
@ -45,6 +52,7 @@ in
tools = [
python
];
env.IRCBOT_CONFIG.value = botConfig;
};
packages.ircbot = with pkgs; stdenvNoCC.mkDerivation {
pname = "ircbot";