Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
63 lines (59 loc) · 1.82 KB
/
Copy pathflake.nix
File metadata and controls
63 lines (59 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
description = "bcode development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
# Keep the native formatter crates and development tools on a compatible toolchain.
rustc =
assert pkgs.lib.versionAtLeast pkgs.rustc.version "1.97";
pkgs.rustc;
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
rustc
]
++ (with pkgs; [
cargo
rustfmt
clippy
llvmPackages.lld
cmake
markdownlint-cli
pkg-config
openssl
fish
]);
shellHook = ''
echo "bcode development environment loaded"
echo "Available tools:"
echo " - cargo ($(cargo --version))"
echo " - rustc ($(rustc --version))"
echo " - clippy ($(cargo clippy --version))"
echo " - markdownlint ($(markdownlint --version))"
echo ""
echo "Run 'markdownlint *.md **/*.md' to lint all markdown files"
echo "Run 'markdownlint --fix *.md **/*.md' to auto-fix markdown issues"
echo "Run 'cargo clippy --all-targets -- -D warnings' for strict linting"
# Only exec fish if we're in an interactive shell (not running a command)
if [ -z "$IN_NIX_SHELL_FISH" ] && [ -z "$BASH_EXECUTION_STRING" ]; then
case "$-" in
*i*) export IN_NIX_SHELL_FISH=1; exec fish ;;
esac
fi
'';
};
}
);
}