Merge branch 'master' into clean-up-default-nix

This commit is contained in:
Ryan Trinkle 2018-11-18 15:33:43 -05:00 committed by GitHub
commit d3682a9391
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 119 additions and 0 deletions

View file

@ -83,6 +83,10 @@ drv = haskellPackages.developPackage {
configureFlags =
pkgs.stdenv.lib.optional doTracing "--flags=tracing"
++ pkgs.stdenv.lib.optional doStrict "--ghc-options=-Werror";
passthru = {
nixpkgs = pkgs;
};
});
inherit returnShellEnv;

29
hydra.json Normal file
View file

@ -0,0 +1,29 @@
{
"enabled": 1,
"hidden": true,
"description": "Jobsets",
"nixexprinput": "src",
"nixexprpath": "jobsets.nix",
"checkinterval": 300,
"schedulingshares": 100,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"src": {
"type": "git",
"value": "https://github.com/haskell-nix/hnix.git master 1",
"emailresponsible": false
},
"nixpkgs": {
"type": "git",
"value": "https://github.com/NixOS/nixpkgs-channels nixos-unstable",
"emailresponsible": false
},
"prs": {
"type": "githubpulls",
"value": "haskell-nix hnix",
"emailresponsible": false
}
}
}

66
jobsets.nix Normal file
View file

@ -0,0 +1,66 @@
{ prs }:
let
self = import ./. {};
pkgs = self.nixpkgs;
mkFetchGithub = value: {
inherit value;
type = "git";
emailresponsible = false;
};
in
with pkgs.lib;
let
defaults = jobs: {
inherit (jobs) description;
enabled = 1;
hidden = false;
keepnr = 10;
schedulingshares = 100;
checkinterval = 120;
enableemail = false;
emailoverride = "";
nixexprinput = "hnix";
nixexprpath = "release.nix";
inputs = jobs.inputs // {
nixpkgs = {
type = "git";
value = "https://github.com/NixOS/nixpkgs-channels nixos-unstable";
emailresponsible = false;
};
};
};
branchJobset = branch: defaults {
description = "hnix-${branch}";
inputs = {
hnix = {
value = "https://github.com/haskell-nix/hnix ${branch}";
type = "git";
emailresponsible = false;
};
};
};
makePr = num: info: {
name = "hnix-pr-${num}";
value = defaults {
description = "#${num}: ${info.title}";
inputs = {
hnix = {
#NOTE: This should really use "pull/${num}/merge"; however, GitHub's
#status checks only operate on PR heads. This creates a race
#condition, which can currently only be solved by requiring PRs to be
#up to date before they're merged. See
#https://github.com/isaacs/github/issues/1002
value = "https://github.com/haskell-nix/hnix pull/${num}/head 1";
type = "git";
emailresponsible = false;
};
};
};
};
processedPrs = mapAttrs' makePr (builtins.fromJSON (builtins.readFile prs));
jobsetsAttrs = processedPrs //
genAttrs ["master" "pending"] branchJobset;
in {
jobsets = pkgs.writeText "spec.json" (builtins.toJSON jobsetsAttrs);
}

20
release.nix Normal file
View file

@ -0,0 +1,20 @@
{}:
let matrix = [
{ compiler = "ghc843"; doStrict = false; doTracing = false; }
{ compiler = "ghc843"; doStrict = false; doTracing = true; }
# Broken
# { compiler = "ghc802"; doStrict = false; doTracing = false; }
# { compiler = "ghc802"; doStrict = false; doTracing = true; }
# Deprecated
# { compiler = "ghc822"; doStrict = true; doTracing = false; }
# { compiler = "ghc822"; doStrict = true; doTracing = true; }
# Broken
# { compiler = "ghcjs"; doStrict = false; doTracing = false; }
];
boolToString = x: if x then "true" else "false";
nameForConfig = {compiler, doStrict, doTracing}: builtins.concatStringsSep "-"
[ compiler (boolToString doStrict) (boolToString doTracing) ];
in builtins.listToAttrs (map (args: { name = nameForConfig args; value = import ./. args; }) matrix)