From 51626b0b6602a0be53df471d778ef9d04f45a65c Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Tue, 25 Sep 2007 19:00:20 +0000 Subject: [PATCH] Added checking of unkonwn options in configuration.nix and a system-wide font set changer. svn path=/nixos/trunk/; revision=9370 --- etc/default.nix | 2 +- system/fonts.nix | 6 ++++-- system/options.nix | 9 +++++++++ system/system.nix | 7 +++---- upstart-jobs/default.nix | 2 +- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/etc/default.nix b/etc/default.nix index 33f85cb67a0..8b3ee316884 100644 --- a/etc/default.nix +++ b/etc/default.nix @@ -120,7 +120,7 @@ import ../helpers/make-etc.nix { ++ (optional ["fonts" "enableFontConfig"] { source = pkgs.runCommand "fonts.conf" { - fontDirectories = import ../system/fonts.nix {inherit pkgs;}; + fontDirectories = import ../system/fonts.nix {inherit pkgs config;}; buildInputs = [pkgs.libxslt]; inherit (pkgs) fontconfig; } diff --git a/system/fonts.nix b/system/fonts.nix index 6ddfc264889..2e6f5ee3d2e 100644 --- a/system/fonts.nix +++ b/system/fonts.nix @@ -1,4 +1,4 @@ -{pkgs}: +{pkgs , config}: [ # - the user's .fonts directory @@ -18,4 +18,6 @@ pkgs.xorg.fontbh100dpi pkgs.xorg.fontmiscmisc pkgs.xorg.fontcursormisc -] +] ++ +((config.get ["fonts" "extraFonts"]) pkgs) + diff --git a/system/options.nix b/system/options.nix index 4e45f34d08c..dffa513008a 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1118,6 +1118,15 @@ root ALL=(ALL) SETENV: ALL "; } + { + name = ["fonts" "extraFonts"]; + default = pkgs:[]; + description = " + Function, returning list of additional fonts. + "; + } + + { name = ["sound" "enable"]; diff --git a/system/system.nix b/system/system.nix index 974071c7bf4..b9fbefff44f 100644 --- a/system/system.nix +++ b/system/system.nix @@ -309,7 +309,7 @@ rec { # kernel, the Upstart services, the init scripts, etc.) as well as a # script `switch-to-configuration' that activates the configuration # and makes it bootable. - system = pkgs.stdenv.mkDerivation { + system = pkgs.checker (pkgs.stdenv.mkDerivation { name = "system"; builder = ./system.sh; switchToConfiguration = ./switch-to-configuration.sh; @@ -335,7 +335,6 @@ rec { pkgs.upstart # for initctl ]; configurationName = config.get ["boot" "configurationName"]; - }; - - + }) (pkgs.getConfig ["checkConfigurationOptions"] false) + config.declarations configuration ; } diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 0793b4e07b7..f602081262a 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -161,7 +161,7 @@ import ../upstart-jobs/gather.nix { openssh x11_ssh_askpass nvidiaDrivers synaptics; libX11 = pkgs.xlibs.libX11; libXext = pkgs.xlibs.libXext; - fontDirectories = import ../system/fonts.nix {inherit pkgs;}; + fontDirectories = import ../system/fonts.nix {inherit pkgs config;}; isClone = config.get ["services" "xserver" "isClone"]; })