summary refs log tree commit diff
path: root/modules/system/activation/top-level.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-09-04 13:05:09 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-09-04 13:05:09 +0200
commit17457297cb05461696cfc36844b88294bd38222d (patch)
tree295571acc18df41615e1b9c330260a3af3ae1de5 /modules/system/activation/top-level.nix
parent3a23e6dd31d39d0a8ea229661d29855361c143cb (diff)
downloadnixpkgs-17457297cb05461696cfc36844b88294bd38222d.tar
nixpkgs-17457297cb05461696cfc36844b88294bd38222d.tar.gz
nixpkgs-17457297cb05461696cfc36844b88294bd38222d.tar.bz2
nixpkgs-17457297cb05461696cfc36844b88294bd38222d.tar.lz
nixpkgs-17457297cb05461696cfc36844b88294bd38222d.tar.xz
nixpkgs-17457297cb05461696cfc36844b88294bd38222d.tar.zst
nixpkgs-17457297cb05461696cfc36844b88294bd38222d.zip
Update all legacy-style modules
I.e., modules that use "require = [options]".  Nowadays that should be
written as

  {
    options = { ... };
    config = { ... };
  };

Also, use "imports" instead of "require" in places where we actually
import another module.
Diffstat (limited to 'modules/system/activation/top-level.nix')
-rw-r--r--modules/system/activation/top-level.nix140
1 files changed, 73 insertions, 67 deletions
diff --git a/modules/system/activation/top-level.nix b/modules/system/activation/top-level.nix
index 9f6a8f8583a..32157e41985 100644
--- a/modules/system/activation/top-level.nix
+++ b/modules/system/activation/top-level.nix
@@ -4,66 +4,6 @@ with pkgs.lib;
 
 let
 
-  options = {
-
-    system.build = mkOption {
-      default = {};
-      description = ''
-        Attribute set of derivations used to setup the system.
-      '';
-    };
-
-    nesting.children = mkOption {
-      default = [];
-      description = ''
-        Additional configurations to build.
-      '';
-    };
-
-    nesting.clone = mkOption {
-      default = [];
-      description = ''
-        Additional configurations to build based on the current
-        configuration which is has a lower priority.
-      '';
-    };
-
-    system.boot.loader.id = mkOption {
-      default = "";
-      description = ''
-        Id string of the used bootloader.
-      '';
-    };
-
-    system.boot.loader.kernelFile = mkOption {
-      default = pkgs.stdenv.platform.kernelTarget;
-      type = types.uniq types.string;
-      description = ''
-        Name of the kernel file to be passed to the bootloader.
-      '';
-    };
-
-    system.copySystemConfiguration = mkOption {
-      default = false;
-      description = ''
-        If enabled, copies the NixOS configuration file
-        <literal>$NIXOS_CONFIG</literal> (usually
-        <filename>/etc/nixos/configuration.nix</filename>)
-        to the system store path.
-      '';
-    };
-
-    system.extraSystemBuilderCmds = mkOption {
-      default = "";
-      internal = true;
-      merge = concatStringsSep "\n";
-      description = ''
-        This code will be added to the builder creating the system store path.
-      '';
-    };
-
-  };
-
 
   # This attribute is responsible for creating boot entries for
   # child configuration. They are only (directly) accessible
@@ -176,13 +116,79 @@ let
   };
 
 
-in {
-  require = [options];
+in
 
-  system.extraSystemBuilderCmds =
-    optionalString
-      config.system.copySystemConfiguration
-      "cp ${maybeEnv "NIXOS_CONFIG" "/etc/nixos/configuration.nix"} $out";
+{
+  options = {
+
+    system.build = mkOption {
+      default = {};
+      description = ''
+        Attribute set of derivations used to setup the system.
+      '';
+    };
+
+    nesting.children = mkOption {
+      default = [];
+      description = ''
+        Additional configurations to build.
+      '';
+    };
+
+    nesting.clone = mkOption {
+      default = [];
+      description = ''
+        Additional configurations to build based on the current
+        configuration which is has a lower priority.
+      '';
+    };
+
+    system.boot.loader.id = mkOption {
+      default = "";
+      description = ''
+        Id string of the used bootloader.
+      '';
+    };
+
+    system.boot.loader.kernelFile = mkOption {
+      default = pkgs.stdenv.platform.kernelTarget;
+      type = types.uniq types.string;
+      description = ''
+        Name of the kernel file to be passed to the bootloader.
+      '';
+    };
+
+    system.copySystemConfiguration = mkOption {
+      default = false;
+      description = ''
+        If enabled, copies the NixOS configuration file
+        <literal>$NIXOS_CONFIG</literal> (usually
+        <filename>/etc/nixos/configuration.nix</filename>)
+        to the system store path.
+      '';
+    };
+
+    system.extraSystemBuilderCmds = mkOption {
+      default = "";
+      internal = true;
+      merge = concatStringsSep "\n";
+      description = ''
+        This code will be added to the builder creating the system store path.
+      '';
+    };
+
+  };
+
+
+  config = {
+
+    system.extraSystemBuilderCmds =
+      optionalString
+        config.system.copySystemConfiguration
+        "cp ${maybeEnv "NIXOS_CONFIG" "/etc/nixos/configuration.nix"} $out";
+
+    system.build.toplevel = system;
+
+  };
 
-  system.build.toplevel = system;
 }