From 441dcd68d88a2e82aebd3572eae8032fb33d8eaf Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 23 Oct 2013 16:34:38 +0200 Subject: [PATCH] Get rid of special-casing of system.path in the manual generation --- nixos/doc/manual/default.nix | 8 +---- nixos/modules/config/system-path.nix | 48 +++++++++++++--------------- 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index 56ad652c60e..c887e7f0317 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -7,14 +7,8 @@ with pkgs.lib; let - # To prevent infinite recursion, remove system.path from the - # options. Not sure why this happens. - options_ = - options // - { system = removeAttrs options.system ["path"]; }; - optionsXML = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext - (builtins.toXML (optionAttrSetToDocList options_))); + (builtins.toXML (optionAttrSetToDocList options))); optionsDocBook = pkgs.runCommand "options-db.xml" {} '' ${pkgs.libxslt}/bin/xsltproc \ diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index e65be03afac..e640592a97e 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -7,8 +7,6 @@ with pkgs.lib; let - cfg = config.environment; - extraManpages = pkgs.runCommand "extra-manpages" { buildInputs = [ pkgs.help2man ]; } '' mkdir -p $out/share/man/man1 @@ -87,33 +85,9 @@ in system = { path = mkOption { - default = cfg.systemPackages; description = '' The packages you want in the boot environment. ''; - - apply = list: pkgs.buildEnv { - name = "system-path"; - paths = list; - inherit (cfg) pathsToLink; - ignoreCollisions = true; - # !!! Hacky, should modularise. - postBuild = - '' - if [ -x $out/bin/update-mime-database -a -w $out/share/mime/packages ]; then - $out/bin/update-mime-database -V $out/share/mime - fi - - if [ -x $out/bin/gtk-update-icon-cache -a -f $out/share/icons/hicolor/index.theme ]; then - $out/bin/gtk-update-icon-cache $out/share/icons/hicolor - fi - - if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then - $out/bin/glib-compile-schemas $out/share/glib-2.0/schemas - fi - ''; - }; - }; }; @@ -138,5 +112,27 @@ in "/share/man" ]; + system.path = pkgs.buildEnv { + name = "system-path"; + paths = config.environment.systemPackages; + inherit (config.environment) pathsToLink; + ignoreCollisions = true; + # !!! Hacky, should modularise. + postBuild = + '' + if [ -x $out/bin/update-mime-database -a -w $out/share/mime/packages ]; then + $out/bin/update-mime-database -V $out/share/mime + fi + + if [ -x $out/bin/gtk-update-icon-cache -a -f $out/share/icons/hicolor/index.theme ]; then + $out/bin/gtk-update-icon-cache $out/share/icons/hicolor + fi + + if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then + $out/bin/glib-compile-schemas $out/share/glib-2.0/schemas + fi + ''; + }; + }; }