mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
doc: remove useless rec
This commit is contained in:
parent
b4515ff6c2
commit
30eb01e120
3 changed files with 148 additions and 150 deletions
|
@ -41,7 +41,7 @@ One advantage is that when `pkgs.zlib` is updated, it will automatically update
|
||||||
(pkgs.zlib.override {
|
(pkgs.zlib.override {
|
||||||
stdenv = pkgs.emscriptenStdenv;
|
stdenv = pkgs.emscriptenStdenv;
|
||||||
}).overrideAttrs
|
}).overrideAttrs
|
||||||
(old: rec {
|
(old: {
|
||||||
buildInputs = old.buildInputs ++ [ pkg-config ];
|
buildInputs = old.buildInputs ++ [ pkg-config ];
|
||||||
# we need to reset this setting!
|
# we need to reset this setting!
|
||||||
env = (old.env or { }) // {
|
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.
|
This `xmlmirror` example features an Emscripten package that is defined completely from this context and no `pkgs.zlib.override` is used.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
pkgs.buildEmscriptenPackage rec {
|
pkgs.buildEmscriptenPackage {
|
||||||
name = "xmlmirror";
|
pname = "xmlmirror";
|
||||||
|
version = "1.2.3";
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
pkg-config
|
pkg-config
|
||||||
|
|
|
@ -28,80 +28,79 @@ You can install it like any other packages via `nix-env -iA myEmacs`. However, t
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
packageOverrides =
|
packageOverrides = pkgs: {
|
||||||
pkgs: with pkgs; rec {
|
myEmacsConfig = pkgs.writeText "default.el" ''
|
||||||
myEmacsConfig = writeText "default.el" ''
|
(eval-when-compile
|
||||||
(eval-when-compile
|
(require 'use-package))
|
||||||
(require 'use-package))
|
|
||||||
|
|
||||||
;; load some packages
|
;; load some packages
|
||||||
|
|
||||||
(use-package company
|
(use-package company
|
||||||
:bind ("<C-tab>" . company-complete)
|
:bind ("<C-tab>" . company-complete)
|
||||||
:diminish company-mode
|
:diminish company-mode
|
||||||
:commands (company-mode global-company-mode)
|
:commands (company-mode global-company-mode)
|
||||||
:defer 1
|
:defer 1
|
||||||
:config
|
:config
|
||||||
(global-company-mode))
|
(global-company-mode))
|
||||||
|
|
||||||
(use-package counsel
|
(use-package counsel
|
||||||
:commands (counsel-descbinds)
|
:commands (counsel-descbinds)
|
||||||
:bind (([remap execute-extended-command] . counsel-M-x)
|
:bind (([remap execute-extended-command] . counsel-M-x)
|
||||||
("C-x C-f" . counsel-find-file)
|
("C-x C-f" . counsel-find-file)
|
||||||
("C-c g" . counsel-git)
|
("C-c g" . counsel-git)
|
||||||
("C-c j" . counsel-git-grep)
|
("C-c j" . counsel-git-grep)
|
||||||
("C-c k" . counsel-ag)
|
("C-c k" . counsel-ag)
|
||||||
("C-x l" . counsel-locate)
|
("C-x l" . counsel-locate)
|
||||||
("M-y" . counsel-yank-pop)))
|
("M-y" . counsel-yank-pop)))
|
||||||
|
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
:defer 2
|
:defer 2
|
||||||
:config (global-flycheck-mode))
|
:config (global-flycheck-mode))
|
||||||
|
|
||||||
(use-package ivy
|
(use-package ivy
|
||||||
:defer 1
|
:defer 1
|
||||||
:bind (("C-c C-r" . ivy-resume)
|
:bind (("C-c C-r" . ivy-resume)
|
||||||
("C-x C-b" . ivy-switch-buffer)
|
("C-x C-b" . ivy-switch-buffer)
|
||||||
:map ivy-minibuffer-map
|
:map ivy-minibuffer-map
|
||||||
("C-j" . ivy-call))
|
("C-j" . ivy-call))
|
||||||
:diminish ivy-mode
|
:diminish ivy-mode
|
||||||
:commands ivy-mode
|
:commands ivy-mode
|
||||||
:config
|
:config
|
||||||
(ivy-mode 1))
|
(ivy-mode 1))
|
||||||
|
|
||||||
(use-package magit
|
(use-package magit
|
||||||
:defer
|
:defer
|
||||||
:if (executable-find "git")
|
:if (executable-find "git")
|
||||||
:bind (("C-x g" . magit-status)
|
:bind (("C-x g" . magit-status)
|
||||||
("C-x G" . magit-dispatch-popup))
|
("C-x G" . magit-dispatch-popup))
|
||||||
:init
|
:init
|
||||||
(setq magit-completing-read-function 'ivy-completing-read))
|
(setq magit-completing-read-function 'ivy-completing-read))
|
||||||
|
|
||||||
(use-package projectile
|
(use-package projectile
|
||||||
:commands projectile-mode
|
:commands projectile-mode
|
||||||
:bind-keymap ("C-c p" . projectile-command-map)
|
:bind-keymap ("C-c p" . projectile-command-map)
|
||||||
:defer 5
|
:defer 5
|
||||||
:config
|
:config
|
||||||
(projectile-global-mode))
|
(projectile-global-mode))
|
||||||
'';
|
'';
|
||||||
|
|
||||||
myEmacs = emacs.pkgs.withPackages (
|
myEmacs = emacs.pkgs.withPackages (
|
||||||
epkgs:
|
epkgs:
|
||||||
(with epkgs.melpaStablePackages; [
|
(with epkgs.melpaStablePackages; [
|
||||||
(runCommand "default.el" { } ''
|
(runCommand "default.el" { } ''
|
||||||
mkdir -p $out/share/emacs/site-lisp
|
mkdir -p $out/share/emacs/site-lisp
|
||||||
cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
|
cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
|
||||||
'')
|
'')
|
||||||
company
|
company
|
||||||
counsel
|
counsel
|
||||||
flycheck
|
flycheck
|
||||||
ivy
|
ivy
|
||||||
magit
|
magit
|
||||||
projectile
|
projectile
|
||||||
use-package
|
use-package
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -300,42 +300,41 @@ This provides us with some useful documentation for using our packages. However
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
packageOverrides =
|
packageOverrides = pkgs: {
|
||||||
pkgs: with pkgs; rec {
|
myProfile = pkgs.writeText "my-profile" ''
|
||||||
myProfile = writeText "my-profile" ''
|
export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
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 MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man
|
'';
|
||||||
'';
|
myPackages = pkgs.buildEnv {
|
||||||
myPackages = pkgs.buildEnv {
|
name = "my-packages";
|
||||||
name = "my-packages";
|
paths = with pkgs; [
|
||||||
paths = [
|
(runCommand "profile" { } ''
|
||||||
(runCommand "profile" { } ''
|
mkdir -p $out/etc/profile.d
|
||||||
mkdir -p $out/etc/profile.d
|
cp ${myProfile} $out/etc/profile.d/my-profile.sh
|
||||||
cp ${myProfile} $out/etc/profile.d/my-profile.sh
|
'')
|
||||||
'')
|
aspell
|
||||||
aspell
|
bc
|
||||||
bc
|
coreutils
|
||||||
coreutils
|
ffmpeg
|
||||||
ffmpeg
|
man
|
||||||
man
|
nix
|
||||||
nix
|
emscripten
|
||||||
emscripten
|
jq
|
||||||
jq
|
nox
|
||||||
nox
|
silver-searcher
|
||||||
silver-searcher
|
];
|
||||||
];
|
pathsToLink = [
|
||||||
pathsToLink = [
|
"/share/man"
|
||||||
"/share/man"
|
"/share/doc"
|
||||||
"/share/doc"
|
"/bin"
|
||||||
"/bin"
|
"/etc"
|
||||||
"/etc"
|
];
|
||||||
];
|
extraOutputsToInstall = [
|
||||||
extraOutputsToInstall = [
|
"man"
|
||||||
"man"
|
"doc"
|
||||||
"doc"
|
];
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -360,54 +359,53 @@ Configuring GNU info is a little bit trickier than man pages. To work correctly,
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
packageOverrides =
|
packageOverrides = pkgs: {
|
||||||
pkgs: with pkgs; rec {
|
myProfile = pkgs.writeText "my-profile" ''
|
||||||
myProfile = writeText "my-profile" ''
|
export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
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 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
|
||||||
export INFOPATH=$HOME/.nix-profile/share/info:/nix/var/nix/profiles/default/share/info:/usr/share/info
|
'';
|
||||||
|
myPackages = pkgs.buildEnv {
|
||||||
|
name = "my-packages";
|
||||||
|
paths = with pkgs; [
|
||||||
|
(runCommand "profile" { } ''
|
||||||
|
mkdir -p $out/etc/profile.d
|
||||||
|
cp ${myProfile} $out/etc/profile.d/my-profile.sh
|
||||||
|
'')
|
||||||
|
aspell
|
||||||
|
bc
|
||||||
|
coreutils
|
||||||
|
ffmpeg
|
||||||
|
man
|
||||||
|
nix
|
||||||
|
emscripten
|
||||||
|
jq
|
||||||
|
nox
|
||||||
|
silver-searcher
|
||||||
|
texinfoInteractive
|
||||||
|
];
|
||||||
|
pathsToLink = [
|
||||||
|
"/share/man"
|
||||||
|
"/share/doc"
|
||||||
|
"/share/info"
|
||||||
|
"/bin"
|
||||||
|
"/etc"
|
||||||
|
];
|
||||||
|
extraOutputsToInstall = [
|
||||||
|
"man"
|
||||||
|
"doc"
|
||||||
|
"info"
|
||||||
|
];
|
||||||
|
postBuild = ''
|
||||||
|
if [ -x $out/bin/install-info -a -w $out/share/info ]; then
|
||||||
|
shopt -s nullglob
|
||||||
|
for i in $out/share/info/*.info $out/share/info/*.info.gz; do
|
||||||
|
$out/bin/install-info $i $out/share/info/dir
|
||||||
|
done
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
myPackages = pkgs.buildEnv {
|
|
||||||
name = "my-packages";
|
|
||||||
paths = [
|
|
||||||
(runCommand "profile" { } ''
|
|
||||||
mkdir -p $out/etc/profile.d
|
|
||||||
cp ${myProfile} $out/etc/profile.d/my-profile.sh
|
|
||||||
'')
|
|
||||||
aspell
|
|
||||||
bc
|
|
||||||
coreutils
|
|
||||||
ffmpeg
|
|
||||||
man
|
|
||||||
nix
|
|
||||||
emscripten
|
|
||||||
jq
|
|
||||||
nox
|
|
||||||
silver-searcher
|
|
||||||
texinfoInteractive
|
|
||||||
];
|
|
||||||
pathsToLink = [
|
|
||||||
"/share/man"
|
|
||||||
"/share/doc"
|
|
||||||
"/share/info"
|
|
||||||
"/bin"
|
|
||||||
"/etc"
|
|
||||||
];
|
|
||||||
extraOutputsToInstall = [
|
|
||||||
"man"
|
|
||||||
"doc"
|
|
||||||
"info"
|
|
||||||
];
|
|
||||||
postBuild = ''
|
|
||||||
if [ -x $out/bin/install-info -a -w $out/share/info ]; then
|
|
||||||
shopt -s nullglob
|
|
||||||
for i in $out/share/info/*.info $out/share/info/*.info.gz; do
|
|
||||||
$out/bin/install-info $i $out/share/info/dir
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue