singularity-forge/flake.nix

58 lines
1.4 KiB
Nix
Raw Normal View History

2026-04-15 13:38:15 +02:00
{
description = "Development and build environment for singularity-forge";
2026-04-15 13:38:15 +02:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
2026-04-21 23:27:40 +02:00
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
bash
cargo
clippy
git
just
pkg-config
protobuf
rust-analyzer
rustc
rustfmt
uv
zlib
];
2026-04-15 13:38:15 +02:00
shellHook = ''
export SF_SOURCE_DIR="${toString ./.}"
2026-05-05 20:08:02 +02:00
if [ -x "$HOME/.local/bin/mise" ]; then
MISE_NODE_BIN="$("$HOME/.local/bin/mise" which node 2>/dev/null || true)"
if [ -n "$MISE_NODE_BIN" ]; then
export PATH="$(dirname "$MISE_NODE_BIN"):$PATH"
fi
fi
export PATH="$SF_SOURCE_DIR/bin:$PATH"
export RUST_BACKTRACE=1
2026-04-15 13:38:15 +02:00
echo "singularity-forge development shell"
echo " cargo: $(command -v cargo)"
echo " node : $(command -v node)"
echo " protoc: $(command -v protoc)"
echo " rustc: $(command -v rustc)"
echo ""
echo "Build native addon:"
echo " node rust-engine/scripts/build.js"
'';
};
});
2026-04-15 13:38:15 +02:00
}