diff --git a/doc/manual/builtins.xml b/doc/manual/builtins.xml index 1f881a9117..3eee36f2ae 100644 --- a/doc/manual/builtins.xml +++ b/doc/manual/builtins.xml @@ -77,18 +77,8 @@ attrValues = attrs: map (name: builtins.getAttr name attrs) (builtins.attrNames if builtins ? getEnv then builtins.getEnv "PATH" else "" This allows a Nix expression to fall back gracefully on older Nix - installations that don’t have the desired built-in function. - However, in that case you should not write - - -if builtins ? getEnv then __getEnv "PATH" else "" - - This Nix expression will trigger an “undefined variable” error on - older Nix versions since __getEnv doesn’t - exist. builtins.getEnv, on the other hand, is - safe since builtins always exists and attribute - selection is lazy, so it’s only performed if the test - succeeds. + installations that don’t have the desired built-in + function. diff --git a/doc/manual/opt-common.xml b/doc/manual/opt-common.xml index 316ad6658f..ac967e23d0 100644 --- a/doc/manual/opt-common.xml +++ b/doc/manual/opt-common.xml @@ -251,14 +251,14 @@ { # The system (e.g., `i686-linux') for which to build the packages. - system ? __currentSystem + system ? builtins.currentSystem ... }: ... So if you call this Nix expression (e.g., when you do nix-env -i pkgname), the function will be called automatically using the value __currentSystem + linkend='builtin-currentSystem'>builtins.currentSystem for the system argument. You can override this using , e.g., nix-env -i pkgname --arg system