From 278b15d840e837b1815ef3fc2eb5f1fe6101dac7 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Mon, 25 May 2009 14:19:33 +0000
Subject: [PATCH] * More moving.

svn path=/nixos/branches/modular-nixos/; revision=15725
---
 etc/default.nix                               |  4 ++--
 {system => modules/config}/i18n.nix           |  0
 .../config}/unix-odbc-drivers.nix             |  0
 {system => modules/config}/users-groups.nix   |  4 ++--
 .../system/activation/activation-script.nix   |  0
 {system => modules/system/boot}/kernel.nix    |  0
 .../system/boot/stage-1-init.sh               |  0
 .../system/boot/stage-1.nix                   |  4 ++--
 .../system/boot/stage-2-init.sh               |  0
 .../system/boot/stage-2.nix                   |  6 ++---
 .../upstart-events}/ctrl-alt-delete.nix       |  0
 .../system/upstart-events}/halt.nix           |  3 ++-
 .../upstart-events}/maintenance-shell.nix     |  0
 system/options.nix                            | 24 +++++++++----------
 system/system-options.nix                     |  2 +-
 system/system.nix                             |  2 +-
 16 files changed, 25 insertions(+), 24 deletions(-)
 rename {system => modules/config}/i18n.nix (100%)
 rename {system => modules/config}/unix-odbc-drivers.nix (100%)
 rename {system => modules/config}/users-groups.nix (98%)
 rename system/activate-configuration.nix => modules/system/activation/activation-script.nix (100%)
 rename {system => modules/system/boot}/kernel.nix (100%)
 rename boot/boot-stage-1-init.sh => modules/system/boot/stage-1-init.sh (100%)
 rename boot/boot-stage-1.nix => modules/system/boot/stage-1.nix (98%)
 rename boot/boot-stage-2-init.sh => modules/system/boot/stage-2-init.sh (100%)
 rename boot/boot-stage-2.nix => modules/system/boot/stage-2.nix (89%)
 rename {upstart-jobs => modules/system/upstart-events}/ctrl-alt-delete.nix (100%)
 rename {upstart-jobs => modules/system/upstart-events}/halt.nix (96%)
 rename {upstart-jobs => modules/system/upstart-events}/maintenance-shell.nix (100%)

diff --git a/etc/default.nix b/etc/default.nix
index 105d8f5fe5b..095318bb435 100644
--- a/etc/default.nix
+++ b/etc/default.nix
@@ -251,10 +251,10 @@ in
     option
 
     # config.system.build
-    ../system/system-options.nix
+    # ../system/system-options.nix
 
     # config.system.activationScripts
