Author: eelco
Date: Fri May 11 23:06:35 2012
New Revision: 34064
URL: https://nixos.org/websvn/nix/?rev=34064&sc=1

Log:
* Use optionSet to check environment.etc.

Modified:
   nixos/trunk/modules/system/etc/etc.nix

Modified: nixos/trunk/modules/system/etc/etc.nix
==============================================================================
--- nixos/trunk/modules/system/etc/etc.nix      Fri May 11 21:56:23 2012        
(r34063)
+++ nixos/trunk/modules/system/etc/etc.nix      Fri May 11 23:06:35 2012        
(r34064)
@@ -16,8 +16,26 @@
         }
       ];
       description = ''
-        List of files that have to be linked in /etc.
+        List of files that have to be linked in <filename>/etc</filename>.
       '';
+      type = types.listOf types.optionSet;
+      options = {
+        source = mkOption {
+          description = "Source file.";
+        };
+        target = mkOption {
+          description = "Name of symlink (relative to 
<filename>/etc</filename>).";
+        };
+        mode = mkOption {
+          default = "symlink";
+          example = "0600";
+          description = ''
+            If set to something else than <literal>symlink</literal>,
+            the file is copied instead of symlinked, with the given
+            file mode.
+          '';
+        };
+      };
     };
   };
 in
@@ -35,7 +53,7 @@
     /* !!! Use toXML. */
     sources = map (x: x.source) config.environment.etc;
     targets = map (x: x.target) config.environment.etc;
-    modes = map (x: if x ? mode then x.mode else "symlink") 
config.environment.etc;
+    modes = map (x: x.mode) config.environment.etc;
   };
 
 in
_______________________________________________
nix-commits mailing list
nix-comm...@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to