create super strict rust config

This commit is contained in:
Mona Mayrhofer 2026-02-27 21:30:42 +01:00
commit d56ebb7e16
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 374AB152BDEBA1AE
36 changed files with 2969 additions and 0 deletions

100
flake.nix Normal file
View file

@ -0,0 +1,100 @@
{
description = "Description for the project";
inputs = {
devenv-root = {
url = "file+file:///dev/null";
flake = false;
};
nixpkgs.url = "github:cachix/devenv-nixpkgs/rolling";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
devenv.url = "github:cachix/devenv";
nix2container.url = "github:nlewo/nix2container";
nix2container.inputs.nixpkgs.follows = "nixpkgs";
mk-shell-bin.url = "github:rrbutani/nix-mk-shell-bin";
fenix.url = "github:nix-community/fenix/monthly";
fenix.inputs.nixpkgs.follows = "nixpkgs";
};
nixConfig = {
extra-trusted-public-keys = [
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
extra-substituters = [
"https://devenv.cachix.org"
"https://nix-community.cachix.org"
];
};
outputs =
inputs@{ flake-parts, devenv-root, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.devenv.flakeModule
];
systems = [
"x86_64-linux"
"i686-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
}:
{
devenv.shells.default =
let
fnx = inputs'.fenix.packages;
rustToolchain = fnx.beta.toolchain;
# rustToolchain = fnx.combine [
# fnx.complete.cargo
# fnx.complete.clippy
# fnx.complete.rust-src
# fnx.complete.rustc
# fnx.complete.rustfmt
# ];
in
{
name = "my-project";
packages = [
pkgs.dioxus-cli
pkgs.cargo-expand
pkgs.cargo-deny
pkgs.cargo-nextest
pkgs.typos
rustToolchain
fnx.rust-analyzer
];
scripts.checkall.exec = ''
set -xeuo pipefail
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo deny check all -D warnings
cargo fmt --all -- --check
cargo nextest run --workspace --all-targets --all-features --status-level all
cargo test
'';
# DO NOT ENABLE RUST because devenv messes up the ability
# to build rust-src
# languages.rust = {};
};
};
flake = { };
};
}