Browse Source

* 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
nsd-state-dir
Eelco Dolstra 13 years ago
parent
commit
2892aed712
  1. 5
      default.nix
  2. 12
      lib/eval-config.nix
  3. 7
      modules/installer/cd-dvd/iso-image.nix
  4. 7
      modules/system/boot/stage-1-init.sh
  5. 16
      release.nix

5
default.nix

@ -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

12
lib/eval-config.nix

@ -2,13 +2,12 @@
# 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
@ -16,10 +15,7 @@ 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
@ -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 ];

7
modules/installer/cd-dvd/iso-image.nix

@ -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.
@ -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
'';

7
modules/system/boot/stage-1-init.sh

@ -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=*)
@ -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

16
release.nix

@ -1,4 +1,4 @@
{ nixpkgs ? ../nixpkgs-wc }:
{ nixpkgs ? ../nixpkgs }:
let
@ -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
@ -75,6 +74,11 @@ let
import "${nixosSrc}/doc/manual" {
pkgs = import nixpkgs {};
optionDeclarations =
(import lib/eval-config.nix {
inherit nixpkgs;
modules = [ ];
}).optionDeclarations;
};

Loading…
Cancel
Save