From 3e732f65cbb10746d8fd84f54c750045a7ef8bbe Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 30 Oct 2015 13:51:07 +0100 Subject: Remove gnutar man page hack It's no longer needed since the gnutar package contains a (much more extensive) man page. --- nixos/modules/config/system-path.nix | 7 ------- 1 file changed, 7 deletions(-) (limited to 'nixos/modules/config/system-path.nix') diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index 748ada99be6..c6c20903a2c 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -7,12 +7,6 @@ with lib; let - extraManpages = pkgs.runCommand "extra-manpages" { buildInputs = [ pkgs.help2man ]; } - '' - mkdir -p $out/share/man/man1 - help2man ${pkgs.gnutar}/bin/tar > $out/share/man/man1/tar.1 - ''; - requiredPackages = [ config.nix.package pkgs.acl @@ -47,7 +41,6 @@ let pkgs.time pkgs.texinfoInteractive pkgs.utillinux - extraManpages ]; in -- cgit 1.4.1 From 58e9440b8983c2e0dbab667dc7944e8af9955a35 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 30 Oct 2015 14:13:47 +0100 Subject: Add option to link additional package outputs into system.path This is necessary to get stuff like separate manpages, info files, debug symbols, etc. --- nixos/modules/config/system-path.nix | 12 ++++++++++-- pkgs/build-support/buildenv/default.nix | 10 ++++++++-- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) (limited to 'nixos/modules/config/system-path.nix') diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index c6c20903a2c..8701b714eec 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -71,8 +71,16 @@ in # to work. default = []; example = ["/"]; - description = "List of directories to be symlinked in `/run/current-system/sw'."; + description = "List of directories to be symlinked in /run/current-system/sw."; }; + + outputsToLink = mkOption { + type = types.listOf types.str; + default = []; + example = [ "doc" ]; + description = "List of package outputs to be symlinked into /run/current-system/sw."; + }; + }; system = { @@ -119,7 +127,7 @@ in system.path = pkgs.buildEnv { name = "system-path"; paths = config.environment.systemPackages; - inherit (config.environment) pathsToLink; + inherit (config.environment) pathsToLink outputsToLink; ignoreCollisions = true; # !!! Hacky, should modularise. postBuild = diff --git a/pkgs/build-support/buildenv/default.nix b/pkgs/build-support/buildenv/default.nix index 8cbf0dc6c8e..bbfc572f55f 100644 --- a/pkgs/build-support/buildenv/default.nix +++ b/pkgs/build-support/buildenv/default.nix @@ -2,7 +2,7 @@ # a fork of the buildEnv in the Nix distribution. Most changes should # eventually be merged back into the Nix distribution. -{ perl, runCommand }: +{ perl, runCommand, lib }: { name @@ -21,6 +21,10 @@ # directories in the list is not symlinked. pathsToLink ? ["/"] +, # The package outputs to include. By default, only the default + # output is included. + outputsToLink ? [] + , # Root the result in directory "$out${extraPrefix}", e.g. "/share". extraPrefix ? "" @@ -36,7 +40,9 @@ runCommand name { inherit manifest ignoreCollisions passthru pathsToLink extraPrefix postBuild buildInputs; pkgs = builtins.toJSON (map (drv: { - paths = [ drv ]; # FIXME: handle multiple outputs + paths = + [ drv ] + ++ lib.concatMap (outputName: lib.optional (drv.${outputName}.outPath or null != null) drv.${outputName}) outputsToLink; priority = drv.meta.priority or 5; }) paths); preferLocalBuild = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index df72eafdfcb..6956af9085f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -261,7 +261,7 @@ let { substitutions = { inherit autoconf automake gettext libtool; }; } ../build-support/setup-hooks/autoreconf.sh; - buildEnv = callPackage ../build-support/buildenv {}; + buildEnv = callPackage ../build-support/buildenv { }; # not actually a package buildFHSEnv = callPackage ../build-support/build-fhs-chrootenv/env.nix { nixpkgs = pkgs; -- cgit 1.4.1 From c20403631da45ab4eff6dc803d4701da421ad05a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 30 Oct 2015 14:15:18 +0100 Subject: Factor out "man" into a separate module and add "man" outputs to system.path Fixes #10270. --- nixos/modules/config/system-path.nix | 3 --- nixos/modules/module-list.nix | 3 ++- nixos/modules/programs/man.nix | 30 ++++++++++++++++++++++++++++ nixos/modules/services/misc/nixos-manual.nix | 4 +++- 4 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 nixos/modules/programs/man.nix (limited to 'nixos/modules/config/system-path.nix') diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index 8701b714eec..f9257f578bf 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -28,7 +28,6 @@ let pkgs.xz pkgs.less pkgs.libcap - pkgs.man pkgs.nano pkgs.ncurses pkgs.netcat @@ -106,7 +105,6 @@ in "/info" "/lib" # FIXME: remove #"/lib/debug/.build-id" # enables GDB to find separated debug info - "/man" "/sbin" "/share/applications" "/share/desktop-directories" @@ -114,7 +112,6 @@ in "/share/emacs" "/share/icons" "/share/info" - "/share/man" "/share/menus" "/share/mime" "/share/nano" diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d204b31c9e8..3a5fb41dc79 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -61,9 +61,11 @@ ./programs/command-not-found/command-not-found.nix ./programs/dconf.nix ./programs/environment.nix + ./programs/freetds.nix ./programs/ibus.nix ./programs/kbdlight.nix ./programs/light.nix + ./programs/man.nix ./programs/nano.nix ./programs/screen.nix ./programs/shadow.nix @@ -73,7 +75,6 @@ ./programs/uim.nix ./programs/venus.nix ./programs/wvdial.nix - ./programs/freetds.nix ./programs/xfs_quota.nix ./programs/zsh/zsh.nix ./rename.nix diff --git a/nixos/modules/programs/man.nix b/nixos/modules/programs/man.nix new file mode 100644 index 00000000000..b2850653804 --- /dev/null +++ b/nixos/modules/programs/man.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + + options = { + + programs.man.enable = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable manual pages and the man command. + ''; + }; + + }; + + + config = mkIf config.programs.man.enable { + + environment.systemPackages = [ pkgs.man ]; + + environment.pathsToLink = [ "/share/man" ]; + + environment.outputsToLink = [ "man" ]; + + }; + +} diff --git a/nixos/modules/services/misc/nixos-manual.nix b/nixos/modules/services/misc/nixos-manual.nix index c10d8197686..7534eb0ae6a 100644 --- a/nixos/modules/services/misc/nixos-manual.nix +++ b/nixos/modules/services/misc/nixos-manual.nix @@ -92,7 +92,9 @@ in system.build.manual = manual; - environment.systemPackages = [ manual.manpages manual.manual help ]; + environment.systemPackages = + [ manual.manual help ] + ++ optional config.programs.man.enable manual.manpages; boot.extraTTYs = mkIf cfg.showManual ["tty${cfg.ttyNumber}"]; -- cgit 1.4.1 From d9d5c98c56809d2941404751b2304beab4e00c3e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 30 Oct 2015 15:16:48 +0100 Subject: Add option environment.enableDebugInfo This makes the debug outputs of packages that have them available to programs like gdb. --- nixos/modules/config/debug-info.nix | 46 +++++++++++++++++++++++++++ nixos/modules/config/system-path.nix | 3 +- nixos/modules/module-list.nix | 5 +-- pkgs/tools/package-management/nix/default.nix | 2 ++ 4 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 nixos/modules/config/debug-info.nix (limited to 'nixos/modules/config/system-path.nix') diff --git a/nixos/modules/config/debug-info.nix b/nixos/modules/config/debug-info.nix new file mode 100644 index 00000000000..a096a9809ce --- /dev/null +++ b/nixos/modules/config/debug-info.nix @@ -0,0 +1,46 @@ +{ config, lib, ... }: + +with lib; + +{ + + options = { + + environment.enableDebugInfo = mkOption { + type = types.bool; + default = false; + description = '' + Some NixOS packages provide debug symbols. However, these are + not included in the system closure by default to save disk + space. Enabling this option causes the debug symbols to appear + in /run/current-system/sw/lib/debug/.build-id, + where tools such as gdb can find them. + If you need debug symbols for a package that doesn't + provide them by default, you can enable them as follows: + + + nixpkgs.config.packageOverrides = pkgs: { + hello = overrideDerivation pkgs.hello (attrs: { + outputs = attrs.outputs or ["out"] ++ ["debug"]; + buildInputs = attrs.buildInputs ++ [<nixpkgs/pkgs/build-support/setup-hooks/separate-debug-info.sh>]; + }); + }; + + ''; + }; + + }; + + + config = { + + # FIXME: currently disabled because /lib is already in + # environment.pathsToLink, and we can't have both. + #environment.pathsToLink = [ "/lib/debug/.build-id" ]; + + environment.outputsToLink = + optional config.environment.enableDebugInfo "debug"; + + }; + +} diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index f9257f578bf..e14e4cf1314 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -103,8 +103,7 @@ in [ "/bin" "/etc/xdg" "/info" - "/lib" # FIXME: remove - #"/lib/debug/.build-id" # enables GDB to find separated debug info + "/lib" # FIXME: remove and update debug-info.nix "/sbin" "/share/applications" "/share/desktop-directories" diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 3a5fb41dc79..77575867f87 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1,7 +1,8 @@ [ + ./config/debug-info.nix ./config/fonts/corefonts.nix - ./config/fonts/fontconfig.nix ./config/fonts/fontconfig-ultimate.nix + ./config/fonts/fontconfig.nix ./config/fonts/fontdir.nix ./config/fonts/fonts.nix ./config/fonts/ghostscript.nix @@ -22,9 +23,9 @@ ./config/system-environment.nix ./config/system-path.nix ./config/timezone.nix - ./config/vpnc.nix ./config/unix-odbc-drivers.nix ./config/users-groups.nix + ./config/vpnc.nix ./config/zram.nix ./hardware/all-firmware.nix ./hardware/cpu/amd-microcode.nix diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index e74daade3b8..e76e2e811f5 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -43,6 +43,8 @@ let doInstallCheck = false; + separateDebugInfo = stdenv.isLinux; + crossAttrs = { postUnpack = '' export CPATH="${bzip2.crossDrv}/include" -- cgit 1.4.1