axum-controller/flake.nix

107 lines
2.7 KiB
Nix
Raw Normal View History

2025-03-04 13:36:56 +01:00
{
description = "A Nix-flake-based Rust development environment";
nixConfig = {
extra-substituters = [
"https://nixcache.vlt81.de"
"https://cuda-maintainers.cachix.org"
];
extra-trusted-public-keys = [
"nixcache.vlt81.de:nw0FfUpePtL6P3IMNT9X6oln0Wg9REZINtkkI9SisqQ="
];
};
inputs = {
2025-03-05 00:46:21 +01:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2025-03-04 13:36:56 +01:00
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
flake-parts.url = "github:hercules-ci/flake-parts";
devshell.url = "github:numtide/devshell";
};
outputs =
{ self
, nixpkgs
, rust-overlay
, flake-utils
, devshell
, ...
}:
flake-utils.lib.eachDefaultSystem
(system:
let
overlays = [
rust-overlay.overlays.default
devshell.overlays.default
(final: prev: {
customRustToolchain = prev.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
})
];
pkgs = import nixpkgs {
inherit system overlays;
config = {
allowUnfree = true;
};
};
buildInputs = with pkgs; [
zlib
clang
libclang
gzip
coreutils
gdb
glib
glibc
];
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs;
[
customRustToolchain
bacon
binaryen
cacert
cargo-bloat
cargo-docset
cargo-machete
cargo-limit
cargo-deny
cargo-edit
cargo-watch
cargo-make
cargo-generate
cargo-udeps
cargo-outdated
cargo-release
calc
fish
inotify-tools
mold
pkg-config
sccache
unzip
]
++ buildInputs;
buildInputs = buildInputs;
shellHook = ''
# export NIX_LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath buildInputs}:$NIX_LD_LIBRARY_PATH
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath buildInputs}"
export MALLOC_CONF=thp:always,metadata_thp:always
'';
};
2025-03-05 00:46:21 +01:00
packages = {
2025-03-09 20:17:01 +01:00
# default = pkgs.callPackage ./package.nix { };
2025-03-05 00:46:21 +01:00
};
}) // {
hydraJobs =
let
system = "x86_64-linux";
2025-03-09 20:17:01 +01:00
# packages = self.packages."${system}";
2025-03-05 00:46:21 +01:00
devShells = self.devShells."${system}";
in
{
2025-03-09 20:17:01 +01:00
inherit devShells;
2025-03-05 00:46:21 +01:00
};
};
2025-03-04 13:36:56 +01:00
}