File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ These environment variables ensure that:
202
202
203
203
### Custom Configuration
204
204
205
- Override environment variables in your ` flake.nix ` :
205
+ Extend the development environment in your ` flake.nix ` :
206
206
207
207
``` nix
208
208
{
@@ -211,15 +211,15 @@ Override environment variables in your `flake.nix`:
211
211
inherit self;
212
212
src = ./.;
213
213
214
- devShells.default = zero-nix.devShells.default.override {
215
- shellHook = ''
214
+ devShells.default = zero-nix.devShells.default.overrideAttrs (oldAttrs: {
215
+ shellHook = (oldAttrs.shellHook or "") + ''
216
216
# Custom solana configuration
217
217
solana config set --url https://api.mainnet-beta.solana.com
218
218
219
219
# Project-specific setup
220
220
echo "My Solana project initialized"
221
221
'';
222
- };
222
+ }) ;
223
223
};
224
224
}
225
225
```
@@ -245,12 +245,12 @@ Add zero.nix to your `flake.nix`:
245
245
};
246
246
247
247
outputs = { self, zero-nix }: {
248
- devShells.default = zero-nix.devShells.default.override {
249
- buildInputs = with zero-nix.legacyPackages.${system}; [
248
+ devShells.default = zero-nix.devShells.default.overrideAttrs (oldAttrs: {
249
+ buildInputs = (oldAttrs.buildInputs or []) ++ ( with zero-nix.legacyPackages.${system}; [
250
250
solana-tools
251
251
# Add your existing tools here
252
- ];
253
- };
252
+ ]) ;
253
+ }) ;
254
254
};
255
255
}
256
256
```
Original file line number Diff line number Diff line change @@ -329,11 +329,13 @@ EOF
329
329
mkdir -p "$CARGO_HOME" "$RUSTUP_HOME"
330
330
331
331
# Check if this is for IDL generation and use nightly rust
332
- if [[ "$*" == *"idl"* ]]; then
333
- export PATH="${ nightly-rust } /bin:${ solana-node } /bin:$PATH"
334
- export RUSTC="${ nightly-rust } /bin/rustc"
335
- export CARGO="${ nightly-rust } /bin/cargo"
336
- fi
332
+ case " $@ " in
333
+ *" idl "*)
334
+ export PATH="${ nightly-rust } /bin:${ solana-node } /bin:$PATH"
335
+ export RUSTC="${ nightly-rust } /bin/rustc"
336
+ export CARGO="${ nightly-rust } /bin/cargo"
337
+ ;;
338
+ esac
337
339
338
340
# Run anchor with platform tools environment
339
341
exec "${ anchor } /bin/anchor" "$@"
You can’t perform that action at this time.
0 commit comments