Author: eelco
Date: Sun May 8 22:02:43 2011
New Revision: 27191
URL: https://svn.nixos.org/websvn/nix/?rev=27191&sc=1
Log:
* Add adhoc-cloud-vm.nix to the configuration only when targetEnv is "adhoc".
Modified:
cloud/trunk/src/adhoc-cloud-vm.nix
cloud/trunk/src/eval-machine-info.nix
cloud/trunk/src/nixos-deploy-network.pl
Modified: cloud/trunk/src/adhoc-cloud-vm.nix
==============================================================================
--- cloud/trunk/src/adhoc-cloud-vm.nix Sun May 8 21:45:31 2011 (r27190)
+++ cloud/trunk/src/adhoc-cloud-vm.nix Sun May 8 22:02:43 2011 (r27191)
@@ -16,7 +16,6 @@
swapDevices = [ { label = "swap"; } ];
networking.hostName = mkOverride 950 "";
- networking.firewall.enable = mkOverride 950 true;
services.openssh.enable = true;
Modified: cloud/trunk/src/eval-machine-info.nix
==============================================================================
--- cloud/trunk/src/eval-machine-info.nix Sun May 8 21:45:31 2011
(r27190)
+++ cloud/trunk/src/eval-machine-info.nix Sun May 8 22:02:43 2011
(r27191)
@@ -24,14 +24,11 @@
inherit nixpkgs;
modules =
modules ++
- [ # Slurp in the required configuration for machines in the adhoc
cloud.
- /home/eelco/Dev/configurations/tud/cloud/cloud-vm.nix
- # Provide a default hostname and deployment target equal
+ [ # Provide a default hostname and deployment target equal
# to the attribute name of the machine in the model.
{ key = "set-default-hostname";
networking.hostName = mkOverride 900 configurationName;
deployment.targetHost = mkOverride 900 configurationName;
- networking.firewall.enable = mkOverride 900 false; # hack,
think about this later
environment.checkConfigurationOptions = false; # should only
do this in phase 1
}
];
Modified: cloud/trunk/src/nixos-deploy-network.pl
==============================================================================
--- cloud/trunk/src/nixos-deploy-network.pl Sun May 8 21:45:31 2011
(r27190)
+++ cloud/trunk/src/nixos-deploy-network.pl Sun May 8 22:02:43 2011
(r27191)
@@ -182,11 +182,14 @@
$hosts .= "$machine->{ipv6} $machine->{name}\\n" if defined
$machine->{ipv6};
}
- open STATE, ">state.nix" or die;
+ open STATE, ">physical.nix" or die;
print STATE "{\n";
foreach my $machine (@machines) {
print STATE " $machine->{name} = { config, pkgs, ... }:\n";
print STATE " {\n";
+ if ($machine->{targetEnv} eq "adhoc") {
+ print STATE " require = [ $myDir/adhoc-cloud-vm.nix ];\n";
+ }
print STATE " networking.extraHosts = \"$hosts\";\n";
print STATE " };\n";
}
@@ -197,7 +200,7 @@
sub buildConfigs {
print STDERR "building all machine configurations...\n";
- $outPath = `nix-build $myDir/eval-machine-info.nix --arg networkExprs '[
@networkExprs ./state.nix ]' -A machines`;
+ $outPath = `nix-build $myDir/eval-machine-info.nix --arg networkExprs '[
@networkExprs ./physical.nix ]' -A machines`;
die "unable to build all machine configurations" unless $? == 0;
chomp $outPath;
}
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits