about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2017-12-23 07:19:45 -0500
committerGitHub <noreply@github.com>2017-12-23 07:19:45 -0500
commitb5a61f2c599ac665e3c3129258ea8671cb5760af (patch)
treeac16b806bfd54846edba76b0f21ff5d929570ff4 /nixos
parentd3a0eb320a5e28a19b82f813e001fa832d7ef1d3 (diff)
downloadnixlib-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar
nixlib-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.gz
nixlib-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.bz2
nixlib-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.lz
nixlib-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.xz
nixlib-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.zst
nixlib-b5a61f2c599ac665e3c3129258ea8671cb5760af.zip
Revert "nixos: doc: implement related packages in the manual"
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/default.nix34
-rw-r--r--nixos/doc/manual/options-to-docbook.xsl9
-rw-r--r--nixos/modules/programs/tmux.nix7
-rw-r--r--nixos/modules/rename.nix4
-rw-r--r--nixos/modules/virtualisation/xen-dom0.nix25
5 files changed, 19 insertions, 60 deletions
diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix
index 95363c2458f5..9bc83be66104 100644
--- a/nixos/doc/manual/default.nix
+++ b/nixos/doc/manual/default.nix
@@ -15,27 +15,13 @@ let
     else if builtins.isFunction x then "<function>"
     else x;
 
-  # Generate DocBook documentation for a list of packages
-  genRelatedPackages = packages:
-    let
-      unpack = p: if lib.isString p then { name = p; } else p;
-      describe = { name, package ? pkgs.${name}, comment ? "" }:
-          "<listitem>"
-        + "<para><option>pkgs.${name}</option> (${package.name}): ${package.meta.description or "???"}.</para>"
-        + lib.optionalString (comment != "") "\n<para>${comment}</para>"
-        # Lots of `longDescription's break DocBook, so we just wrap them into <programlisting>
-        + lib.optionalString (package.meta ? longDescription) "\n<programlisting>${package.meta.longDescription}</programlisting>"
-        + "</listitem>";
-    in "<itemizedlist>${lib.concatStringsSep "\n" (map (p: describe (unpack p)) packages)}</itemizedlist>";
-
+  # Clean up declaration sites to not refer to the NixOS source tree.
   optionsList' = lib.flip map optionsList (opt: opt // {
-    # Clean up declaration sites to not refer to the NixOS source tree.
     declarations = map stripAnyPrefixes opt.declarations;
   }
   // lib.optionalAttrs (opt ? example) { example = substFunction opt.example; }
   // lib.optionalAttrs (opt ? default) { default = substFunction opt.default; }
-  // lib.optionalAttrs (opt ? type) { type = substFunction opt.type; }
-  // lib.optionalAttrs (opt ? relatedPackages) { relatedPackages = genRelatedPackages opt.relatedPackages; });
+  // lib.optionalAttrs (opt ? type) { type = substFunction opt.type; });
 
   # We need to strip references to /nix/store/* from options,
   # including any `extraSources` if some modules came from elsewhere,
@@ -46,22 +32,8 @@ let
   prefixesToStrip = map (p: "${toString p}/") ([ ../../.. ] ++ extraSources);
   stripAnyPrefixes = lib.flip (lib.fold lib.removePrefix) prefixesToStrip;
 
-  # Custom "less" that pushes up all the things ending in ".enable*"
-  # and ".package"
-  optionListLess = a: b:
-    let
-      splt = lib.splitString ".";
-      ise = lib.hasPrefix "enable";
-      isp = lib.hasPrefix "package";
-      cmp = lib.splitByAndCompare ise lib.compare
-                                 (lib.splitByAndCompare isp lib.compare lib.compare);
-    in lib.compareLists cmp (splt a) (splt b) < 0;
-
-  # Customly sort option list for the man page.
-  optionsList'' = lib.sort (a: b: optionListLess a.name b.name) optionsList';
-
   # Convert the list of options into an XML file.
-  optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList'');
+  optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList');
 
   optionsDocBook = runCommand "options-db.xml" {} ''
     optionsXML=${optionsXML}
diff --git a/nixos/doc/manual/options-to-docbook.xsl b/nixos/doc/manual/options-to-docbook.xsl
index 7b45b233ab2a..5387546b5982 100644
--- a/nixos/doc/manual/options-to-docbook.xsl
+++ b/nixos/doc/manual/options-to-docbook.xsl
@@ -70,15 +70,6 @@
                 </para>
               </xsl:if>
 
-              <xsl:if test="attr[@name = 'relatedPackages']">
-                <para>
-                  <emphasis>Related packages:</emphasis>
-                  <xsl:text> </xsl:text>
-                  <xsl:value-of disable-output-escaping="yes"
-                                select="attr[@name = 'relatedPackages']/string/@value" />
-                </para>
-              </xsl:if>
-
               <xsl:if test="count(attr[@name = 'declarations']/list/*) != 0">
                 <para>
                   <emphasis>Declared by:</emphasis>
