From 663b6a747b1d3fc32dadb2f72be7df8a3bc2e4d3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 1 Jul 2013 19:37:14 +0200 Subject: [PATCH] release.nix: Get rid of the "system" argument --- release.nix | 74 ++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 41 deletions(-) diff --git a/release.nix b/release.nix index ba47265a..cb1d5b40 100644 --- a/release.nix +++ b/release.nix @@ -2,7 +2,13 @@ , officialRelease ? false }: -rec { +let + + pkgs = import {}; + + genAttrs' = pkgs.lib.genAttrs [ "x86_64-linux" "i686-linux" ]; + +in rec { tarball = with import { }; @@ -40,12 +46,9 @@ rec { }; - build = - { system ? "x86_64-linux" }: + build = genAttrs' (system: - let pkgs = import {inherit system;}; in - - with pkgs; + with import { inherit system; }; let @@ -133,46 +136,35 @@ rec { LOGNAME = "foo"; meta.description = "Build of Hydra on ${system}"; - }; + }); - tests = - { nixos ? ../nixos, system ? "x86_64-linux" }: - - let hydra = build { inherit system; }; in - + tests.install = genAttrs' (system: with import { inherit system; }; + let hydra = builtins.getAttr system build; in # build.${system} + simpleTest { + machine = + { config, pkgs, ... }: + { services.postgresql.enable = true; + services.postgresql.package = pkgs.postgresql92; + environment.systemPackages = [ hydra ]; + }; - { + testScript = + '' + $machine->waitForJob("postgresql"); - install = simpleTest { - - machine = - { config, pkgs, ... }: - { services.postgresql.enable = true; - services.postgresql.package = pkgs.postgresql92; - environment.systemPackages = [ hydra ]; - }; - - testScript = - '' - $machine->waitForJob("postgresql"); - - # Initialise the database and the state. - $machine->mustSucceed - ( "createdb -O root hydra", - , "psql hydra -f ${hydra}/libexec/hydra/sql/hydra-postgresql.sql" - , "mkdir /var/lib/hydra" - ); - - # Start the web interface. - $machine->mustSucceed("HYDRA_DATA=/var/lib/hydra HYDRA_DBI='dbi:Pg:dbname=hydra;user=hydra;' hydra-server >&2 &"); - $machine->waitForOpenPort("3000"); - ''; - - }; - - }; + # Initialise the database and the state. + $machine->mustSucceed + ( "createdb -O root hydra", + , "psql hydra -f ${hydra}/libexec/hydra/sql/hydra-postgresql.sql" + , "mkdir /var/lib/hydra" + ); + # Start the web interface. + $machine->mustSucceed("HYDRA_DATA=/var/lib/hydra HYDRA_DBI='dbi:Pg:dbname=hydra;user=hydra;' hydra-server >&2 &"); + $machine->waitForOpenPort("3000"); + ''; + }); }