Improved things

This commit is contained in:
iko 2021-02-24 20:54:40 +03:00
parent a456437c53
commit 49cd72ec08
3 changed files with 31 additions and 75 deletions

View File

@ -1,3 +1,3 @@
{
"nixEnvSelector.nixShellConfig": "NOT_MODIFIED_ENV"
"nixEnvSelector.nixFile": "NOT_MODIFIED_ENV"
}

View File

@ -1,16 +1,30 @@
{ sources ? import nix/sources.nix { inherit system; }
, nixpkgs ? import sources.nixpkgs { inherit system; }
, system ? builtins.currentSystem
, ghc ? "ghc8103"
}:
let
proto3-suite' = import sources.proto3-suite { };
proto3-suite =
if system == "x86_64-linux" then proto3-suite'.proto3-suite-linux
else if system == "x86_64-darwin" then proto3-suite'.proto3-suite-darwin
else abort "proto3-suite only supports x86_64-linux and x86_64-darwin at the moment :(";
unbreak = x: x.overrideDerivation (_: {
broken = false;
});
overrides = (hself: hsuper: {
proto3-suite = nixpkgs.haskell.lib.dontCheck (nixpkgs.haskell.lib.doJailbreak (unbreak hsuper.proto3-suite));
proto3-wire =
hsuper.callHackageDirect
{
pkg = "proto3-wire";
ver = "1.2.0";
sha256 = "1jqz6zsli5zvlissy7mkgyrzkapjvgijx7kjva4fxjwdyd0hqix7";
} { };
haskell-src = nixpkgs.haskell.lib.doJailbreak (unbreak hsuper.haskell-src);
parameterized = nixpkgs.haskell.lib.dontCheck (nixpkgs.haskell.lib.doJailbreak (unbreak hsuper.parameterized));
});
haskell = nixpkgs.haskell.packages.${ghc}.override {
inherit overrides;
};
sawtooth-haskell-protos-src = nixpkgs.stdenv.mkDerivation {
name = "sawtooth-haskell-protos-src";
buildInputs = [ proto3-suite ];
buildInputs = [ haskell.proto3-suite ];
src = sources.sawtooth-core + "/protos";
buildPhase = ''
for f in *.proto
@ -35,59 +49,13 @@ let
};
sawtooth-haskell-protos =
nixpkgs.haskellPackages.callCabal2nix "sawtooth-haskell-protos" sawtooth-haskell-protos-src { };
sawtooth-haskell-protos-overlay = hself: hsuper: {
sawtooth-haskell-protos-overlay = nixpkgs.lib.composeExtensions overrides (hself: hsuper: {
sawtooth-haskell-protos = hsuper.callCabal2nix "sawtooth-haskell-protos" sawtooth-haskell-protos-src { };
haskell-src = nixpkgs.haskell.lib.doJailbreak (hsuper.callHackageDirect
{
pkg = "haskell-src";
ver = "1.0.3.1";
sha256 = "11s2qnnhchcbi6szvcglv4xxz3l6zw9w3pziycpwrigjvpigymd2";
} { }
);
insert-ordered-containers = hsuper.callHackageDirect
{
pkg = "insert-ordered-containers";
ver = "0.2.3.1";
sha256 = "0zxxjwzcsyc7a572f584w83aqygdc3q05pfarghj2v437nsnap29";
} { };
swagger2 = hsuper.callHackageDirect
{
pkg = "swagger2";
ver = "2.6";
sha256 = "0x0s34q9bmrik0vmzpc08r4jq5kbpb8x7h19ixhaakiafpjfm59l";
} { };
proto3-suite = nixpkgs.haskell.lib.dontCheck (hsuper.callHackageDirect
{
pkg = "proto3-suite";
ver = "0.4.0.2";
sha256 = "11bppmb524q6qvgyddi9s7pf1n1zs4ypqkqs2qb6i8nsgmxndd1l";
} { }
);
proto3-wire = hsuper.callHackageDirect
{
pkg = "proto3-wire";
ver = "1.2.0";
sha256 = "1jqz6zsli5zvlissy7mkgyrzkapjvgijx7kjva4fxjwdyd0hqix7";
} { };
http-media = nixpkgs.haskell.lib.doJailbreak (hsuper.callHackageDirect
{
pkg = "http-media";
ver = "0.8.0.0";
sha256 = "080xkljq1iq0i8wagg8kbzbp523p2awa98wpn9i4ph1dq8y8346y";
} { }
);
parameterized = nixpkgs.haskell.lib.dontCheck (hsuper.callHackageDirect
{
pkg = "parameterized";
ver = "0.5.0.0";
sha256 = "sha256-FB3E0ChUG1x6uYE8fL7hcncS5Xg0mqNOxc7KlLhEdB0=";
} { }
);
};
});
in
{
inherit sawtooth-haskell-protos-src sawtooth-haskell-protos-overlay;
build = (nixpkgs.haskell.packages.ghc882.override {
build = (nixpkgs.haskell.packages.${ghc}.override {
overrides = sawtooth-haskell-protos-overlay;
}).sawtooth-haskell-protos;
}

View File

@ -5,34 +5,22 @@
"homepage": "https://github.com/nmattia/niv",
"owner": "nmattia",
"repo": "niv",
"rev": "ba57d5a29b4e0f2085917010380ef3ddc3cf380f",
"sha256": "1kpsvc53x821cmjg1khvp1nz7906gczq8mp83664cr15h94sh8i4",
"rev": "af958e8057f345ee1aca714c1247ef3ba1c15f5e",
"sha256": "1qjavxabbrsh73yck5dcq8jggvh3r2jkbr6b5nlz5d9yrqm9255n",
"type": "tarball",
"url": "https://github.com/nmattia/niv/archive/ba57d5a29b4e0f2085917010380ef3ddc3cf380f.tar.gz",
"url": "https://github.com/nmattia/niv/archive/af958e8057f345ee1aca714c1247ef3ba1c15f5e.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "release-20.09",
"branch": "nixpkgs-unstable",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7d71d3dc80c3f42600d3ff21ba0029ad0c217067",
"sha256": "1ni0wmzjzl2p7nbh8sknxff9cpga82cvfixqlk3sz3s667x5nbsn",
"rev": "a346c68411cc2fe0392e8905f9300fa0973cf1b4",
"sha256": "19jqyps2pgb7ps8pp4nxr8zh44fps1flb46gkz6cdg9lysgfi4a2",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/7d71d3dc80c3f42600d3ff21ba0029ad0c217067.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"proto3-suite": {
"branch": "master",
"description": " Haskell Protobuf Implementation",
"homepage": null,
"owner": "awakesecurity",
"repo": "proto3-suite",
"rev": "0af901f9ef3b9719e08eae4fab8fd700d6c8047a",
"sha256": "0mpy35r6qd1v5sixhy2lqcn5x81rfj4dc079g1kpa4fb1f23dbha",
"type": "tarball",
"url": "https://github.com/awakesecurity/proto3-suite/archive/0af901f9ef3b9719e08eae4fab8fd700d6c8047a.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/a346c68411cc2fe0392e8905f9300fa0973cf1b4.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"sawtooth-core": {