about summary refs log tree commit diff
path: root/nixpkgs/doc
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-07-14 15:50:11 +0000
committerAlyssa Ross <hi@alyssa.is>2019-08-14 00:01:17 +0000
commit69a15dd2dc85051ba1436613805f9286850e0596 (patch)
treed53cec2bb5b8d07df1d1919b212cb2deb3628cd6 /nixpkgs/doc
parent6941276da135c3eb3b50e0be33d92e7d01ccba9a (diff)
parentbeff2f8d75ef2c65017fb25e251337c6bb2e950d (diff)
downloadnixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar
nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.gz
nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.bz2
nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.lz
nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.xz
nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.zst
nixlib-69a15dd2dc85051ba1436613805f9286850e0596.zip
Merge commit 'beff2f8d75ef2c65017fb25e251337c6bb2e950d'
v#	modified:   nixpkgs/pkgs/tools/networking/dhcpcd/default.nix
Diffstat (limited to 'nixpkgs/doc')
-rw-r--r--nixpkgs/doc/Makefile53
-rw-r--r--nixpkgs/doc/default.nix27
-rw-r--r--nixpkgs/doc/doc-support/default.nix45
-rw-r--r--nixpkgs/doc/doc-support/lib-function-docs.nix (renamed from nixpkgs/doc/lib-function-docs.nix)2
-rw-r--r--nixpkgs/doc/doc-support/lib-function-locations.nix (renamed from nixpkgs/doc/lib-function-locations.nix)0
-rw-r--r--nixpkgs/doc/doc-support/parameters.xml14
-rw-r--r--nixpkgs/doc/functions.xml1
-rw-r--r--nixpkgs/doc/functions/snaptools.xml74
-rw-r--r--nixpkgs/doc/languages-frameworks/idris.section.md15
-rw-r--r--nixpkgs/doc/languages-frameworks/python.section.md2
-rw-r--r--nixpkgs/doc/package-notes.xml12
11 files changed, 189 insertions, 56 deletions
diff --git a/nixpkgs/doc/Makefile b/nixpkgs/doc/Makefile
index 5badfe4138d4..e7ca31b20d71 100644
--- a/nixpkgs/doc/Makefile
+++ b/nixpkgs/doc/Makefile
@@ -8,10 +8,10 @@ debug:
 	nix-shell --run "xmloscopy --docbook5 ./manual.xml ./manual-full.xml"
 
 .PHONY: format
-format:
+format: doc-support/result
 	find . -iname '*.xml' -type f | while read f; do \
 		echo $$f ;\
-		xmlformat --config-file "$$XMLFORMAT_CONFIG" -i $$f ;\
+		xmlformat --config-file "doc-support/result/xmlformat.conf" -i $$f ;\
 	done
 
 .PHONY: fix-misc-xml
@@ -21,19 +21,19 @@ fix-misc-xml:
 
 .PHONY: clean
 clean:
-	rm -f ${MD_TARGETS} .version manual-full.xml functions/library/locations.xml functions/library/generated
+	rm -f ${MD_TARGETS} doc-support/result .version manual-full.xml functions/library/locations.xml functions/library/generated
 	rm -rf ./out/ ./highlightjs
 
 .PHONY: validate
-validate: manual-full.xml
-	jing "$$RNG" manual-full.xml
+validate: manual-full.xml doc-support/result
+	jing doc-support/result/docbook.rng manual-full.xml
 
-out/html/index.html: manual-full.xml style.css highlightjs
+out/html/index.html: doc-support/result manual-full.xml style.css highlightjs
 	mkdir -p out/html
-	xsltproc ${xsltFlags} \
+	xsltproc \
 		--nonet --xinclude \
 		--output $@ \
-		"$$XSL/docbook/xhtml/docbook.xsl" \
+		doc-support/result/xhtml.xsl \
 		./manual-full.xml
 
 	mkdir -p out/html/highlightjs/
@@ -43,49 +43,48 @@ out/html/index.html: manual-full.xml style.css highlightjs
 	cp ./style.css out/html/style.css
 
 	mkdir -p out/html/images/callouts
