yorokobot/flake.nix
2023-05-02 19:36:17 +02:00

59 lines
1.4 KiB
Nix

{
description = "Discord Bot managing users interests.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {self, nixpkgs, rust-overlay, flake-utils, ...}:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
in
with pkgs;
{
packages.default = pkgs.rustPlatform.buildRustPackage rec {
pname = "yorokobot";
version = "0.1.1";
src = self;
cargoSha256 = "sha256-hlTrcdNJsZsBEAQfMlpcGzPlUEUDs9A+PfBS06vj6HM=";
meta = with pkgs.lib; {
description = "Discord bot implementing a topic management system";
homepage = "https://sr.ht/~dala/yorokobot";
license = licenses.agpl3;
};
};
devShells.default = mkShell {
buildInputs = [
(
rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
}
)
];
packages = with pkgs; [
rust-analyzer
rustfmt
gdb
];
shellHook = ''
set -a
source .env
set +a
'';
};
}
);
}