-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
89 lines (78 loc) · 2.33 KB
/
Copy pathflake.nix
File metadata and controls
89 lines (78 loc) · 2.33 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
description = "Deckard development shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { nixpkgs, ... }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
devShells = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
lib = pkgs.lib;
commonNativeInputs = with pkgs; [
rustup
just
pkg-config
nodejs_22
pnpm
cargo-deny
] ++ lib.optional (pkgs ? foundry) pkgs.foundry;
linuxBuildInputs = with pkgs; lib.optionals stdenv.isLinux [
openssl
gtk3
libayatana-appindicator
xdotool
libxcb
libxkbcommon
wayland
vulkan-headers
vulkan-loader
fontconfig
freetype
];
linuxLibraryPath = lib.optionalString pkgs.stdenv.isLinux (lib.makeLibraryPath (with pkgs; [
gtk3
libayatana-appindicator
xdotool
libxcb
libxkbcommon
wayland
vulkan-loader
fontconfig
freetype
]));
toolPath = lib.makeBinPath commonNativeInputs;
in
{
default = pkgs.mkShell {
name = "deckard-dev";
nativeBuildInputs = commonNativeInputs;
buildInputs = linuxBuildInputs;
env = {
DECKARD_NIX_DEV_SHELL = "1";
} // lib.optionalAttrs pkgs.stdenv.isLinux {
LD_LIBRARY_PATH = linuxLibraryPath;
};
shellHook = ''
export PATH="${toolPath}:$PATH"
if ! command -v anvil >/dev/null 2>&1 && [ -d "$HOME/.foundry/bin" ]; then
export PATH="$HOME/.foundry/bin:$PATH"
fi
echo "Deckard dev shell"
echo " Rust toolchain: rust-toolchain.toml (rustup)"
echo " Checks: cargo fmt --all --check && just check && cargo test --workspace"
echo " Browser QA: npm run qa:extension / npm run qa:walletbeat when relevant"
'';
};
});
};
}