From 95ee759f754a30870bb3c8e3ca4433ad4035650a Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 25 Sep 2022 18:50:14 +0200 Subject: [PATCH] packages/ircbot: add devShell --- packages/servers/ircbot/.envrc | 2 ++ packages/servers/ircbot/project.nix | 42 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 packages/servers/ircbot/.envrc diff --git a/packages/servers/ircbot/.envrc b/packages/servers/ircbot/.envrc new file mode 100644 index 0000000..5d84e98 --- /dev/null +++ b/packages/servers/ircbot/.envrc @@ -0,0 +1,2 @@ +source ../../build-support/activate-shell +nix_direnv_watch_file project.nix diff --git a/packages/servers/ircbot/project.nix b/packages/servers/ircbot/project.nix index e9240ba..333a134 100644 --- a/packages/servers/ircbot/project.nix +++ b/packages/servers/ircbot/project.nix @@ -2,8 +2,50 @@ let python = pkgs.python3; + procfile = pkgs.writeText "Procfile" '' + ircd: ${pkgs.ngircd}/bin/ngircd --config ${ircdConfig} --nodaemon + ''; + + ircdConfig = pkgs.writeText "ngircd.conf" '' + [Global] + Name = ircbot-dev.local + Info = IRC Bot Development + Network = IRCBotDev + Listen = 127.0.0.1 + Ports = 6668 + + [Options] + Ident = no + PAM = no + AllowedChannelTypes = # + OperCanUseMode = yes + OperChanPAutoOp = yes + + [Channel] + Name = #general + Topic = General discussions + + [Operator] + Name = op + Password = op + ''; in { + projectShells.ircbot = { + commands = { + irssi-dev = { + help = "Irssi for development"; + command = "exec ${pkgs.irssi}/bin/irssi --config=$PRJ_DATA_DIR/irssi-config --home=$PRJ_DATA_DIR/irssi-home -c 127.0.0.1 -p 6668 \"$@\""; + }; + svc = { + help = "goreman with development services"; + command = "exec ${pkgs.goreman}/bin/goreman -f ${procfile} -set-ports=false \"$@\""; + }; + }; + tools = [ + python + ]; + }; packages.ircbot = with pkgs; stdenvNoCC.mkDerivation { pname = "ircbot"; version = "0.0.0";