diff --git a/packages/projects.nix b/packages/projects.nix index 22dd73b..c4a782a 100644 --- a/packages/projects.nix +++ b/packages/projects.nix @@ -27,6 +27,7 @@ ./modules/devshell.nix ./build-support + ./servers/ircbot/project.nix ./websites/landing/project.nix ./websites/stop-using-nix-env/project.nix ]; diff --git a/packages/servers/ircbot/project.nix b/packages/servers/ircbot/project.nix new file mode 100644 index 0000000..e9240ba --- /dev/null +++ b/packages/servers/ircbot/project.nix @@ -0,0 +1,32 @@ +{ inputs, pkgs, ... }: + +let + python = pkgs.python3; +in +{ + packages.ircbot = with pkgs; stdenvNoCC.mkDerivation { + pname = "ircbot"; + version = "0.0.0"; + + src = with inputs.nix-filter.lib; filter { + root = ./.; + include = [ + (matchExt "py") + (inDirectory "hooks") + ]; + }; + installPhase = '' + mkdir -p $out/bin $out/lib + + cp -r $src/ $out/lib/ircbot + + cat <$out/bin/ircbot + #!${runtimeShell} + export PYTHONNOUSERSITE=true + export PYTHONPATH="$out/lib/ircbot" + exec ${python.interpreter} $out/lib/ircbot/main.py "$@" + EOF + chmod +x $out/bin/ircbot + ''; + }; +}