cleverca22
6/12/2016 - 12:14 PM

default.nix

{ nixpkgs, declInput }: 

let 
  pkgs = import nixpkgs {}; 

  teethBranch = branch: {
    enabled = 1;
    hidden = false;
    description = "teeth ${branch}";
    nixexprinput = "src";
    nixexprpath = "release.nix";
    checkinterval = 60;
    schedulingshares = 100;
    enableemail = true;
    emailoverride = "";
    keepnr = 3;
    inputs = {
      src = { 
        type = "git"; 
        value = "git://github.com/expipiplus1/teeth.git ${branch}";
        emailresponsible = true; 
      };
      nixpkgs = { 
        type = "git"; 
        value = "git://github.com/NixOS/nixpkgs.git release-16.03";
        emailresponsible = false; 
      };
    };
  };

  genSpec = writeTextFile {
    name = "spec.conf";
    text = builtins.toJSON {
      teeth = teethBranch "master";
      teeth-ghc8 = teethBranch "ghc8";
    };
    destination = "/spec.conf";
  };

  printInput = pkgs.runCommand "" {} ''
    cat <<EOF
    ${builtins.toXML declInput}
    EOF
  '';

in {
  jobsets = buildEnv {
    name = "jobsets";
    paths = [ printInput genSpec ];
  };
}