1
0
Fork 0
mirror of https://github.com/NixOS/nix-pills synced 2024-09-19 04:00:13 -04:00
Find a file
Maximilian Bosch bcea6b35ed
Update documentation after Nix 2.0 switch
In #89 it has been reported that the third step can't be done as
`nix-repl` doesn't evaluate anymore on 18.09 and unstable as in both
cases an evaluation error will be thrown.

First of all this may confuse new users who want to learn Nix, but don't
know the ecosystem sufficiently to understand why the install failed.

As recent NixOS versions (unstable and 18.09) use Nix 2.0 by default and
unstable doesn't evaluate with Nix 1.x anymore it should be a safe thing
to do now.

This patch covers two aspects:

* Using Nix 2.0: I replayed the installation steps with `nix-env` to
  ensure that the steps and explanations provided in the first three
  chapters are still valid.

* Replacing `nix-repl` references: most of the cases it was sufficient
  to replace `nix-repl` with the newly introduced command `nix repl`.
  In chapter three `nix-repl` was used to demonstrate the installation
  of a package with `nix-env`. I decided to use `nix-index` as demo
  package as I figured this tool to be extremely helpful to locate
  packages by output files.

  The explanation that Nix is not only a tool for package/derivation
  management, but a functional language as well was moved to chapter
  four where the basics of the language were actually covered.

This change is just a first step towards an updated series, in the
future we may want to use even more Nix 2.0 features (such as
`nix-build` vs. `nix build` with `nix log`).

Fixes #89
Possibly supersedes #71
2018-12-08 00:10:40 +01:00
pills Update documentation after Nix 2.0 switch 2018-12-08 00:10:40 +01:00
.editorconfig initialize an editorconfig 2017-08-13 09:54:34 -04:00
.gitignore Travis support 2017-09-24 17:44:55 -04:00
.travis.yml Travis support 2017-09-24 17:44:55 -04:00
book.xml Pill 20: Init according 19's teaser 2018-02-23 19:04:13 -05:00
default.nix Allow *.nix just within subdirectories 2018-02-23 19:04:13 -05:00
LICENSE License it CC-BY-SA-4.0 per #36 where every existing contributor agreed 2017-12-19 07:04:41 -05:00
README.md Update README.md 2018-04-11 18:46:42 -04:00
release.nix Add proper versioning 2017-08-19 10:56:31 -04:00
style.css Nix on darwin note: use a <note> element 2018-08-20 21:46:52 -04:00

Nix Pills

https://nixos.org/nixos/nix-pills/

Development

When starting a new Pill, comment on the tracking issue which one you're doing. If you need help, ask there. If you make progress but don't finish in one go, make a PR anyway! I'm trying to not edit things as I go, in order to not get bogged down.

How I've built and tested:

nix-build release.nix && firefox result/share/doc/nix-pills/index.html

Emacs config for a nice docbook experience:

let
 pkgs = import <nixpkgs> {};
 inherit (pkgs) emacsPackagesNg docbook5 writeText;

 schemas = writeText "schemas.xml" ''
   <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
     <documentElement localName="section" typeId="DocBook"/>
     <documentElement localName="chapter" typeId="DocBook"/>
     <documentElement localName="article" typeId="DocBook"/>
     <documentElement localName="book" typeId="DocBook"/>
     <typeId id="DocBook" uri="${docbook5}/xml/rng/docbook/docbookxi.rnc" />
   </locatingRules>
 '';

in emacsPackagesNg.emacsWithPackages (epkgs: [
 (emacsPackagesNg.trivialBuild {
   pname = "nix-docbook-mode";
   version = "1970-01-01";
   src = writeText "default.el" ''
     (eval-after-load 'rng-loc
       '(add-to-list 'rng-schema-locating-files "${schemas}"))
     (global-set-key (kbd "<C-return>") 'nxml-complete)
   '';
 })
])

Then you can use the keys:

  • C-c C-b to finish & close a tag
  • C-c C-f to close a tag
  • C-return to auto-complete a tag or attribute.