* 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.

svn path=/nixos/trunk/; revision=25125
This commit is contained in:
Eelco Dolstra 2010-12-14 13:36:54 +00:00
parent 332f0418f7
commit 37a9ffffb0
2 changed files with 16 additions and 12 deletions

View file

@ -70,11 +70,18 @@ let
{ 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

View file

@ -4,15 +4,12 @@ with pkgs.lib;
{
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.
'';
};
};
}