From 5c89e891dfd63ba4ed1189de153b6cbd0ad7c906 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 28 Nov 2006 10:45:21 +0000 Subject: [PATCH] * Refactoring. svn path=/nixos/trunk/; revision=7156 --- .../boot-stage-1-init.sh | 0 boot-stage-1.nix => boot/boot-stage-1.nix | 0 .../boot-stage-2-init.sh | 0 boot-stage-2.nix => boot/boot-stage-2.nix | 0 make-devices.sh => boot/make-devices.sh | 0 make-initrd.nix => boot/make-initrd.nix | 2 +- make-initrd.sh => boot/make-initrd.sh | 0 .../boot-environment.nix | 48 +++++++++---------- options.nix => configuration/options.nix | 0 .../splash-themes.nix | 0 .../system-configuration.nix | 2 +- .../system-configuration.sh | 0 isolinux.cfg => helpers/isolinux.cfg | 0 .../make-iso9660-image.nix | 0 .../make-iso9660-image.sh | 0 .../modules-closure.nix | 0 .../modules-closure.sh | 0 .../paths-from-graph.sh | 0 .../grub-menu-builder.sh | 0 .../nixos-installer.nix | 4 +- installer.sh => installer/nixos-installer.sh | 0 rescue-cd.nix => instances/rescue-cd.nix | 6 +-- 22 files changed, 31 insertions(+), 31 deletions(-) rename boot-stage-1-init.sh => boot/boot-stage-1-init.sh (100%) rename boot-stage-1.nix => boot/boot-stage-1.nix (100%) rename boot-stage-2-init.sh => boot/boot-stage-2-init.sh (100%) rename boot-stage-2.nix => boot/boot-stage-2.nix (100%) rename make-devices.sh => boot/make-devices.sh (100%) rename make-initrd.nix => boot/make-initrd.nix (95%) rename make-initrd.sh => boot/make-initrd.sh (100%) rename boot-environment.nix => configuration/boot-environment.nix (81%) rename options.nix => configuration/options.nix (100%) rename splash-themes.nix => configuration/splash-themes.nix (100%) rename system-configuration.nix => configuration/system-configuration.nix (96%) rename system-configuration.sh => configuration/system-configuration.sh (100%) rename isolinux.cfg => helpers/isolinux.cfg (100%) rename make-iso9660-image.nix => helpers/make-iso9660-image.nix (100%) rename make-iso9660-image.sh => helpers/make-iso9660-image.sh (100%) rename modules-closure.nix => helpers/modules-closure.nix (100%) rename modules-closure.sh => helpers/modules-closure.sh (100%) rename paths-from-graph.sh => helpers/paths-from-graph.sh (100%) rename grub-menu-builder.sh => installer/grub-menu-builder.sh (100%) rename installer.nix => installer/nixos-installer.nix (79%) rename installer.sh => installer/nixos-installer.sh (100%) rename rescue-cd.nix => instances/rescue-cd.nix (94%) diff --git a/boot-stage-1-init.sh b/boot/boot-stage-1-init.sh similarity index 100% rename from boot-stage-1-init.sh rename to boot/boot-stage-1-init.sh diff --git a/boot-stage-1.nix b/boot/boot-stage-1.nix similarity index 100% rename from boot-stage-1.nix rename to boot/boot-stage-1.nix diff --git a/boot-stage-2-init.sh b/boot/boot-stage-2-init.sh similarity index 100% rename from boot-stage-2-init.sh rename to boot/boot-stage-2-init.sh diff --git a/boot-stage-2.nix b/boot/boot-stage-2.nix similarity index 100% rename from boot-stage-2.nix rename to boot/boot-stage-2.nix diff --git a/make-devices.sh b/boot/make-devices.sh similarity index 100% rename from make-devices.sh rename to boot/make-devices.sh diff --git a/make-initrd.nix b/boot/make-initrd.nix similarity index 95% rename from make-initrd.nix rename to boot/make-initrd.nix index a28c312564e2..b737b2f9779f 100644 --- a/make-initrd.nix +++ b/boot/make-initrd.nix @@ -27,5 +27,5 @@ stdenv.mkDerivation { # For obtaining the closure of `contents'. exportReferencesGraph = map (x: [("closure-" + baseNameOf x.symlink) x.object]) contents; - pathsFromGraph = ./paths-from-graph.sh; + pathsFromGraph = ../helpers/paths-from-graph.sh; } diff --git a/make-initrd.sh b/boot/make-initrd.sh similarity index 100% rename from make-initrd.sh rename to boot/make-initrd.sh diff --git a/boot-environment.nix b/configuration/boot-environment.nix similarity index 81% rename from boot-environment.nix rename to configuration/boot-environment.nix index 78086e99cfc5..b38c73b00359 100644 --- a/boot-environment.nix +++ b/configuration/boot-environment.nix @@ -8,21 +8,21 @@ rec { - pkgs = import ./pkgs/top-level/all-packages.nix {inherit system;}; + pkgs = import ../pkgs/top-level/all-packages.nix {inherit system;}; - pkgsDiet = import ./pkgs/top-level/all-packages.nix { + pkgsDiet = import ../pkgs/top-level/all-packages.nix { inherit system; bootStdenv = pkgs.useDietLibC pkgs.stdenv; }; - pkgsStatic = import ./pkgs/top-level/all-packages.nix { + pkgsStatic = import ../pkgs/top-level/all-packages.nix { inherit system; bootStdenv = pkgs.makeStaticBinaries pkgs.stdenv; }; - stdenvLinuxStuff = import ./pkgs/stdenv/linux { + stdenvLinuxStuff = import ../pkgs/stdenv/linux { system = pkgs.stdenv.system; - allPackages = import ./pkgs/top-level/all-packages.nix; + allPackages = import ../pkgs/top-level/all-packages.nix; }; nix = pkgs.nixUnstable; # we need the exportReferencesGraph feature @@ -35,7 +35,7 @@ rec { # Determine the set of modules that we need to mount the root FS. - modulesClosure = import ./modules-closure.nix { + modulesClosure = import ../helpers/modules-closure.nix { inherit (pkgs) stdenv kernel module_init_tools; rootModules = ["ide-cd" "ide-disk" "ide-generic"]; }; @@ -63,7 +63,7 @@ rec { # The init script of boot stage 1 (loading kernel modules for # mounting the root FS). - bootStage1 = import ./boot-stage-1.nix { + bootStage1 = import ../boot/boot-stage-1.nix { inherit (pkgs) genericSubstituter; inherit (pkgsDiet) module_init_tools; inherit extraUtils; @@ -77,7 +77,7 @@ rec { # The closure of the init script of boot stage 1 is what we put in # the initial RAM disk. - initialRamdisk = import ./make-initrd.nix { + initialRamdisk = import ../boot/make-initrd.nix { inherit (pkgs) stdenv cpio; contents = [ { object = bootStage1; @@ -87,7 +87,7 @@ rec { suffix = "/bin/splash_helper"; symlink = "/sbin/splash_helper"; } - { object = import ./helpers/unpack-theme.nix { + { object = import ../helpers/unpack-theme.nix { inherit (pkgs) stdenv; theme = splashThemes.splashScreen; }; @@ -98,7 +98,7 @@ rec { # The installer. - nixosInstaller = import ./installer.nix { + nixosInstaller = import ../installer/nixos-installer.nix { inherit (pkgs) stdenv genericSubstituter; inherit nix; shell = pkgs.bash + "/bin/sh"; @@ -106,54 +106,54 @@ rec { # The services (Upstart) configuration for the system. - upstartJobs = import ./upstart-jobs/gather.nix { + upstartJobs = import ../upstart-jobs/gather.nix { inherit (pkgs) stdenv; jobs = map makeJob [ # Syslogd. - (import ./upstart-jobs/syslogd.nix { + (import ../upstart-jobs/syslogd.nix { inherit (pkgs) sysklogd; }) # Hardware scan; loads modules for PCI devices. - (import ./upstart-jobs/hardware-scan.nix { + (import ../upstart-jobs/hardware-scan.nix { inherit (pkgs) kernel module_init_tools; }) # Network interfaces. - (import ./upstart-jobs/network-interfaces.nix { + (import ../upstart-jobs/network-interfaces.nix { inherit (pkgs) nettools kernel module_init_tools; }) # DHCP client. - (import ./upstart-jobs/dhclient.nix { + (import ../upstart-jobs/dhclient.nix { dhcp = pkgs.dhcpWrapper; }) # SSH daemon. - (import ./upstart-jobs/sshd.nix { + (import ../upstart-jobs/sshd.nix { inherit (pkgs) openssh; }) # Transparent TTY backgrounds. - (import ./upstart-jobs/tty-backgrounds.nix { + (import ../upstart-jobs/tty-backgrounds.nix { inherit (pkgs) stdenv splashutils; backgrounds = splashThemes.ttyBackgrounds; }) # Handles the maintenance/stalled event (single-user shell). - (import ./upstart-jobs/maintenance-shell.nix { + (import ../upstart-jobs/maintenance-shell.nix { inherit (pkgs) bash; }) # Ctrl-alt-delete action. - (import ./upstart-jobs/ctrl-alt-delete.nix) + (import ../upstart-jobs/ctrl-alt-delete.nix) ] # Handles the reboot/halt events. ++ (map - (event: makeJob (import ./upstart-jobs/halt.nix { + (event: makeJob (import ../upstart-jobs/halt.nix { inherit (pkgs) bash; inherit event; })) @@ -162,7 +162,7 @@ rec { # The terminals on ttyX. ++ (map - (ttyNumber: makeJob (import ./upstart-jobs/mingetty.nix { + (ttyNumber: makeJob (import ../upstart-jobs/mingetty.nix { mingetty = pkgs.mingettyWrapper; inherit ttyNumber; })) @@ -174,14 +174,14 @@ rec { }; - makeJob = import ./upstart-jobs/make-job.nix { + makeJob = import ../upstart-jobs/make-job.nix { inherit (pkgs) stdenv; }; # The init script of boot stage 2, which is supposed to do # everything else to bring up the system. - bootStage2 = import ./boot-stage-2.nix { + bootStage2 = import ../boot/boot-stage-2.nix { inherit (pkgs) genericSubstituter coreutils findutils utillinux kernel udev upstart; inherit upstartJobs; @@ -222,7 +222,7 @@ rec { }; - lib = import ./pkgs/lib; + lib = pkgs.library; config = rec { diff --git a/options.nix b/configuration/options.nix similarity index 100% rename from options.nix rename to configuration/options.nix diff --git a/splash-themes.nix b/configuration/splash-themes.nix similarity index 100% rename from splash-themes.nix rename to configuration/splash-themes.nix diff --git a/system-configuration.nix b/configuration/system-configuration.nix similarity index 96% rename from system-configuration.nix rename to configuration/system-configuration.nix index 640f17f907ef..db4482306e41 100644 --- a/system-configuration.nix +++ b/configuration/system-configuration.nix @@ -46,7 +46,7 @@ rec { grubMenuBuilder = pkgs.genericSubstituter { - src = ./grub-menu-builder.sh; + src = ../installer/grub-menu-builder.sh; isExecutable = true; inherit (pkgs) bash; }; diff --git a/system-configuration.sh b/configuration/system-configuration.sh similarity index 100% rename from system-configuration.sh rename to configuration/system-configuration.sh diff --git a/isolinux.cfg b/helpers/isolinux.cfg similarity index 100% rename from isolinux.cfg rename to helpers/isolinux.cfg diff --git a/make-iso9660-image.nix b/helpers/make-iso9660-image.nix similarity index 100% rename from make-iso9660-image.nix rename to helpers/make-iso9660-image.nix diff --git a/make-iso9660-image.sh b/helpers/make-iso9660-image.sh similarity index 100% rename from make-iso9660-image.sh rename to helpers/make-iso9660-image.sh diff --git a/modules-closure.nix b/helpers/modules-closure.nix similarity index 100% rename from modules-closure.nix rename to helpers/modules-closure.nix diff --git a/modules-closure.sh b/helpers/modules-closure.sh similarity index 100% rename from modules-closure.sh rename to helpers/modules-closure.sh diff --git a/paths-from-graph.sh b/helpers/paths-from-graph.sh similarity index 100% rename from paths-from-graph.sh rename to helpers/paths-from-graph.sh diff --git a/grub-menu-builder.sh b/installer/grub-menu-builder.sh similarity index 100% rename from grub-menu-builder.sh rename to installer/grub-menu-builder.sh diff --git a/installer.nix b/installer/nixos-installer.nix similarity index 79% rename from installer.nix rename to installer/nixos-installer.nix index 44080b86a85e..818b3e198876 100644 --- a/installer.nix +++ b/installer/nixos-installer.nix @@ -2,12 +2,12 @@ }: genericSubstituter { - src = ./installer.sh; + src = ./nixos-installer.sh; dir = "bin"; isExecutable = true; inherit shell nix; - pathsFromGraph = ./paths-from-graph.sh; + pathsFromGraph = ../helpers/paths-from-graph.sh; nixClosure = stdenv.mkDerivation { name = "closure"; diff --git a/installer.sh b/installer/nixos-installer.sh similarity index 100% rename from installer.sh rename to installer/nixos-installer.sh diff --git a/rescue-cd.nix b/instances/rescue-cd.nix similarity index 94% rename from rescue-cd.nix rename to instances/rescue-cd.nix index 48040f6495cc..a8a888369119 100644 --- a/rescue-cd.nix +++ b/instances/rescue-cd.nix @@ -6,7 +6,7 @@ let in # Build boot scripts for the CD that find the CD-ROM automatically. - with import ./boot-environment.nix { + with import ../configuration/boot-environment.nix { autoDetectRootDevice = true; rootLabel = cdromLabel; stage2Init = "/init"; @@ -63,7 +63,7 @@ rec { # Create an ISO image containing the isolinux boot loader, the # kernel, the initrd produced above, and the closure of the stage 2 # init. - rescueCD = import ./make-iso9660-image.nix { + rescueCD = import ../helpers/make-iso9660-image.nix { inherit (pkgs) stdenv cdrtools; isoName = "nixos.iso"; @@ -71,7 +71,7 @@ rec { { source = pkgs.syslinux + "/lib/syslinux/isolinux.bin"; target = "isolinux/isolinux.bin"; } - { source = ./isolinux.cfg; + { source = ../helpers/isolinux.cfg; target = "isolinux/isolinux.cfg"; } { source = pkgs.kernel + "/vmlinuz";