Fix markdown

This commit is contained in:
Eelco Dolstra 2013-09-09 18:10:57 +02:00
parent ae50a5e7be
commit 853d2e0aa4

112
README.md
View file

@ -18,87 +18,87 @@ Example
Here is a typical `nix-repl` session: Here is a typical `nix-repl` session:
$ nix-repl $ nix-repl
Welcome to Nix version 1.6pre3215_2c1ecf8. Type :? for help. Welcome to Nix version 1.6pre3215_2c1ecf8. Type :? for help.
nix-repl> 3 * 4 nix-repl> 3 * 4
12 12
nix-repl> :l <nixpkgs> nix-repl> :l <nixpkgs>
Added 3337 variables. Added 3337 variables.
nix-repl> lib.range 1 5 nix-repl> lib.range 1 5
[ 1 2 3 4 5 ] [ 1 2 3 4 5 ]
nix-repl> :a lib nix-repl> :a lib
Added 299 variables. Added 299 variables.
nix-repl> range 1 5 nix-repl> range 1 5
[ 1 2 3 4 5 ] [ 1 2 3 4 5 ]
nix-repl> xs = range 1 5 nix-repl> xs = range 1 5
nix-repl> map (x: x * x) xs nix-repl> map (x: x * x) xs
[ 1 4 9 16 25 ] [ 1 4 9 16 25 ]
nix-repl> :l <nixos> nix-repl> :l <nixos>
Added 7 variables. Added 7 variables.
nix-repl> config.services.dhcpd nix-repl> config.services.dhcpd
{ configFile = null; enable = false; extraConfig = ""; interfaces = [ ... ]; machines = [ ... ]; } { configFile = null; enable = false; extraConfig = ""; interfaces = [ ... ]; machines = [ ... ]; }
nix-repl> :p config.services.dhcpd nix-repl> :p config.services.dhcpd
{ configFile = null; enable = false; extraConfig = ""; interfaces = [ "eth0" ]; machines = [ ]; } { configFile = null; enable = false; extraConfig = ""; interfaces = [ "eth0" ]; machines = [ ]; }
nix-repl> config.fileSystems nix-repl> config.fileSystems
{ "/" = { ... }; "/boot" = { ... }; } { "/" = { ... }; "/boot" = { ... }; }
nix-repl> mapAttrsToList (n: v: v.device) config.fileSystems nix-repl> mapAttrsToList (n: v: v.device) config.fileSystems
[ "/dev/disk/by-label/nixos" "/dev/disk/by-label/boot" ] [ "/dev/disk/by-label/nixos" "/dev/disk/by-label/boot" ]
nix-repl> :b libjson nix-repl> :b libjson
these derivations will be built: these derivations will be built:
/nix/store/h910xqb36pysxcxkayb1zkr1zcvvk1zy-libjson_7.6.1.zip.drv /nix/store/h910xqb36pysxcxkayb1zkr1zcvvk1zy-libjson_7.6.1.zip.drv
/nix/store/iv0rdx08di0fg704zyxklkvdz6i96lm8-libjson-7.6.1.drv /nix/store/iv0rdx08di0fg704zyxklkvdz6i96lm8-libjson-7.6.1.drv
... ...
this derivation produced the following outputs: this derivation produced the following outputs:
out -> /nix/store/ys6bvgfia81rjwqxjlgkwnx6jhsml8h9-libjson-7.6.1 out -> /nix/store/ys6bvgfia81rjwqxjlgkwnx6jhsml8h9-libjson-7.6.1
nix-repl> :t makeFontsConf nix-repl> :t makeFontsConf
a function a function
nix-repl> :b makeFontsConf { fontDirectories = [ "${freefont_ttf}/share/fonts/truetype" ]; } nix-repl> :b makeFontsConf { fontDirectories = [ "${freefont_ttf}/share/fonts/truetype" ]; }
... ...
this derivation produced the following outputs: this derivation produced the following outputs:
out -> /nix/store/jkw848xj0gkbhmvxi0hwpnhzn2716v3c-fonts.conf out -> /nix/store/jkw848xj0gkbhmvxi0hwpnhzn2716v3c-fonts.conf
nix-repl> :s pan nix-repl> :s pan
# Builds dependencies of the pan derivation, then starts a shell # Builds dependencies of the pan derivation, then starts a shell
# in which the environment variables of the derivation are set # in which the environment variables of the derivation are set
[nix-shell:/tmp/nix-repl]$ echo $src [nix-shell:/tmp/nix-repl]$ echo $src
/nix/store/0ibx15r02nnkwiclmfbpzrzjm2y204fh-pan-0.139.tar.bz2 /nix/store/0ibx15r02nnkwiclmfbpzrzjm2y204fh-pan-0.139.tar.bz2
[nix-shell:/tmp/nix-repl]$ exit [nix-shell:/tmp/nix-repl]$ exit
nix-repl> nix-repl>
Tab completion works on variables in scope and on attribute sets. For Tab completion works on variables in scope and on attribute sets. For
example: example:
$ nix-repl '<nixpkgs>' '<nixos>' $ nix-repl '<nixpkgs>' '<nixos>'
Welcome to Nix version 1.6pre3215_2c1ecf8. Type :? for help. Welcome to Nix version 1.6pre3215_2c1ecf8. Type :? for help.
nix-repl> thunder<TAB> => thunderbird nix-repl> thunder<TAB> => thunderbird
nix-repl> <TAB> nix-repl> <TAB>
Display all 3634 possibilities? (y or n) Display all 3634 possibilities? (y or n)
nix-repl> lib<TAB> nix-repl> lib<TAB>
Display all 291 possibilities? (y or n) Display all 291 possibilities? (y or n)
nix-repl> xorg.libX<TAB> nix-repl> xorg.libX<TAB>
xorg.libXdamage xorg.libXdmcp xorg.libXdamage xorg.libXdmcp
nix-repl> config.networking.use<TAB> nix-repl> config.networking.use<TAB>
config.networking.useDHCP config.networking.usePredictableInterfaceNames config.networking.useDHCP config.networking.usePredictableInterfaceNames