initial commit
All checks were successful
Publish Docker Images / coverage-and-sonar (push) Successful in 6m0s
All checks were successful
Publish Docker Images / coverage-and-sonar (push) Successful in 6m0s
This commit is contained in:
16
nix/package.nix
Normal file
16
nix/package.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
rustPlatform,
|
||||
...
|
||||
}: let
|
||||
cargoToml = fromTOML (builtins.readFile ../Cargo.toml);
|
||||
name = cargoToml.package.name;
|
||||
version = cargoToml.package.version;
|
||||
rustBuild = rustPlatform.buildRustPackage {
|
||||
pname = name;
|
||||
inherit version;
|
||||
src = ../.;
|
||||
cargoLock.lockFile = ../Cargo.lock;
|
||||
};
|
||||
in {
|
||||
default = rustBuild;
|
||||
}
|
||||
11
nix/rust-version.nix
Normal file
11
nix/rust-version.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
rust-overlay,
|
||||
inputs,
|
||||
system,
|
||||
...
|
||||
}: let
|
||||
overlays = [(import rust-overlay)];
|
||||
in rec {
|
||||
pkgs = import inputs.nixpkgs {inherit system overlays;};
|
||||
version = pkgs.rust-bin.stable.latest.default;
|
||||
}
|
||||
44
nix/shell.nix
Normal file
44
nix/shell.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
rustVersion,
|
||||
...
|
||||
}:
|
||||
inputs.devenv.lib.mkShell {
|
||||
inherit inputs pkgs;
|
||||
modules = [
|
||||
{
|
||||
packages = with pkgs; [
|
||||
(rustVersion.override {
|
||||
extensions = [
|
||||
"clippy"
|
||||
"rust-src"
|
||||
"rust-analyzer"
|
||||
"rustfmt"
|
||||
];
|
||||
})
|
||||
bacon
|
||||
cargo-deny
|
||||
cargo-tarpaulin
|
||||
just
|
||||
];
|
||||
|
||||
processes.run.exec = "cargo watch -x run";
|
||||
|
||||
enterShell = ''
|
||||
echo ""
|
||||
echo "Rust development environment loaded!"
|
||||
echo "Rust version: $(rustc --version)"
|
||||
echo "Cargo version: $(cargo --version)"
|
||||
echo ""
|
||||
echo "Available tools:"
|
||||
echo " - rust-analyzer (LSP)"
|
||||
echo " - clippy (linter)"
|
||||
echo " - rustfmt (formatter)"
|
||||
echo " - bacon (continuous testing/linting)"
|
||||
echo " - cargo-deny (dependency checker)"
|
||||
echo " - cargo-tarpaulin (code coverage)"
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user