-	cp "$$XSL/docbook/images/callouts/"*.svg out/html/images/callouts/
+	cp doc-support/result/xsl/docbook/images/callouts/*.svg out/html/images/callouts/
 	chmod u+w -R out/html/
 
 out/epub/manual.epub: manual-full.xml
 	mkdir -p out/epub/scratch
-	xsltproc ${xsltFlags} --nonet \
+	xsltproc --nonet \
 		--output out/epub/scratch/ \
-		"$$XSL/docbook/epub/docbook.xsl" \
+		doc-support/result/epub.xsl \
 		./manual-full.xml
 
 	cp ./overrides.css out/epub/scratch/OEBPS
 	cp ./style.css out/epub/scratch/OEBPS
 	mkdir -p out/epub/scratch/OEBPS/images/callouts/
-	cp "$$XSL/docbook/images/callouts/"*.svg out/epub/scratch/OEBPS/images/callouts/
+	cp doc-support/result/xsl/docbook/images/callouts/*.svg out/epub/scratch/OEBPS/images/callouts/
 	echo "application/epub+zip" > mimetype
 	zip -0Xq "out/epub/manual.epub" mimetype
 	rm mimetype
 	cd "out/epub/scratch/" && zip -Xr9D "../manual.epub" *
 	rm -rf "out/epub/scratch/"
 
-highlightjs:
+highlightjs: doc-support/result
 	mkdir -p highlightjs
-	cp -r "$$HIGHLIGHTJS/highlight.pack.js" highlightjs/
-	cp -r "$$HIGHLIGHTJS/LICENSE" highlightjs/
-	cp -r "$$HIGHLIGHTJS/mono-blue.css" highlightjs/
-	cp -r "$$HIGHLIGHTJS/loader.js" highlightjs/
+	cp -r doc-support/result/highlightjs/highlight.pack.js highlightjs/
+	cp -r doc-support/result/highlightjs/LICENSE highlightjs/
+	cp -r doc-support/result/highlightjs/mono-blue.css highlightjs/
+	cp -r doc-support/result/highlightjs/loader.js highlightjs/
 
 
 manual-full.xml: ${MD_TARGETS} .version functions/library/locations.xml functions/library/generated *.xml **/*.xml **/**/*.xml
 	xmllint --nonet --xinclude --noxincludenode manual.xml --output manual-full.xml
 
-.version:
-	nix-instantiate --eval \
-		-E '(import ../lib).version' > .version
+.version: doc-support/result
+	ln -rfs ./doc-support/result/version .version
 
-functions/library/locations.xml:
-	nix-build ./lib-function-locations.nix \
-		--out-link $@
+doc-support/result: doc-support/default.nix
+	(cd doc-support; nix-build)
 
-functions/library/generated: functions/library/locations.xml
-	nix-build ./lib-function-docs.nix \
-		--arg locationsXml $< \
-		--out-link $@
+functions/library/locations.xml: doc-support/result
+	ln -rfs ./doc-support/result/function-locations.xml functions/library/locations.xml
+
+functions/library/generated: doc-support/result
+	ln -rfs ./doc-support/result/function-docs functions/library/generated
 
 %.section.xml: %.section.md
 	pandoc $^ -w docbook+smart \
diff --git a/nixpkgs/doc/default.nix b/nixpkgs/doc/default.nix
index 7ceaec28af38..d9051167dee5 100644
--- a/nixpkgs/doc/default.nix
+++ b/nixpkgs/doc/default.nix
@@ -1,8 +1,7 @@
 { pkgs ? (import ./.. { }), nixpkgs ? { }}:
 let
   lib = pkgs.lib;
