Navigation Menu

Skip to content

Commit

Permalink
Clean up nix infrastructure for ease of use (#716)
Browse files Browse the repository at this point in the history
* Better nix structure, revert aeson patch pin

* Update gitlab build

* Move singleton-bool ghcjs pin downstream

* Disable GHCJS in CI
  • Loading branch information
mightybyte authored and emilypi committed Oct 27, 2019
1 parent d2891d3 commit 7e3f454
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 85 deletions.
21 changes: 8 additions & 13 deletions .gitlab-ci.yml
Expand Up @@ -7,10 +7,11 @@ pact-macos:
tags:
- macos
script:
- nix-build -A proj.ghc.pact
- nix-build -A proj.ghc.pact.doc
- nix-build -A proj.ghcjs.pact
- nix-build -A proj.ghcjs.pact.doc
- nix-build
- nix-build project.nix -A proj.ghc.pact.doc
# Disabling until singleton-bool issue is fixed
# See also https://github.com/reflex-frp/reflex-platform/issues/549
# - nix-build project.nix -A proj.ghcjs.pact
# - ./collectArtifacts.sh macos
# artifacts:
# paths:
Expand All @@ -21,20 +22,14 @@ pact-linux:
tags:
- linux
script:
- nix-build -A proj.ghc.pact
- nix-build -A proj.ghcjs.pact
- nix-build
# Disabling until singleton-bool issue is fixed
# - nix-build project.nix -A proj.ghcjs.pact
# - ./collectArtifacts.sh linux
# artifacts:
# paths:
# - public-linux/

# deploy-nix-cache:
# stage: deploy
# allow_failure: true
# script:
# - if [ ! "$CACHIX_SIGNING_KEY" = "" ]; then nix-instantiate | cachix push pact fi
# - if [ ! "$CACHIX_SIGNING_KEY" = "" ]; then nix-instantiate shell.nix | cachix push pact fi

# pages:
# stage: deploy
# script:
Expand Down
53 changes: 1 addition & 52 deletions default.nix
@@ -1,52 +1 @@
{ rpRef ? "9afc9a2a1864e5a89981a4959a88c646e7441549"
, rpSha ? "0rkc6h4mfi5j4d4735b0l7ic6dvww4vdxjwd3kninj5rjlkddhfd"
, system ? builtins.currentSystem
}:

let rpSrc = builtins.fetchTarball {
url = "https://github.com/reflex-frp/reflex-platform/archive/${rpRef}.tar.gz";
sha256 = rpSha;
};
overlay = self: super: {
z3 = super.z3.overrideAttrs (drv: {
name = "z3-4.8.5";
version = "4.8.5";
patches = [];
src = self.fetchFromGitHub {
owner = "Z3Prover";
repo = "z3";
rev = "e79542cc689d52ec4cb34ce4ae3fbe56e7a0bf70";
sha256 = "11sy98clv7ln0a5vqxzvh6wwqbswsjbik2084hav5kfws4xvklfa";
};
});
};
rp = import rpSrc { inherit system; nixpkgsOverlays = [ overlay ]; };
in {
inherit rpRef rpSha rpSrc overlay rp;
proj =
rp.project ({ pkgs, hackGet, ... }:
let gitignore = pkgs.callPackage (pkgs.fetchFromGitHub {
owner = "siers";
repo = "nix-gitignore";
rev = "4f2d85f2f1aa4c6bff2d9fcfd3caad443f35476e";
sha256 = "1vzfi3i3fpl8wqs1yq95jzdi6cpaby80n8xwnwa8h2jvcw3j7kdz";
}) {};
in
{
name = "pact";
overrides = self: super: (import ./overrides.nix pkgs hackGet self super) // {
};
packages = {
pact = gitignore.gitignoreSource [".git" ".gitlab-ci.yml" "CHANGELOG.md" "README.md"] ./.;
};
shellToolOverrides = ghc: super: {
z3 = pkgs.z3;
stack = pkgs.stack;
};
shells = {
ghc = ["pact"];
ghcjs = ["pact"];
};

});
}
(import ./project.nix {}).proj.ghc.pact
29 changes: 10 additions & 19 deletions overrides.nix
Expand Up @@ -20,12 +20,11 @@ in {

Glob = whenGhcjs dontCheck super.Glob;

aeson = dontCheck (self.callCabal2nix "aeson" (pkgs.fetchFromGitHub {
owner = "obsidiansystems";
repo = "aeson";
rev = "d6288c431a477f9a6e93aa80454a9e1712127548"; # branch v1450-text-jsstring containing (ToJSVal Value) instance and other fixes
sha256 = "102hj9b42z1h9p634g9226nvs756djwadrkz9yrb15na671f2xf4";
}) {});
aeson = dontCheck (callHackageDirect {
pkg = "aeson";
ver = "1.4.5.0";
sha256 = "0imcy5kkgrdrdv7zkhkjvwpdp4sms5jba708xsap1vl9c2s63n5a";
});

algebraic-graphs = whenGhcjs dontCheck super.algebraic-graphs;
base-compat-batteries = whenGhcjs dontCheck super.base-compat-batteries;
Expand Down Expand Up @@ -94,19 +93,11 @@ in {
sha256 = "1isa8p9dnahkljwj0kz10119dwiycf11jvzdc934lnjv1spxkc9k";
});

