* lib/eval-config.nix: combined "configuration" and "extraModules"

into one argument "modules".
* release.nix: fixed the manual job.
* ISO generation: break an infinite recursion.  Don't know why this
  suddenly happens.  Probably because of the nixpkgs.config change,
  but I don't see why.  Maybe the option evaluation is too strict.

svn path=/nixos/trunk/; revision=16878
This commit is contained in:
Eelco Dolstra 2009-08-27 11:57:43 +00:00
parent 6f1b1aefde
commit 2892aed712
5 changed files with 26 additions and 21 deletions

View file

@ -3,13 +3,12 @@
let let
eval = import ./lib/eval-config.nix {inherit configuration;}; eval = import ./lib/eval-config.nix { modules = [ configuration ]; };
inherit (eval) config pkgs; inherit (eval) config pkgs;
vmConfig = (import ./lib/eval-config.nix { vmConfig = (import ./lib/eval-config.nix {
inherit configuration; modules = [ configuration ./modules/virtualisation/qemu-vm.nix ];
extraModules = [./modules/virtualisation/qemu-vm.nix];
}).config; }).config;
in in

View file

@ -2,13 +2,12 @@
# configuration object (`config') from which we can retrieve option # configuration object (`config') from which we can retrieve option
# values. # values.
{ configuration { system ? builtins.currentSystem
, system ? builtins.currentSystem
, nixpkgs ? import ./from-env.nix "NIXPKGS" /etc/nixos/nixpkgs , nixpkgs ? import ./from-env.nix "NIXPKGS" /etc/nixos/nixpkgs
, pkgs ? null , pkgs ? null
, baseModules ? import ../modules/module-list.nix , baseModules ? import ../modules/module-list.nix
, extraArgs ? {} , extraArgs ? {}
, extraModules ? [] , modules
}: }:
let extraArgs_ = extraArgs; pkgs_ = pkgs; in let extraArgs_ = extraArgs; pkgs_ = pkgs; in
@ -16,10 +15,7 @@ let extraArgs_ = extraArgs; pkgs_ = pkgs; in
rec { rec {
# These are the NixOS modules that constitute the system configuration. # These are the NixOS modules that constitute the system configuration.
configComponents = configComponents = modules ++ baseModules;
[ configuration ]
++ extraModules
++ baseModules;
# Merge the option definitions in all modules, forming the full # Merge the option definitions in all modules, forming the full
# system configuration. This is called "configFast" because it's # system configuration. This is called "configFast" because it's
@ -50,7 +46,7 @@ rec {
inherit system; inherit system;
config = config =
(import ./eval-config.nix { (import ./eval-config.nix {
inherit configuration system nixpkgs extraArgs extraModules; inherit system nixpkgs extraArgs modules;
# For efficiency, leave out most NixOS modules; they don't # For efficiency, leave out most NixOS modules; they don't
# define nixpkgs.config, so it's pointless to evaluate them. # define nixpkgs.config, so it's pointless to evaluate them.
baseModules = [ ../modules/misc/nixpkgs.nix ]; baseModules = [ ../modules/misc/nixpkgs.nix ];

View file

@ -140,6 +140,11 @@ in
"ln -s ${config.system.build.system} $out"; "ln -s ${config.system.build.system} $out";
target = "/system"; target = "/system";
} }
{ # Idem for the stage-2 init script.
source = pkgs.runCommand "system" {}
"ln -s ${config.system.build.bootStage2} $out";
target = "/init";
}
]; ];
# The Grub menu. # The Grub menu.
@ -150,7 +155,7 @@ in
chainloader +1 chainloader +1
title NixOS Installer / Rescue title NixOS Installer / Rescue
kernel /boot/vmlinuz init=${config.system.build.bootStage2} systemConfig=/system ${toString config.boot.kernelParams} kernel /boot/vmlinuz init=/init systemConfig=/system ${toString config.boot.kernelParams}
initrd /boot/initrd initrd /boot/initrd
''; '';

View file

@ -63,7 +63,7 @@ mount -t sysfs none /sys
# Process the kernel command line. # Process the kernel command line.
stage2Init=/init export stage2Init=/init
for o in $(cat /proc/cmdline); do for o in $(cat /proc/cmdline); do
case $o in case $o in
init=*) init=*)
@ -297,8 +297,9 @@ fi
# Start stage 2. `run-init' deletes all files in the ramfs on the # Start stage 2. `run-init' deletes all files in the ramfs on the
# current /. # current /. Note that $stage2Init might be an absolute symlink, in
if test -z "$stage2Init" -o ! -e "$targetRoot/$stage2Init"; then # which case "-e" won't work because we're not in the chroot yet.
if ! test -e "$targetRoot/$stage2Init" -o -L "$targetRoot/$stage2Init"; then
echo "stage 2 init script not found" echo "stage 2 init script not found"
fail fail
fi fi

View file

@ -1,4 +1,4 @@
{ nixpkgs ? ../nixpkgs-wc }: { nixpkgs ? ../nixpkgs }:
let let
@ -16,12 +16,11 @@ let
version = builtins.readFile ./VERSION + (if officialRelease then "" else "pre${toString nixosSrc.rev}"); version = builtins.readFile ./VERSION + (if officialRelease then "" else "pre${toString nixosSrc.rev}");
versionModule = { system.nixosVersion = version; };
iso = (import lib/eval-config.nix { iso = (import lib/eval-config.nix {
inherit system nixpkgs; inherit system nixpkgs;
configuration = modules = [ module versionModule ];
{ require = module;
system.nixosVersion = version;
};
}).config.system.build.isoImage; }).config.system.build.isoImage;
in in
@ -75,6 +74,11 @@ let
import "${nixosSrc}/doc/manual" { import "${nixosSrc}/doc/manual" {
pkgs = import nixpkgs {}; pkgs = import nixpkgs {};
optionDeclarations =
(import lib/eval-config.nix {
inherit nixpkgs;
modules = [ ];
}).optionDeclarations;
}; };