mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 07:46:21 +02:00
Switch example to a primop this is less ill-advised
Any primop will do for this, so might as well use one that isn't impure. Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
parent
e8067daf09
commit
4da7c86618
1 changed files with 2 additions and 1 deletions
|
@ -9,7 +9,8 @@ These constants are built into the Nix language evaluator:
|
||||||
Since built-in functions were added over time, [testing for attributes](./operators.md#has-attribute) in `builtins` can be used for graceful fallback on older Nix installations:
|
Since built-in functions were added over time, [testing for attributes](./operators.md#has-attribute) in `builtins` can be used for graceful fallback on older Nix installations:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
if builtins ? getEnv then builtins.getEnv "PATH" else ""
|
# if hasContext is not available, we assume `s` has a context
|
||||||
|
if builtins ? hasContext then builtins.hasContext s else true
|
||||||
```
|
```
|
||||||
|
|
||||||
- [`builtins.currentSystem`]{#builtins-currentSystem} (string)
|
- [`builtins.currentSystem`]{#builtins-currentSystem} (string)
|
||||||
|
|
Loading…
Reference in a new issue