diff --git a/nixos/modules/programs/tmux.nix b/nixos/modules/programs/tmux.nix
index 967001845f02..ed1d88a420a2 100644
--- a/nixos/modules/programs/tmux.nix
+++ b/nixos/modules/programs/tmux.nix
@@ -61,12 +61,7 @@ in {
   options = {
     programs.tmux = {
 
-      enable = mkOption {
-        type = types.bool;
-        default = false;
-        description = "Whenever to configure <command>tmux</command> system-wide.";
-        relatedPackages = [ "tmux" ];
-      };
+      enable = mkEnableOption "<command>tmux</command> - a <command>screen</command> replacement.";
 
       aggressiveResize = mkOption {
         default = false;
diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix
index 00d55fc28cbb..5e207a9509e2 100644
--- a/nixos/modules/rename.nix
+++ b/nixos/modules/rename.nix
@@ -207,7 +207,6 @@ with lib;
       "Set the option `services.xserver.displayManager.sddm.package' instead.")
     (mkRemovedOptionModule [ "fonts" "fontconfig" "forceAutohint" ] "")
     (mkRemovedOptionModule [ "fonts" "fontconfig" "renderMonoTTFAsBitmap" ] "")
-    (mkRemovedOptionModule [ "virtualisation" "xen" "qemu" ] "You don't need this option anymore, it will work without it.")
 
     # ZSH
     (mkRenamedOptionModule [ "programs" "zsh" "enableSyntaxHighlighting" ] [ "programs" "zsh" "syntaxHighlighting" "enable" ])
@@ -218,8 +217,5 @@ with lib;
     (mkRenamedOptionModule [ "programs" "zsh" "oh-my-zsh" "theme" ] [ "programs" "zsh" "ohMyZsh" "theme" ])
     (mkRenamedOptionModule [ "programs" "zsh" "oh-my-zsh" "custom" ] [ "programs" "zsh" "ohMyZsh" "custom" ])
     (mkRenamedOptionModule [ "programs" "zsh" "oh-my-zsh" "plugins" ] [ "programs" "zsh" "ohMyZsh" "plugins" ])
-
-    # Xen
-    (mkRenamedOptionModule [ "virtualisation" "xen" "qemu-package" ] [ "virtualisation" "xen" "package-qemu" ])
   ];
 }
diff --git a/nixos/modules/virtualisation/xen-dom0.nix b/nixos/modules/virtualisation/xen-dom0.nix
index afc5a42f8b4e..c7656bc309c0 100644
--- a/nixos/modules/virtualisation/xen-dom0.nix
+++ b/nixos/modules/virtualisation/xen-dom0.nix
@@ -35,19 +35,24 @@ in
       description = ''
         The package used for Xen binary.
       '';
-      relatedPackages = [ "xen" "xen-light" ];
     };
 
-    virtualisation.xen.package-qemu = mkOption {
+    virtualisation.xen.qemu = mkOption {
+      type = types.path;
+      defaultText = "\${pkgs.xen}/lib/xen/bin/qemu-system-i386";
+      example = literalExample "''${pkgs.qemu_xen-light}/bin/qemu-system-i386";
+      description = ''
+        The qemu binary to use for Dom-0 backend.
+      '';
+    };
+
+    virtualisation.xen.qemu-package = mkOption {
       type = types.package;
       defaultText = "pkgs.xen";
       example = literalExample "pkgs.qemu_xen-light";
       description = ''
-        The package with qemu binaries for dom0 qemu and xendomains.
+        The package with qemu binaries for xendomains.
       '';
-      relatedPackages = [ "xen"
-                          { name = "qemu_xen-light"; comment = "For use with pkgs.xen-light."; }
-                        ];
     };
 
     virtualisation.xen.bootParams =
@@ -153,7 +158,8 @@ in
     } ];
 
     virtualisation.xen.package = mkDefault pkgs.xen;
-    virtualisation.xen.package-qemu = mkDefault pkgs.xen;
+    virtualisation.xen.qemu = mkDefault "${pkgs.xen}/lib/xen/bin/qemu-system-i386";
+    virtualisation.xen.qemu-package = mkDefault pkgs.xen;
     virtualisation.xen.stored = mkDefault "${cfg.package}/bin/oxenstored";
 
     environment.systemPackages = [ cfg.package ];
@@ -333,8 +339,7 @@ in
       after = [ "xen-console.service" ];
       requires = [ "xen-store.service" ];
       serviceConfig.ExecStart = ''
-        ${cfg.package-qemu}/${cfg.package-qemu.qemu-system-i386} \
-           -xen-attach -xen-domid 0 -name dom0 -M xenpv \
+        ${cfg.qemu} -xen-attach -xen-domid 0 -name dom0 -M xenpv \
            -nographic -monitor /dev/null -serial /dev/null -parallel /dev/null
         '';
     };
@@ -443,7 +448,7 @@ in
       before = [ "dhcpd.service" ];
       restartIfChanged = false;
       serviceConfig.RemainAfterExit = "yes";
-      path = [ cfg.package cfg.package-qemu ];
+      path = [ cfg.package cfg.qemu-package ];
       environment.XENDOM_CONFIG = "${cfg.package}/etc/sysconfig/xendomains";
       preStart = "mkdir -p /var/lock/subsys -m 755";
       serviceConfig.ExecStart = "${cfg.package}/etc/init.d/xendomains start";