Author: eelco
Date: 2010-07-06 09:01:15 +0000 (Tue, 06 Jul 2010)
New Revision: 22489

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22489&view=rev

Added:
   nixos/branches/boot-order/modules/config/swap.nix
Removed:
   nixos/branches/boot-order/modules/tasks/swap.nix
Modified:
   nixos/branches/boot-order/modules/module-list.nix

Log:
* Move the swap module to config/ because it doesn't provide a task
  anymore.  Activating swap devices is now handled by the mountall
  task.


Changes:

Copied: nixos/branches/boot-order/modules/config/swap.nix (from rev 22486, 
nixos/branches/boot-order/modules/tasks/swap.nix)
===================================================================
--- nixos/branches/boot-order/modules/config/swap.nix                           
(rev 0)
+++ nixos/branches/boot-order/modules/config/swap.nix   2010-07-06 09:01:15 UTC 
(rev 22489)
@@ -0,0 +1,74 @@
+{ config, pkgs, ... }:
+
+with pkgs.lib;
+
+{
+
+  ###### interface
+  
+  options = {
+
+    swapDevices = mkOption {
+      default = [];
+      example = [
+        { device = "/dev/hda7"; }
+        { device = "/var/swapfile"; }
+        { label = "bigswap"; }
+      ];
+      description = ''
+        The swap devices and swap files.  These must have been
+        initialised using <command>mkswap</command>.  Each element
+        should be an attribute set specifying either the path of the
+        swap device or file (<literal>device</literal>) or the label
+        of the swap device (<literal>label</literal>, see
+        <command>mkswap -L</command>).  Using a label is
+        recommended.
+      '';
+
+      type = types.list types.optionSet;
+
+      options = {config, options, ...}: {
+
+        options = {
+        
+          device = mkOption {
+            example = "/dev/sda3";
+            type = types.string;
+            description = "Path of the device.";
+          };
+
+          label = mkOption {
+            example = "swap";
+            type = types.string;
+            description = ''
+              Label of the device.  Can be used instead of 
<varname>device</varname>.
+            '';
+          };
+
+          cipher = mkOption {
+            default = false;
+            example = true;
+            type = types.bool;
+            description = ''
+              Encrypt the swap device to protect swapped data.  This option
+              does not work with labels.
+            '';
+          };
+
+        };
+
+        config = {
+          device =
+            if options.label.isDefined then
+              "/dev/disk/by-label/${config.label}"
+            else
+              mkNotdef;
+        };
+        
+      };
+      
+    };
+
+  };
+
+}

Modified: nixos/branches/boot-order/modules/module-list.nix
===================================================================
--- nixos/branches/boot-order/modules/module-list.nix   2010-07-06 08:44:05 UTC 
(rev 22488)
+++ nixos/branches/boot-order/modules/module-list.nix   2010-07-06 09:01:15 UTC 
(rev 22489)
@@ -7,6 +7,7 @@
   ./config/no-x-libs.nix
   ./config/nsswitch.nix
   ./config/power-management.nix
+  ./config/swap.nix
   ./config/system-path.nix
   ./config/timezone.nix
   ./config/unix-odbc-drivers.nix
@@ -152,7 +153,6 @@
   ./tasks/kbd.nix
   ./tasks/lvm.nix
   ./tasks/network-interfaces.nix
-  ./tasks/swap.nix
   ./tasks/swraid.nix
   ./tasks/tty-backgrounds.nix
 ]

Deleted: nixos/branches/boot-order/modules/tasks/swap.nix
===================================================================
--- nixos/branches/boot-order/modules/tasks/swap.nix    2010-07-06 08:44:05 UTC 
(rev 22488)
+++ nixos/branches/boot-order/modules/tasks/swap.nix    2010-07-06 09:01:15 UTC 
(rev 22489)
@@ -1,74 +0,0 @@
-{ config, pkgs, ... }:
-
-with pkgs.lib;
-
-{
-
-  ###### interface
-  
-  options = {
-
-    swapDevices = mkOption {
-      default = [];
-      example = [
-        { device = "/dev/hda7"; }
-        { device = "/var/swapfile"; }
-        { label = "bigswap"; }
-      ];
-      description = ''
-        The swap devices and swap files.  These must have been
-        initialised using <command>mkswap</command>.  Each element
-        should be an attribute set specifying either the path of the
-        swap device or file (<literal>device</literal>) or the label
-        of the swap device (<literal>label</literal>, see
-        <command>mkswap -L</command>).  Using a label is
-        recommended.
-      '';
-
-      type = types.list types.optionSet;
-
-      options = {config, options, ...}: {
-
-        options = {
-        
-          device = mkOption {
-            example = "/dev/sda3";
-            type = types.string;
-            description = "Path of the device.";
-          };
-
-          label = mkOption {
-            example = "swap";
-            type = types.string;
-            description = ''
-              Label of the device.  Can be used instead of 
<varname>device</varname>.
-            '';
-          };
-
-          cipher = mkOption {
-            default = false;
-            example = true;
-            type = types.bool;
-            description = ''
-              Encrypt the swap device to protect swapped data.  This option
-              does not work with labels.
-            '';
-          };
-
-        };
-
-        config = {
-          device =
-            if options.label.isDefined then
-              "/dev/disk/by-label/${config.label}"
-            else
-              mkNotdef;
-        };
-        
-      };
-      
-    };
-
-  };
-
-}

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to