Implemented a very very dirty hack, which makes it possible to statically determine which activation types are supported, instead of determining this by the avahi service

svn path=/nixos/trunk/; revision=32089
This commit is contained in:
Sander van der Burg 2012-02-06 22:49:41 +00:00
parent 89d5aa4dd2
commit 3a9dfceb07

View File

@ -90,6 +90,19 @@ in
( { hostname = config.networking.hostName;
targetHost = config.deployment.targetHost;
system = if config.nixpkgs.system == "" then builtins.currentSystem else config.nixpkgs.system;
supportedTypes = (import "${pkgs.stdenv.mkDerivation {
name = "supportedtypes";
buildCommand = ''
( echo -n "[ "
cd ${disnix_activation_scripts}/libexec/disnix/activation-scripts
for i in *
do
echo -n "\"$i\" "
done
echo -n " ]") > $out
'';
}}");
}
// optionalAttrs (cfg.useWebServiceInterface) { targetEPR = "http://${config.deployment.targetHost}:8080/DisnixWebService/services/DisnixWebService"; }
// optionalAttrs (config.services.httpd.enable) { documentRoot = config.services.httpd.documentRoot; }
@ -131,7 +144,6 @@ in
''
${pkgs.avahi}/bin/avahi-publish-service disnix-${config.networking.hostName} _disnix._tcp 22 \
"mem=$(grep 'MemTotal:' /proc/meminfo | sed -e 's/kB//' -e 's/MemTotal://' -e 's/ //g')" \
"supportedTypes=[$(for i in ${disnix_activation_scripts}/libexec/disnix/activation-scripts/*; do echo -n " \"$(basename $i)\""; done) ]" \
${concatMapStrings (infrastructureAttrName:
let infrastructureAttrValue = getAttr infrastructureAttrName (cfg.infrastructure);
in