2025-04-19 20:22:08 -04:00
|
|
|
{
|
|
|
|
|
description = "A dice roller bot";
|
|
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
|
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*";
|
|
|
|
|
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*";
|
|
|
|
|
rust-overlay = {
|
|
|
|
|
url = "github:oxalica/rust-overlay";
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2026-08-25 22:09:24 -04:00
|
|
|
outputs =
|
|
|
|
|
{
|
|
|
|
|
self,
|
|
|
|
|
flake-schemas,
|
|
|
|
|
nixpkgs,
|
|
|
|
|
rust-overlay,
|
|
|
|
|
}:
|
|
|
|
|
let
|
|
|
|
|
overlays = [
|
|
|
|
|
rust-overlay.overlays.default
|
|
|
|
|
(final: _: {
|
|
|
|
|
rustToolchain = final.rust-bin.stable.latest.default.override { extensions = [ "rust-src" ]; };
|
|
|
|
|
})
|
|
|
|
|
];
|
2025-04-19 20:22:08 -04:00
|
|
|
|
2026-08-25 22:09:24 -04:00
|
|
|
supportedSystems = [
|
|
|
|
|
"x86_64-linux"
|
|
|
|
|
"aarch64-darwin"
|
|
|
|
|
"aarch64-linux"
|
|
|
|
|
];
|
|
|
|
|
forEachSupportedSystem =
|
|
|
|
|
f:
|
|
|
|
|
nixpkgs.lib.genAttrs supportedSystems (
|
|
|
|
|
system:
|
|
|
|
|
f {
|
|
|
|
|
pkgs = import nixpkgs { inherit overlays system; };
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
schemas = flake-schemas.schemas;
|
|
|
|
|
formatter = forEachSupportedSystem ({ pkgs }: pkgs.nixfmt-rfc-style);
|
|
|
|
|
devShells = forEachSupportedSystem (
|
|
|
|
|
{ pkgs }:
|
|
|
|
|
{
|
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
|
packages = with pkgs; [
|
|
|
|
|
rustToolchain
|
|
|
|
|
cargo-bloat
|
|
|
|
|
cargo-edit
|
|
|
|
|
cargo-outdated
|
|
|
|
|
cargo-udeps
|
|
|
|
|
cargo-watch
|
|
|
|
|
rust-analyzer
|
|
|
|
|
curl
|
|
|
|
|
git
|
|
|
|
|
jq
|
|
|
|
|
wget
|
|
|
|
|
nixfmt-rfc-style
|
|
|
|
|
pkg-config-unwrapped
|
|
|
|
|
openssl.dev
|
|
|
|
|
];
|
2025-04-19 20:22:08 -04:00
|
|
|
|
2026-08-25 22:09:24 -04:00
|
|
|
env = {
|
|
|
|
|
RUST_BACKTRACE = "1";
|
|
|
|
|
RUST_SRC_PATH = "${pkgs.rustToolchain}/lib/rustlib/src/rust/library";
|
|
|
|
|
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
);
|
2025-04-19 20:22:08 -04:00
|
|
|
|
2026-08-25 22:09:24 -04:00
|
|
|
packages = forEachSupportedSystem (
|
|
|
|
|
{ pkgs }:
|
|
|
|
|
let
|
|
|
|
|
pname = "caitsith";
|
|
|
|
|
version = "master";
|
2026-01-16 21:53:32 -05:00
|
|
|
|
2026-08-25 22:09:24 -04:00
|
|
|
bot = pkgs.rustPlatform.buildRustPackage {
|
|
|
|
|
inherit pname version;
|
|
|
|
|
src = self;
|
|
|
|
|
cargoLock = {
|
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
|
};
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
|
pkg-config-unwrapped
|
|
|
|
|
openssl.dev
|
|
|
|
|
];
|
2026-01-16 21:53:32 -05:00
|
|
|
|
2026-08-25 22:09:24 -04:00
|
|
|
meta = {
|
|
|
|
|
description = "A dice roller bot";
|
|
|
|
|
mainProgram = "caitsith";
|
|
|
|
|
homepage = "https://scm.wyattjmiller.com/wymiller/caitsith";
|
|
|
|
|
maintainers = [ "wymillerlinux" ];
|
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
|
};
|
2026-01-16 21:53:32 -05:00
|
|
|
|
2026-08-25 22:09:24 -04:00
|
|
|
env = {
|
|
|
|
|
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
default = bot;
|
|
|
|
|
docker = pkgs.dockerTools.buildLayeredImage {
|
|
|
|
|
name = pname;
|
|
|
|
|
tag = "latest";
|
|
|
|
|
contents = [
|
|
|
|
|
bot
|
|
|
|
|
pkgs.cacert
|
|
|
|
|
];
|
2026-01-16 21:53:32 -05:00
|
|
|
|
2026-08-25 22:09:24 -04:00
|
|
|
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 dice roller bot";
|
|
|
|
|
"org.opencontainers.image.source" = "https://scm.wyattjmiller.com/wymiller/caitsith";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
};
|
2025-04-19 20:22:08 -04:00
|
|
|
}
|