[Nix-dev] RE: [Nix-commits] SVN commit: nix - r25125 - in nixos/trunk/modules:installer/tools/nixos-deploy-network misc

Sander van der Burg - EWI S.vanderBurg at tudelft.nl
Tue Dec 14 15:04:25 CET 2010


In this case it always overrides the deployment.targetHost and networking.hostName options right? But what if there is a scenario in which the target can't be reached by it's attribute name?


-----Original Message-----
From: nix-commits-bounces at cs.uu.nl on behalf of Eelco Dolstra
Sent: Tue 12/14/2010 2:36 PM
To: nix-commits at cs.uu.nl
Subject: [Nix-commits] SVN commit: nix - r25125 - in nixos/trunk/modules:installer/tools/nixos-deploy-network misc
 
Author: eelco
Date: Tue Dec 14 13:36:54 2010
New Revision: 25125
URL: https://svn.nixos.org/websvn/nix/?rev=25125&sc=1

Log:
* Provide a default hostname and deployment target equal to the
  attribute name of the machine in the model.  This allows
  networking.hostName and deployment.targetHost to be omitted for
  typical networks.

Modified:
   nixos/trunk/modules/installer/tools/nixos-deploy-network/deploy.nix
   nixos/trunk/modules/misc/deployment.nix

Modified: nixos/trunk/modules/installer/tools/nixos-deploy-network/deploy.nix
==============================================================================
--- nixos/trunk/modules/installer/tools/nixos-deploy-network/deploy.nix	Tue Dec 14 13:30:17 2010	(r25124)
+++ nixos/trunk/modules/installer/tools/nixos-deploy-network/deploy.nix	Tue Dec 14 13:36:54 2010	(r25125)
@@ -70,11 +70,18 @@
       { name = configurationName;
         value = (import "${nixos}/lib/eval-config.nix" {
           inherit nixpkgs;
-          modules = [ configuration ];
+          modules =
+            [ configuration
+              # Provide a default hostname and deployment target equal
+              # to the attribute name of the machine in the model.
+              { key = "set-default-hostname";
+                networking.hostName = pkgs.lib.mkOverride 900 configurationName;
+                deployment.targetHost = pkgs.lib.mkOverride 900 configurationName;
+              }
+            ];
           extraArgs = evaluateMachines network;
         }).config; }
-    ) (attrNames (network)))
-  ;
+    ) (attrNames (network)));
 
   configs = evaluateMachines network;
 in

Modified: nixos/trunk/modules/misc/deployment.nix
==============================================================================
--- nixos/trunk/modules/misc/deployment.nix	Tue Dec 14 13:30:17 2010	(r25124)
+++ nixos/trunk/modules/misc/deployment.nix	Tue Dec 14 13:36:54 2010	(r25125)
@@ -4,15 +4,12 @@
 
 {
   options = {
-
-    deployment = {
-      targetHost = mkOption {
-        default = config.networking.hostName;
-        description = ''
-          This option specifies a hostname or IP address which can be used by nixos-deploy-network
-	  to execute remote deployment operations.
-        '';
-      };
+    deployment.targetHost = mkOption {
+      default = config.networking.hostName;
+      description = ''
+        This option specifies a hostname or IP address which can be used by nixos-deploy-network
+        to execute remote deployment operations.
+      '';
     };
   };
 }
_______________________________________________
nix-commits mailing list
nix-commits at cs.uu.nl
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20101214/ff2abc21/attachment.html 


More information about the nix-dev mailing list