doc: remove useless rec

This commit is contained in:
Pol Dellaiera 2025-04-19 22:10:45 +02:00
parent b4515ff6c2
commit 30eb01e120
3 changed files with 148 additions and 150 deletions

View file

@ -41,7 +41,7 @@ One advantage is that when `pkgs.zlib` is updated, it will automatically update
(pkgs.zlib.override {
stdenv = pkgs.emscriptenStdenv;
}).overrideAttrs
(old: rec {
(old: {
buildInputs = old.buildInputs ++ [ pkg-config ];
# we need to reset this setting!
env = (old.env or { }) // {
@ -119,8 +119,9 @@ One advantage is that when `pkgs.zlib` is updated, it will automatically update
This `xmlmirror` example features an Emscripten package that is defined completely from this context and no `pkgs.zlib.override` is used.
```nix
pkgs.buildEmscriptenPackage rec {
name = "xmlmirror";
pkgs.buildEmscriptenPackage {
pname = "xmlmirror";
version = "1.2.3";
buildInputs = [
pkg-config

View file

@ -28,9 +28,8 @@ You can install it like any other packages via `nix-env -iA myEmacs`. However, t
```nix
{
packageOverrides =
pkgs: with pkgs; rec {
myEmacsConfig = writeText "default.el" ''
packageOverrides = pkgs: {
myEmacsConfig = pkgs.writeText "default.el" ''
(eval-when-compile
(require 'use-package))

View file

@ -300,15 +300,14 @@ This provides us with some useful documentation for using our packages. However
```nix
{
packageOverrides =
pkgs: with pkgs; rec {
myProfile = writeText "my-profile" ''
packageOverrides = pkgs: {
myProfile = pkgs.writeText "my-profile" ''
export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man
'';
myPackages = pkgs.buildEnv {
name = "my-packages";
paths = [
paths = with pkgs; [
(runCommand "profile" { } ''
mkdir -p $out/etc/profile.d
cp ${myProfile} $out/etc/profile.d/my-profile.sh
@ -360,16 +359,15 @@ Configuring GNU info is a little bit trickier than man pages. To work correctly,
```nix
{
packageOverrides =
pkgs: with pkgs; rec {
myProfile = writeText "my-profile" ''
packageOverrides = pkgs: {
myProfile = pkgs.writeText "my-profile" ''
export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man
export INFOPATH=$HOME/.nix-profile/share/info:/nix/var/nix/profiles/default/share/info:/usr/share/info
'';
myPackages = pkgs.buildEnv {
name = "my-packages";
paths = [
paths = with pkgs; [
(runCommand "profile" { } ''
mkdir -p $out/etc/profile.d
cp ${myProfile} $out/etc/profile.d/my-profile.sh