[Nix-dev] Hydra to build RPMs

stewart mackenzie setori88 at gmail.com
Thu Dec 4 04:58:09 CET 2014


Hi all,

So the below is a hydra release.nix used to do CI.

Steps to replicate:
* setup a hydra jobset
* configure a jobset to point to github.com/processone/ejabberd
* another to the git repo containing the below release.nix
* add another jobset pointing to github.com/nixos/nixpkgs repo
* let hydra run it

What I expect to happen:
I want hydra to build the codes of ejabberd then package it as an RPM.
I'd like to have two jobsets one for the RPM and the other a normal nixBuild.

What happens:
Hydra's UI displays this error message:
"
in job ‘fedora13_x86_64’:
value is a function while a set was expected, at
[1m/nix/store/hqkfnyz4h7lgsbp5vs7a33za2m27xaif-git-export/release.nix
[0m:56:27
"

Release.nix contents:

let
  pkgs = import <nixpkgs> {}; #obtained from hydra's UI jobset

  makeRPM =
    diskImageFun:
    { c-ejabberd, nixpkgs }:

    with import nixpkgs.path {};

    releaseTools.rpmBuild rec {
      name = "c-ejabberd-rpm-${diskImage.name}";
      src = c-ejabberd;
      diskImage = diskImageFun vmTools.diskImages;
#      meta.schedulingPriority = "4";  # low priority
    };

  makeDeb =
    diskImageFun:
    { c-ejabberd, nixpkgs}:

    with import nixpkgs.path {};

    releaseTools.debBuild rec {
      name = "c-ejabberd-deb-${diskImage.name}";
      src = c-ejabberd;
      diskImage = diskImageFun vmTools.diskImages;
#      meta.schedulingPriority = "5";  # low priority
    };

  jobs = rec {

    c-ejabberd = pkgs.stdenv.mkDerivation rec {
          name = "c-ejabberd";
          src = <c-ejabberd>; #obtained from hydra's UI jobset
#      preHook = ''set -x;'';
          dontPatchELF = true;
          dontPatchShebangs = true;
          buildInputs = ( with pkgs; [
              expat erlang zlib openssl pam automake
              autoconf git libyaml openssh libcouchbase
             ]);
          preConfigure = "./autogen.sh";
      };

     #debian50_i386 = makeDeb "i686-linux" (diskImages:
diskImages.debian50i386);
     # TODO: For RPM distros, we'd need a `.spec' file. No idea how to do it.
     fedora13_x86_64 = makeRPM "x86_64-linux" (diskImages:
diskImages.fedora13x86_64);
     # opensuse110x86_64 = makeRPM "x86_64-linux" (diskImages:
diskImages.opensuse110x86_64);
  };
in
  jobs

Thank you kindly

Stewart


More information about the nix-dev mailing list