-    ../system/activate-configuration.nix
+    # ../system/activate-configuration.nix
   ];
 
   system = {
diff --git a/system/i18n.nix b/modules/config/i18n.nix
similarity index 100%
rename from system/i18n.nix
rename to modules/config/i18n.nix
diff --git a/system/unix-odbc-drivers.nix b/modules/config/unix-odbc-drivers.nix
similarity index 100%
rename from system/unix-odbc-drivers.nix
rename to modules/config/unix-odbc-drivers.nix
diff --git a/system/users-groups.nix b/modules/config/users-groups.nix
similarity index 98%
rename from system/users-groups.nix
rename to modules/config/users-groups.nix
index ecaba8922f1..fe2c4138169 100644
--- a/system/users-groups.nix
+++ b/modules/config/users-groups.nix
@@ -41,7 +41,7 @@ in
 
 ###### implementation
 let
-  ids = import ./ids.nix;
+  ids = import ../../system/ids.nix;
   defaultShell = config.system.shell;
 
   # User accounts to be created/updated by NixOS.
@@ -151,7 +151,7 @@ in
     options
 
     # config.system.activationScripts
-    ../system/activate-configuration.nix
+    # ../system/activate-configuration.nix
   ];
 
   system = {
diff --git a/system/activate-configuration.nix b/modules/system/activation/activation-script.nix
similarity index 100%
rename from system/activate-configuration.nix
rename to modules/system/activation/activation-script.nix
diff --git a/system/kernel.nix b/modules/system/boot/kernel.nix
similarity index 100%
rename from system/kernel.nix
rename to modules/system/boot/kernel.nix
diff --git a/boot/boot-stage-1-init.sh b/modules/system/boot/stage-1-init.sh
similarity index 100%
rename from boot/boot-stage-1-init.sh
rename to modules/system/boot/stage-1-init.sh
diff --git a/boot/boot-stage-1.nix b/modules/system/boot/stage-1.nix
similarity index 98%
rename from boot/boot-stage-1.nix
rename to modules/system/boot/stage-1.nix
index f4c8d5e3a1b..2ed82339629 100644
--- a/boot/boot-stage-1.nix
+++ b/modules/system/boot/stage-1.nix
@@ -144,7 +144,7 @@ rec {
   # The init script of boot stage 1 (loading kernel modules for
   # mounting the root FS).
   bootStage1 = pkgs.substituteAll {
-    src = ./boot-stage-1-init.sh;
+    src = ./stage-1-init.sh;
 
     shell = "${extraUtils}/bin/bash";
 
@@ -192,7 +192,7 @@ rec {
             suffix = "/bin/splash_helper";
             symlink = "/${kernelPackages.splashutils.helperName}";
           } # */
-          { object = import ../helpers/unpack-theme.nix {
+          { object = import ../../../helpers/unpack-theme.nix {
               inherit (pkgs) stdenv;
               theme = config.services.ttyBackgrounds.defaultTheme;
             };
diff --git a/boot/boot-stage-2-init.sh b/modules/system/boot/stage-2-init.sh
similarity index 100%
rename from boot/boot-stage-2-init.sh
rename to modules/system/boot/stage-2-init.sh
diff --git a/boot/boot-stage-2.nix b/modules/system/boot/stage-2.nix
similarity index 89%
rename from boot/boot-stage-2.nix
rename to modules/system/boot/stage-2.nix
index 863de773043..c86570ad766 100644
--- a/boot/boot-stage-2.nix
+++ b/modules/system/boot/stage-2.nix
@@ -18,7 +18,7 @@ let
   bootLocal = config.boot.localCommands;
 
   bootStage2 = substituteAll {
-    src = ./boot-stage-2-init.sh;
+    src = ./stage-2-init.sh;
     isExecutable = true;
     inherit kernel upstart isLiveCD activateConfiguration upstartPath;
     path = [
@@ -37,10 +37,10 @@ in
     # config.boot.kernelPackages
 
     # config.system.activationScripts
-    ../system/activate-configuration.nix
+    # ../system/activate-configuration.nix
 
     # config.system.build
-    ../system/system-options.nix
+    # ../system/system-options.nix
   ];
 
   system = {
diff --git a/upstart-jobs/ctrl-alt-delete.nix b/modules/system/upstart-events/ctrl-alt-delete.nix
similarity index 100%
rename from upstart-jobs/ctrl-alt-delete.nix
rename to modules/system/upstart-events/ctrl-alt-delete.nix
diff --git a/upstart-jobs/halt.nix b/modules/system/upstart-events/halt.nix
similarity index 96%
rename from upstart-jobs/halt.nix
rename to modules/system/upstart-events/halt.nix
index d8a1029dba5..60727e3686b 100644
--- a/upstart-jobs/halt.nix
+++ b/modules/system/upstart-events/halt.nix
@@ -92,7 +92,8 @@ let
           sync || true
       
       
-          # Right now all events above power off the system.
+          # Either reboot or power-off the system.  Note that the "halt"
+          # event also does a power-off.
           if test ${event} = reboot; then
               exec reboot -f
           else
diff --git a/upstart-jobs/maintenance-shell.nix b/modules/system/upstart-events/maintenance-shell.nix
similarity index 100%
rename from upstart-jobs/maintenance-shell.nix
rename to modules/system/upstart-events/maintenance-shell.nix
diff --git a/system/options.nix b/system/options.nix
index cf9af7a2878..50d61239903 100644
--- a/system/options.nix
+++ b/system/options.nix
@@ -380,9 +380,14 @@ in
 
   require = [
     #../modules/hardware/network/intel-3945abg.nix
-    ../boot/boot-stage-2.nix
     ../etc/default.nix
+    ../modules/config/fonts.nix
+    ../modules/config/i18n.nix
+    ../modules/config/unix-odbc-drivers.nix
+    ../modules/config/users-groups.nix
     ../modules/installer/grub/grub.nix
+    ../modules/security/setuid-wrappers.nix
+    ../modules/security/sudo.nix
     ../modules/services/audio/alsa.nix
     ../modules/services/audio/pulseaudio.nix
     ../modules/services/databases/mysql.nix
@@ -436,28 +441,23 @@ in
     ../modules/services/web-servers/tomcat.nix # untested, too lazy to get that jdk
     ../modules/services/x11/xfs.nix
     ../modules/services/x11/xserver/default.nix
-    ../system/activate-configuration.nix
+    ../modules/system/activation/activation-script.nix
+    ../modules/system/boot/kernel.nix
+    ../modules/system/boot/stage-2.nix
+    ../modules/system/upstart-events/ctrl-alt-delete.nix
+    ../modules/system/upstart-events/halt.nix
+    ../modules/system/upstart-events/maintenance-shell.nix
     ../system/assertion.nix
-    ../modules/config/fonts.nix
-    ../system/i18n.nix
-    ../system/kernel.nix
     ../system/nixos-environment.nix
     ../system/nixos-installer.nix
-    ../modules/security/setuid-wrappers.nix
-    ../modules/security/sudo.nix
     ../system/system-options.nix
-    ../system/unix-odbc-drivers.nix
-    ../system/users-groups.nix
     ../upstart-jobs/cron/locate.nix
-    ../upstart-jobs/ctrl-alt-delete.nix
     ../upstart-jobs/default.nix
     ../upstart-jobs/filesystems.nix
     ../upstart-jobs/guest-users.nix
-    ../upstart-jobs/halt.nix
     ../upstart-jobs/kbd.nix
     ../upstart-jobs/ldap
     ../upstart-jobs/lvm.nix
-    ../upstart-jobs/maintenance-shell.nix
     ../upstart-jobs/network-interfaces.nix
     ../upstart-jobs/pcmcia.nix
     ../upstart-jobs/swap.nix
diff --git a/system/system-options.nix b/system/system-options.nix
index c8284a0831b..ca305cfddf4 100644
--- a/system/system-options.nix
+++ b/system/system-options.nix
@@ -83,7 +83,7 @@ in
     option
 
     # config.system.activationScripts
-    ../system/activate-configuration.nix
+    # ../system/activate-configuration.nix
   ];
 
   system = {
diff --git a/system/system.nix b/system/system.nix
index faebd9b83d4..06a212df2d9 100644
--- a/system/system.nix
+++ b/system/system.nix
@@ -38,7 +38,7 @@ rec {
 
 
   # The initial ramdisk.
-  initialRamdiskStuff = import ../boot/boot-stage-1.nix {
+  initialRamdiskStuff = import ../modules/system/boot/stage-1.nix {
     inherit pkgs config;
   };