mod: refactor commands to global commands, restrict from direct messages

nix build works too
This commit is contained in:
2026-08-01 20:37:26 -04:00
parent e1a69c05a8
commit 451275682d
5 changed files with 46 additions and 254 deletions
+32 -22
View File
@@ -61,34 +61,44 @@
};
});
packages = forEachSupportedSystem ({ pkgs }: {
default = let
pname = "hildebrand";
version = "master";
packages = forEachSupportedSystem ({ pkgs }: let
pname = "hildebrand";
version = "master";
src = pkgs.fetchFromGitea {
domain = "scm.wyattjmiller.com";
owner = "wymiller";
repo = "hildebrand";
rev = "${version}";
sha256 = "sha256-bNIzb57qPzzgwGVTjk2N59P7Rtt0MdyJY12sTAH05/s=";
};
in pkgs.rustPlatform.buildRustPackage {
inherit pname version src;
cargoLock = { lockFile = "${src}/Cargo.lock"; };
bot = pkgs.rustPlatform.buildRustPackage {
inherit pname version;
src = self;
cargoLock = { lockFile = ./Cargo.lock; };
nativeBuildInputs = [pkgs.cmake];
meta = {
description = "A Discord trivia buzzer bot";
mainProgram = "caitsith";
homepage = "https://scm.wyattjmiller.com/wymiller/caitsith";
mainProgram = "hildebrand";
homepage = "https://scm.wyattjmiller.com/wymiller/hildebrand";
maintainers = [ "wymillerlinux" ];
platforms = [ "x86_64-linux" ];
};
env = {
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
platforms = supportedSystems;
};
};
});
in
{
default = bot;
}
// pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
docker = pkgs.dockerTools.buildLayeredImage {
name = pname;
tag = "latest";
contents = [bot pkgs.cacert];
config = {
Entrypoint = ["${bot}/bin/${pname}"];
Env = ["SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"];
Labels = {
"org.opencontainers.image.title" = pname;
"org.opencontainers.image.description" = "A Discord trivia buzzer bot";
"org.opencontainers.image.source" = "https://scm.wyattjmiller.com/wymiller/hildebrand";
};
};
};
});
};
}