diff --git a/lib/build-vms.nix b/lib/build-vms.nix index 7032489253b9..8a51a23bc4ca 100644 --- a/lib/build-vms.nix +++ b/lib/build-vms.nix @@ -1,5 +1,6 @@ -{ nixos ? /etc/nixos/nixos +{ nixos ? ./.. , nixpkgs ? /etc/nixos/nixpkgs +, services ? /etc/nixos/services }: let pkgs = import nixpkgs { config = {}; }; in @@ -54,7 +55,7 @@ rec { nodes: configuration: import "${nixos}/lib/eval-config.nix" { - inherit nixpkgs; + inherit nixpkgs services; modules = [ configuration ]; extraArgs = { inherit nodes; }; /* !!! bug in the module/option handling: this ignores the @@ -175,6 +176,9 @@ rec { echo "making report..." ensureDir $out/coverage ${pkgs.lcov}/bin/genhtml --show-details $TMPDIR/out.info -o $out/coverage + + ensureDir $out/nix-support + echo "report coverage $out/coverage" >> $out/nix-support/hydra-build-products ''; # */ } diff --git a/lib/eval-config.nix b/lib/eval-config.nix index dd23867ef0d4..2eb0435d24da 100644 --- a/lib/eval-config.nix +++ b/lib/eval-config.nix @@ -4,6 +4,7 @@ { system ? builtins.currentSystem , nixpkgs ? import ./from-env.nix "NIXPKGS" /etc/nixos/nixpkgs +, services ? /etc/nixos/services , pkgs ? null , baseModules ? import ../modules/module-list.nix , extraArgs ? {} @@ -28,6 +29,7 @@ rec { extraArgs = extraArgs_ // { inherit pkgs optionDeclarations; modulesPath = ../modules; + servicesPath = services; }; # Import Nixpkgs, allowing the NixOS option nixpkgs.config to @@ -46,7 +48,7 @@ rec { inherit system; config = (import ./eval-config.nix { - inherit system nixpkgs extraArgs modules; + inherit system nixpkgs services extraArgs modules; # For efficiency, leave out most NixOS modules; they don't # define nixpkgs.config, so it's pointless to evaluate them. baseModules = [ ../modules/misc/nixpkgs.nix ]; diff --git a/modules/services/web-servers/apache-httpd/default.nix b/modules/services/web-servers/apache-httpd/default.nix index 200d8cc576d1..57d32209d26e 100644 --- a/modules/services/web-servers/apache-httpd/default.nix +++ b/modules/services/web-servers/apache-httpd/default.nix @@ -1,4 +1,4 @@ -{pkgs, config, ...}: +{ config, pkgs, servicesPath, ... }: with pkgs.lib; @@ -70,7 +70,7 @@ let startupScript = ""; options = {}; }; - res = defaults // svcFunction {inherit config pkgs serverInfo;}; + res = defaults // svcFunction {inherit config pkgs serverInfo servicesPath;}; in res; in map f defs; diff --git a/modules/services/web-servers/apache-httpd/subversion.nix b/modules/services/web-servers/apache-httpd/subversion.nix index 5996acd69fab..d22b2b580d41 100644 --- a/modules/services/web-servers/apache-httpd/subversion.nix +++ b/modules/services/web-servers/apache-httpd/subversion.nix @@ -1,4 +1,4 @@ -{config, pkgs, serverInfo}: +{ config, pkgs, serverInfo, servicesPath, ... }: let @@ -31,7 +31,7 @@ let # Build the maintenance scripts and commit hooks. scripts = substituteInAll { name = "svn-server-scripts"; - src = pkgs.lib.cleanSource ../../../../services/subversion/src/scripts; + src = pkgs.lib.cleanSource "${servicesPath}/subversion/src/scripts"; # The variables to substitute: @@ -75,7 +75,7 @@ let # Build our custom authentication modules. - authModules = import ../../../../services/subversion/src/auth { + authModules = import "${servicesPath}/subversion/src/auth" { inherit (pkgs) stdenv apacheHttpd; }; @@ -115,7 +115,7 @@ let # Build ViewVC. - viewvc = import ../../../../services/subversion/src/viewvc { + viewvc = import "${servicesPath}/subversion/src/viewvc" { inherit (pkgs) fetchurl stdenv python enscript; inherit urlPrefix reposDir adminAddr subversion; }; @@ -149,7 +149,7 @@ let # Build WebSVN. - websvn = import ../../../../services/subversion/src/websvn { + websvn = import "${servicesPath}/subversion/src/websvn" { inherit (pkgs) fetchurl stdenv writeText enscript gnused diffutils; inherit urlPrefix reposDir subversion; cacheDir = tmpDir; @@ -232,7 +232,7 @@ let staticFiles = substituteInSome { name = "svn-static-files"; - src = pkgs.lib.cleanSource ../../../../services/subversion/root; + src = pkgs.lib.cleanSource "${servicesPath}/subversion/root"; files = ["xsl/svnindex.xsl"]; inherit urlPrefix; }; diff --git a/modules/services/web-servers/apache-httpd/tomcat-connector.nix b/modules/services/web-servers/apache-httpd/tomcat-connector.nix index f7662c9513f2..00cca42c6e01 100644 --- a/modules/services/web-servers/apache-httpd/tomcat-connector.nix +++ b/modules/services/web-servers/apache-httpd/tomcat-connector.nix @@ -1,4 +1,4 @@ -{config, pkgs, serverInfo}: +{ config, pkgs, serverInfo, ... }: let workersProperties = pkgs.writeText "workers.properties" '' diff --git a/modules/services/web-servers/apache-httpd/trac.nix b/modules/services/web-servers/apache-httpd/trac.nix index b50cd2aff7ea..ab27b385cb4a 100644 --- a/modules/services/web-servers/apache-httpd/trac.nix +++ b/modules/services/web-servers/apache-httpd/trac.nix @@ -1,4 +1,4 @@ -{config, pkgs, serverInfo}: +{ config, pkgs, serverInfo, ... }: let inherit (pkgs.lib) mkOption; diff --git a/modules/services/web-servers/apache-httpd/twiki.nix b/modules/services/web-servers/apache-httpd/twiki.nix index 7e524144e64f..e55197ade67e 100644 --- a/modules/services/web-servers/apache-httpd/twiki.nix +++ b/modules/services/web-servers/apache-httpd/twiki.nix @@ -1,4 +1,4 @@ -{config, pkgs, serverInfo}: +{ config, pkgs, serverInfo, ... }: let diff --git a/modules/services/web-servers/apache-httpd/zabbix.nix b/modules/services/web-servers/apache-httpd/zabbix.nix index de597f6c4da4..2d9a80f69ede 100644 --- a/modules/services/web-servers/apache-httpd/zabbix.nix +++ b/modules/services/web-servers/apache-httpd/zabbix.nix @@ -1,4 +1,4 @@ -{config, pkgs, serverInfo}: +{ config, pkgs, serverInfo, ... }: let diff --git a/release.nix b/release.nix index abf1ed956698..f2dd8e8bcbec 100644 --- a/release.nix +++ b/release.nix @@ -96,6 +96,14 @@ let module = ./modules/installer/cd-dvd/installation-cd-graphical.nix; description = "graphical"; }; + + + tests.subversion = + { services ? ../services }: + + (import ./tests/subversion.nix { + inherit nixpkgs services; + }).report; }; diff --git a/tests/subversion.nix b/tests/subversion.nix index 024d1fc36517..c55c3b5ea2cc 100644 --- a/tests/subversion.nix +++ b/tests/subversion.nix @@ -1,4 +1,9 @@ -with import ../lib/build-vms.nix {}; +{ nixos ? ./.. +, nixpkgs ? /etc/nixos/nixpkgs +, services ? /etc/nixos/services +}: + +with import ../lib/build-vms.nix { inherit nixos nixpkgs services; }; let