Files
caitsith/flake.nix
Wyatt J. Miller 52dd1edb66
Some checks failed
build / docker (push) Has been cancelled
added nix package build
2026-01-16 21:53:32 -05:00

100 lines
2.6 KiB
Nix

# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.18)
{
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";
};
};
outputs = {
self,
flake-schemas,
nixpkgs,
rust-overlay,
}: let
overlays = [
rust-overlay.overlays.default
(final: prev: {
rustToolchain = final.rust-bin.stable.latest.default.override {extensions = ["rust-src"];};
})
];
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;
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
nixpkgs-fmt
pkg-config-unwrapped
openssl.dev
];
env = {
RUST_BACKTRACE = "1";
RUST_SRC_PATH = "${pkgs.rustToolchain}/lib/rustlib/src/rust/library";
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
};
};
});
packages = forEachSupportedSystem ({ pkgs }: {
default = let
pname = "caitsith";
version = "master";
src = pkgs.fetchFromGitea {
domain = "scm.wyattjmiller.com";
owner = "wymiller";
repo = "caitsith";
rev = "${version}";
sha256 = "sha256-bNIzb57qPzzgwGVTjk2N59P7Rtt0MdyJY12sTAH05/s=";
};
in pkgs.rustPlatform.buildRustPackage {
inherit pname version src;
cargoLock = { lockFile = "${src}/Cargo.lock"; };
nativeBuildInputs = with pkgs; [
pkg-config-unwrapped
openssl.dev
];
meta = {
description = "A Discord bot that deathrolls";
mainProgram = "caitsith";
homepage = "https://scm.wyattjmiller.com/wymiller/caitsith";
maintainers = [ "wymillerlinux" ];
platforms = [ "x86_64-linux" ];
};
env = {
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
};
};
});
};
}