# https://github.com/reflex-frp/reflex-platform/issues/549
singleton-bool = overrideCabal
(self.callCabal2nix "singleton-bool" (pkgs.fetchFromGitHub {
owner = "obsidiansystems";
repo = "singleton-bool";
rev = "bf5c81fff6eaa9ed1286de9d0ecfffa7e0aa85d2";
sha256 = "0fzi6f5pl2gg9k8f7k88qyyvjflpcw08905y0vjmbylzc70wsykw";
}) {})
(drv: {
editedCabalFile = null;
revision = null;
})
;
singleton-bool = dontCheck (callHackageDirect {
pkg = "singleton-bool";
ver = "0.1.5";
sha256 = "1kjn5wgwgxdw2xk32d645v3ss2a70v3bzrihjdr2wbj2l4ydcah1";
});

servant = dontCheck (self.callCabal2nix "servant" "${servantSrc}/servant" {});
servant-client = dontCheck (self.callCabal2nix "servant-client" "${servantSrc}/servant-client" {});
Expand Down
52 changes: 52 additions & 0 deletions project.nix
@@ -0,0 +1,52 @@
{ rpRef ? "9afc9a2a1864e5a89981a4959a88c646e7441549"
, rpSha ? "0rkc6h4mfi5j4d4735b0l7ic6dvww4vdxjwd3kninj5rjlkddhfd"
, system ? builtins.currentSystem
}:

let rpSrc = builtins.fetchTarball {
url = "https://github.com/reflex-frp/reflex-platform/archive/${rpRef}.tar.gz";
sha256 = rpSha;
};
overlay = self: super: {
z3 = super.z3.overrideAttrs (drv: {
name = "z3-4.8.5";
version = "4.8.5";
patches = [];
src = self.fetchFromGitHub {
owner = "Z3Prover";
repo = "z3";
rev = "e79542cc689d52ec4cb34ce4ae3fbe56e7a0bf70";
sha256 = "11sy98clv7ln0a5vqxzvh6wwqbswsjbik2084hav5kfws4xvklfa";
};
});
};
rp = import rpSrc { inherit system; nixpkgsOverlays = [ overlay ]; };
in {
inherit rpRef rpSha rpSrc overlay rp;
proj =
rp.project ({ pkgs, hackGet, ... }:
let gitignore = pkgs.callPackage (pkgs.fetchFromGitHub {
owner = "siers";
repo = "nix-gitignore";
rev = "4f2d85f2f1aa4c6bff2d9fcfd3caad443f35476e";
sha256 = "1vzfi3i3fpl8wqs1yq95jzdi6cpaby80n8xwnwa8h2jvcw3j7kdz";
}) {};
in
{
name = "pact";
overrides = self: super: (import ./overrides.nix pkgs hackGet self super) // {
};
packages = {
pact = gitignore.gitignoreSource [".git" ".gitlab-ci.yml" "CHANGELOG.md" "README.md"] ./.;
};
shellToolOverrides = ghc: super: {
z3 = pkgs.z3;
stack = pkgs.stack;
};
shells = {
ghc = ["pact"];
ghcjs = ["pact"];
};

});
}
2 changes: 1 addition & 1 deletion shell.nix
@@ -1 +1 @@
(import ./. {}).proj.shells.ghc
(import ./project.nix {}).proj.shells.ghc

0 comments on commit 7e3f454

Please sign in to comment.