-  locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
-  functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
+  doc-support = import ./doc-support { inherit pkgs nixpkgs; };
 in pkgs.stdenv.mkDerivation {
   name = "nixpkgs-manual";
 
@@ -10,30 +9,8 @@ in pkgs.stdenv.mkDerivation {
 
   src = ./.;
 
-  # Hacking on these variables? Make sure to close and open
-  # nix-shell between each test, maybe even:
-  # $ nix-shell --run "make clean all"
-  # otherwise they won't reapply :)
-  HIGHLIGHTJS = pkgs.documentation-highlighter;
-  XSL = "${pkgs.docbook_xsl_ns}/xml/xsl";
-  RNG = "${pkgs.docbook5}/xml/rng/docbook/docbook.rng";
-  XMLFORMAT_CONFIG = ../nixos/doc/xmlformat.conf;
-  xsltFlags = lib.concatStringsSep " " [
-    "--param section.autolabel 1"
-    "--param section.label.includes.component.label 1"
-    "--stringparam html.stylesheet 'style.css overrides.css highlightjs/mono-blue.css'"
-    "--stringparam html.script './highlightjs/highlight.pack.js ./highlightjs/loader.js'"
-    "--param xref.with.number.and.title 1"
-    "--param toc.section.depth 3"
-    "--stringparam admon.style ''"
-    "--stringparam callout.graphics.extension .svg"
-  ];
-
   postPatch = ''
-    rm -rf ./functions/library/locations.xml
-    ln -s ${locationsXml} ./functions/library/locations.xml
-    ln -s ${functionDocs} ./functions/library/generated
-    echo ${lib.version} > .version
+    ln -s ${doc-support} ./doc-support/result
   '';
 
   installPhase = ''
diff --git a/nixpkgs/doc/doc-support/default.nix b/nixpkgs/doc/doc-support/default.nix
new file mode 100644
index 000000000000..53990b677196
--- /dev/null
+++ b/nixpkgs/doc/doc-support/default.nix
@@ -0,0 +1,45 @@
+{ pkgs ? (import ../.. {}), nixpkgs ? { }}:
+let
+  locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
+  functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
+  version = pkgs.lib.version;
+
+  epub-xsl = pkgs.writeText "epub.xsl" ''
+    <?xml version='1.0'?>
+    <xsl:stylesheet
+      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+      version="1.0">
+      <xsl:import href="${pkgs.docbook_xsl_ns}/xml/xsl/docbook/epub/docbook.xsl" />
+      <xsl:import href="${./parameters.xml}"/>
+    </xsl:stylesheet>
+  '';
+
+  xhtml-xsl = pkgs.writeText "xhtml.xsl" ''
+    <?xml version='1.0'?>
+    <xsl:stylesheet
+      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+      version="1.0">
+      <xsl:import href="${pkgs.docbook_xsl_ns}/xml/xsl/docbook/xhtml/docbook.xsl" />
+      <xsl:import href="${./parameters.xml}"/>
+    </xsl:stylesheet>
+  '';
+in pkgs.runCommand "doc-support" {}
+''
+  mkdir result
+  (
+    cd result
+    ln -s ${locationsXml} ./function-locations.xml
+    ln -s ${functionDocs} ./function-docs
+
+    ln -s ${pkgs.docbook5}/xml/rng/docbook/docbook.rng ./docbook.rng
+    ln -s ${pkgs.docbook_xsl_ns}/xml/xsl ./xsl
+    ln -s ${epub-xsl} ./epub.xsl
+    ln -s ${xhtml-xsl} ./xhtml.xsl
+
+    ln -s ${../../nixos/doc/xmlformat.conf} ./xmlformat.conf
+    ln -s ${pkgs.documentation-highlighter} ./highlightjs
+
+    echo -n "${version}" > ./version
+  )
+  mv result $out
+''
diff --git a/nixpkgs/doc/lib-function-docs.nix b/nixpkgs/doc/doc-support/lib-function-docs.nix
index 421f848d25ab..5199b949e7b8 100644
--- a/nixpkgs/doc/lib-function-docs.nix
+++ b/nixpkgs/doc/doc-support/lib-function-docs.nix
@@ -6,7 +6,7 @@
 
 with pkgs; stdenv.mkDerivation {
   name = "nixpkgs-lib-docs";
-  src = ./../lib;
+  src = ./../../lib;
 
   buildInputs = [ nixdoc ];
   installPhase = ''
diff --git a/nixpkgs/doc/lib-function-locations.nix b/nixpkgs/doc/doc-support/lib-function-locations.nix
index ae7036e46264..ae7036e46264 100644
--- a/nixpkgs/doc/lib-function-locations.nix
+++ b/nixpkgs/doc/doc-support/lib-function-locations.nix
diff --git a/nixpkgs/doc/doc-support/parameters.xml b/nixpkgs/doc/doc-support/parameters.xml
new file mode 100644
index 000000000000..bc13e2b70dec
--- /dev/null
+++ b/nixpkgs/doc/doc-support/parameters.xml
@@ -0,0 +1,14 @@
+<?xml version='1.0'?>
+<xsl:stylesheet
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    version="1.0">
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+ <xsl:param name="html.stylesheet" select="'style.css overrides.css highlightjs/mono-blue.css'" />
+ <xsl:param name="html.script" select="'./highlightjs/highlight.pack.js ./highlightjs/loader.js'" />
+ <xsl:param name="xref.with.number.and.title" select="1" />
+ <xsl:param name="use.id.as.filename" select="1" />
+ <xsl:param name="toc.section.depth" select="3" />
+ <xsl:param name="admon.style" select="''" />
+ <xsl:param name="callout.graphics.extension" select="'.svg'" />
+</xsl:stylesheet>
diff --git a/nixpkgs/doc/functions.xml b/nixpkgs/doc/functions.xml
index 1f2d00b9e1af..3b60f46d81da 100644
--- a/nixpkgs/doc/functions.xml
+++ b/nixpkgs/doc/functions.xml
@@ -16,6 +16,7 @@
  <xi:include href="functions/fhs-environments.xml" />
  <xi:include href="functions/shell.xml" />
  <xi:include href="functions/dockertools.xml" />
+ <xi:include href="functions/snaptools.xml" />
  <xi:include href="functions/appimagetools.xml" />
  <xi:include href="functions/prefer-remote-fetch.xml" />
  <xi:include href="functions/nix-gitignore.xml" />
diff --git a/nixpkgs/doc/functions/snaptools.xml b/nixpkgs/doc/functions/snaptools.xml
new file mode 100644
index 000000000000..a951c36730d3
--- /dev/null
+++ b/nixpkgs/doc/functions/snaptools.xml
@@ -0,0 +1,74 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         xml:id="sec-pkgs-snapTools">
+ <title>pkgs.snapTools</title>
+
+ <para>
+  <varname>pkgs.snapTools</varname> is a set of functions for creating
+  Snapcraft images. Snap and Snapcraft is not used to perform these operations.
+ </para>
+
+ <section xml:id="ssec-pkgs-snapTools-makeSnap-signature">
+  <title>The makeSnap Function</title>
+
+  <para>
+   <function>makeSnap</function> takes a single named argument,
+   <parameter>meta</parameter>. This argument mirrors
+   <link xlink:href="https://docs.snapcraft.io/snap-format">the upstream
+   <filename>snap.yaml</filename> format</link> exactly.
+  </para>
+
+  <para>
+   The <parameter>base</parameter> should not be be specified, as
+   <function>makeSnap</function> will force set it.
+  </para>
+
+  <para>
+   Currently, <function>makeSnap</function> does not support creating GUI
+   stubs.
+  </para>
+ </section>
+
+ <section xml:id="ssec-pkgs-snapTools-build-a-snap-hello">
+  <title>Build a Hello World Snap</title>
+
+  <example xml:id="ex-snapTools-buildSnap-hello">
+   <title>Making a Hello World Snap</title>
+   <para>
+    The following expression packages GNU Hello as a Snapcraft snap.
+   </para>
+<programlisting><xi:include href="../../pkgs/build-support/snap/example-hello.nix" parse="text" /></programlisting>
+   <para>
+    <command>nix-build</command> this expression and install it with
+    <command>snap install ./result --dangerous</command>.
+    <command>hello</command> will now be the Snapcraft version of the package.
+   </para>
+  </example>
+ </section>
+
+ <section xml:id="ssec-pkgs-snapTools-build-a-snap-firefox">
+  <title>Build a Hello World Snap</title>
+
+  <example xml:id="ex-snapTools-buildSnap-firefox">
+   <title>Making a Graphical Snap</title>
+   <para>
+    Graphical programs require many more integrations with the host. This
+    example uses Firefox as an example, because it is one of the most
+    complicated programs we could package.
+   </para>
+<programlisting><xi:include href="../../pkgs/build-support/snap/example-firefox.nix" parse="text" /></programlisting>
+   <para>
+    <command>nix-build</command> this expression and install it with
+    <command>snap install ./result --dangerous</command>.
+    <command>nix-example-firefox</command> will now be the Snapcraft version of
+    the Firefox package.
+   </para>
+   <para>
+    The specific meaning behind plugs can be looked up in the
+    <link xlink:href="https://docs.snapcraft.io/supported-interfaces">Snapcraft
+    interface documentation</link>.
+   </para>
+  </example>
+ </section>
+</section>
diff --git a/nixpkgs/doc/languages-frameworks/idris.section.md b/nixpkgs/doc/languages-frameworks/idris.section.md
index 50979d76d98b..3025172b5c98 100644
--- a/nixpkgs/doc/languages-frameworks/idris.section.md
+++ b/nixpkgs/doc/languages-frameworks/idris.section.md
@@ -11,10 +11,21 @@ $ # On non-NixOS
 $ nix-env -i nixpkgs.idris
 ```
 
-This however only provides the `prelude` and `base` libraries. To install additional libraries:
+This however only provides the `prelude` and `base` libraries. To install idris with additional libraries, you can use the `idrisPackages.with-packages` function, e.g. in an overlay in `~/.config/nixpkgs/overlays/my-idris.nix`:
 
+```nix
+self: super: {
+  myIdris = with self.idrisPackages; with-packages [ contrib pruviloj ];
+}
 ```
-$ nix-env -iE 'pkgs: pkgs.idrisPackages.with-packages (with pkgs.idrisPackages; [ contrib pruviloj ])'
+
+And then:
+
+```
+$ # On NixOS
+$ nix-env -iA nixos.myIdris
+$ # On non-NixOS
+$ nix-env -iA nixpkgs.myIdris
 ```
 
 To see all available Idris packages:
diff --git a/nixpkgs/doc/languages-frameworks/python.section.md b/nixpkgs/doc/languages-frameworks/python.section.md
index 1dc111114bdb..77b387dd3025 100644
--- a/nixpkgs/doc/languages-frameworks/python.section.md
+++ b/nixpkgs/doc/languages-frameworks/python.section.md
@@ -636,7 +636,7 @@ with import <nixpkgs> {};
         };
       });
     };
-  in pkgs.python3.override {inherit packageOverrides;};
+  in pkgs.python3.override {inherit packageOverrides; self = python;};
 
 in python.withPackages(ps: [ps.blaze])).env
 ```
diff --git a/nixpkgs/doc/package-notes.xml b/nixpkgs/doc/package-notes.xml
index 2b7b4b9bc51b..d2c660e22a9b 100644
--- a/nixpkgs/doc/package-notes.xml
+++ b/nixpkgs/doc/package-notes.xml
@@ -325,6 +325,18 @@ packageOverrides = pkgs: {
    elm2nix</link>.
   </para>
  </section>
+ <section xml:id="sec-kakoune">
+  <title>Kakoune</title>
+
+  <para>
+   Kakoune can be built to autoload plugins:
+<programlisting>(kakoune.override {
+  configure = {
+    plugins = with pkgs.kakounePlugins; [ parinfer-rust ];
+  };
+})</programlisting>
+  </para>
+ </section>
  <section xml:id="sec-shell-helpers">
   <title>Interactive shell helpers</title>