packages/ircbot: build

This commit is contained in:
Max Headroom 2022-09-25 17:49:59 +02:00
parent cbf4a3b256
commit 253fd2f2f0
2 changed files with 33 additions and 0 deletions

View file

@ -27,6 +27,7 @@
./modules/devshell.nix
./build-support
./servers/ircbot/project.nix
./websites/landing/project.nix
./websites/stop-using-nix-env/project.nix
];

View file

@ -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 <<EOF >$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
'';
};
}