- Rust
- rust-overlay compiler version selector.
- Development environment: rust, rust-analyzer, cargo-outdated and cargo-udeps for nightly compiler.
- Docker container build via NIX dockerTools.
- NIX checks:
cargo fmt
,cargo clippy
,cargo audit
andcargo nextest
. - Pre-defined CI pipelines:
- GitHub.
- GitLab.
- Haskell.
- Fine-tuned cabal config: extra warning and optimization flags, pre-defined extenstion and dependencies.
- Development environment: cabal, latest GHC and haskell-language-server.
- Pre-defined CI pipelines:
- GitHub.
- GitLab.
# Install nix:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# Create NIX config directory:
mkdir -p ~/.config/nix
# Add flake support:
echo "experimental-features = flakes nix-command" >> ~/.config/nix/nix.conf
# `rust-bin` template:
nix flake init --template github:npatsakula/flake-templates#rust-bin
# `rust-bin` template:
nix flake new --template github:npatsakula/flake-templates#rust-bin ./rusty
# Until we don't have template name replacer:
cd rusty && sd 'rust-bin' 'rusty' Cargo.toml
nix flake check -j$(nproc)
NB! Currently only for rust-bin
.
# Build image:
nix build -j$(nproc) '.#container'
# Import image:
docker build < result
Image will contain only (!) executable app and some minimal runtime (coreutils is not included).
You can add some native dependencies by extending contents
section:
contents = [ packages."${name}" pkgs.coreutils-full ];
NB! You can search dependencies with nixpkg.
Add dependencies in nativeBuildInputs
list:
nativeBuildInputs = with pkgs; [ zstd.dev mimalloc.dev pkg-config ];
Replace nixpkgs
in input
section:
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";