gejdr-rs/flake.nix
Lucien Cartier-Tilet c2289fe8cd
Some checks failed
CI / tests (push) Failing after 4m3s
feat: OAuth implementation with Discord
This commit separates the core features of géjdr from the backend as
these will also be used by the bot in the future.

This commit also updates the dependencies of the project. It also
removes the dependency lettre as well as the mailpit docker service
for developers as it appears clearer this project won’t send emails
anytime soon.

The publication of a docker image is also postponed until later.
2025-01-11 01:18:08 +01:00

62 lines
1.8 KiB
Nix

{
description = "Backend for GéJDR, a Discord helper tool for the TTRPG L'Anneau Unique";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachSystem ["x86_64-linux"] (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
rustVersion = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml);
rustPlatform = pkgs.makeRustPlatform {
cargo = rustVersion;
rustc = rustVersion;
};
appName = "gejdr-backend";
appRustBuild = rustPlatform.buildRustPackage {
pname = appName;
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
};
dockerImage = pkgs.dockerTools.buildLayeredImage {
name = appName;
config = {
Entrypoint = [ "${appRustBuild}/bin/${appName}" ];
Env = [ "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ];
Tag = "latest";
};
contents = [ appRustBuild pkgs.cacert ];
};
in {
packages = {
rustPackage = appRustBuild;
docker = dockerImage;
};
defaultPackage = dockerImage;
devShell = with pkgs; mkShell {
buildInputs = [
bacon
cargo
cargo-audit
cargo-auditable
cargo-tarpaulin
cargo-msrv
just
rust-analyzer
(rustVersion.override { extensions = [ "rust-src" ]; })
sqls
sqlx-cli
];
};
});
}