Skip to content

Commit

Permalink
* lib/eval-config.nix: combined "configuration" and "extraModules"
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
edolstra committed Aug 27, 2009
1 parent 6f1b1ae commit 2892aed
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 deletions.
5 changes: 2 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@

let

eval = import ./lib/eval-config.nix {inherit configuration;};
eval = import ./lib/eval-config.nix { modules = [ configuration ]; };

inherit (eval) config pkgs;

vmConfig = (import ./lib/eval-config.nix {
inherit configuration;
extraModules = [./modules/virtualisation/qemu-vm.nix];
modules = [ configuration ./modules/virtualisation/qemu-vm.nix ];
}).config;

in
Expand Down
12 changes: 4 additions & 8 deletions lib/eval-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,20 @@
# configuration object (`config') from which we can retrieve option
# values.

{ configuration
, system ? builtins.currentSystem
{ system ? builtins.currentSystem
, nixpkgs ? import ./from-env.nix "NIXPKGS" /etc/nixos/nixpkgs
, pkgs ? null
, baseModules ? import ../modules/module-list.nix
, extraArgs ? {}
, extraModules ? []
, modules
}:

let extraArgs_ = extraArgs; pkgs_ = pkgs; in

rec {

# These are the NixOS modules that constitute the system configuration.
configComponents =
[ configuration ]
++ extraModules
++ baseModules;
configComponents = modules ++ baseModules;

# Merge the option definitions in all modules, forming the full
# system configuration. This is called "configFast" because it's
Expand Down Expand Up @@ -50,7 +46,7 @@ rec {
inherit system;
config =
(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
# define nixpkgs.config, so it's pointless to evaluate them.
baseModules = [ ../modules/misc/nixpkgs.nix ];
Expand Down
7 changes: 6 additions & 1 deletion modules/installer/cd-dvd/iso-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ in
"ln -s ${config.system.build.system} $out";
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.
Expand All @@ -150,7 +155,7 @@ in
chainloader +1
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
'';

Expand Down
7 changes: 4 additions & 3 deletions modules/system/boot/stage-1-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ mount -t sysfs none /sys


# Process the kernel command line.
stage2Init=/init
export stage2Init=/init
for o in $(cat /proc/cmdline); do
case $o in
init=*)
Expand Down Expand Up @@ -297,8 +297,9 @@ fi


# Start stage 2. `run-init' deletes all files in the ramfs on the
# current /.
if test -z "$stage2Init" -o ! -e "$targetRoot/$stage2Init"; then
# current /. Note that $stage2Init might be an absolute symlink, in
# 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"
fail
fi
Expand Down
16 changes: 10 additions & 6 deletions release.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ nixpkgs ? ../nixpkgs-wc }:
{ nixpkgs ? ../nixpkgs }:

let

Expand All @@ -16,12 +16,11 @@ let

version = builtins.readFile ./VERSION + (if officialRelease then "" else "pre${toString nixosSrc.rev}");

versionModule = { system.nixosVersion = version; };

iso = (import lib/eval-config.nix {
inherit system nixpkgs;
configuration =
{ require = module;
system.nixosVersion = version;
};
inherit system nixpkgs;
modules = [ module versionModule ];
}).config.system.build.isoImage;

in
Expand Down Expand Up @@ -75,6 +74,11 @@ let

import "${nixosSrc}/doc/manual" {
pkgs = import nixpkgs {};
optionDeclarations =
(import lib/eval-config.nix {
inherit nixpkgs;
modules = [ ];
}).optionDeclarations;
};


Expand Down

0 comments on commit 2892aed

Please sign in to comment.