summaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2014-06-28 11:16:46 +0200
committerPetr Rockai <prockai@redhat.com>2015-02-05 13:47:19 +0100
commit6380869f27bfd4f271cb1c8ba3d023e1c94f77fd (patch)
tree5f377a8be8c1090227dbce6f6ae12d86acd74b8d /nix
parent2b6f9152ccbc74ab4c599089dc6bf0ae43ccd123 (diff)
downloadlvm2-6380869f27bfd4f271cb1c8ba3d023e1c94f77fd.tar.gz
NIX: Use nixpkgs kernel for building, distro kernel for testing.
Diffstat (limited to 'nix')
-rw-r--r--nix/default.nix18
1 files changed, 11 insertions, 7 deletions
diff --git a/nix/default.nix b/nix/default.nix
index 843440e64..b6a4f9886 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -229,10 +229,11 @@ let
};
};
- vm = pkgs: xmods: with lib; rec {
+ vm = { pkgs, xmods, dmmods ? false }: with lib; rec {
tools = import "${nixpkgs}/pkgs/build-support/vm/default.nix" {
inherit pkgs; rootModules = rootmods ++ xmods ++
- [ "loop" "dm_mod" "dm_snapshot" "dm_mirror" "dm_zero" "dm_raid" "dm_thin_pool" ]; };
+ (if dmmods then [ "loop" "dm_mod" "dm_snapshot" "dm_mirror" "dm_zero" "dm_raid" "dm_thin_pool" ]
+ else []); };
release = import "${nixpkgs}/pkgs/build-support/release/default.nix" {
pkgs = pkgs // { vmTools = tools; }; };
imgs = tools.diskImageFuns //
@@ -262,11 +263,13 @@ let
rawhide = fedora19;
};
- wrapper = fun: { arch, image, build ? {} }: with lib;
- let use = vm (if eqStrings arch "i386" then pkgs.pkgsi686Linux else pkgs)
- (if image == "centos64" || image == "centos65" then [] else [ "9p" "9pnet_virtio" ]);
+ wrapper = fun: { arch, image, build ? {}, istest ? false }: with lib;
+ let use = vm { pkgs = if eqStrings arch "i386" then pkgs.pkgsi686Linux else pkgs;
+ xmods = if istest && (image == "centos64" || image == "centos65")
+ then [] else [ "9p" "9pnet_virtio" ];
+ dmmods = istest; };
in fun {
- inherit build;
+ inherit build istest;
VM = use.rpmbuild;
diskFun = builtins.getAttr "${image}${arch}" use.imgs;
extras = extra_rpms.common ++ builtins.getAttr image extra_rpms;
@@ -301,7 +304,8 @@ let
};
rpms = lib.mapAttrs (n: v: wrapper mkBuild v) configs;
- tests = lib.mapAttrs (n: v: wrapper mkTest (v // { build = builtins.getAttr n rpms; })) configs;
+ tests = let make = n: v: wrapper mkTest (v // { build = builtins.getAttr n rpms; istest = true; });
+ in lib.mapAttrs make configs;
jobs = tests // {
tarball = pkgs.releaseTools.sourceTarball rec {