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