-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add haskell.nix to release.nix and shell.nix
- Loading branch information
Showing
20 changed files
with
199 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,4 @@ hsenv.log | |
/ghci-tmp | ||
*.dump-* | ||
*.verbose-core2core | ||
.nix |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"owner": "input-output-hk", | ||
"repo": "haskell.nix", | ||
"branch": "master", | ||
"private": false, | ||
"rev": "d8c50dcaf3d3d589829ee9be9d5dba8279b8cc59", | ||
"sha256": "0a5hgryz6nszmy67yf1aks399h2aw0nj845518c4prs5c6ns1z7p" | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"owner": "ymeister", | ||
"repo": "nix-haskell", | ||
"branch": "main", | ||
"private": false, | ||
"rev": "6e8f6d87bda381f40461af5b8f7420fb58c5a1b3", | ||
"sha256": "0scnj4rxfss574cik8bvd6d5xnk2n9jrkhmmfycyxaam8i3srcg6" | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# DO NOT HAND-EDIT THIS FILE | ||
import (import ./thunk.nix) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# DO NOT HAND-EDIT THIS FILE | ||
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }: | ||
if !fetchSubmodules && !private then builtins.fetchTarball { | ||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256; | ||
} else (import (builtins.fetchTarball { | ||
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz"; | ||
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr"; | ||
}) {}).fetchFromGitHub { | ||
inherit owner repo rev sha256 fetchSubmodules private; | ||
}; | ||
json = builtins.fromJSON (builtins.readFile ./github.json); | ||
in fetch json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# DO NOT HAND-EDIT THIS FILE | ||
import (import ./thunk.nix) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# DO NOT HAND-EDIT THIS FILE | ||
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }: | ||
if !fetchSubmodules && !private then builtins.fetchTarball { | ||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256; | ||
} else (import (builtins.fetchTarball { | ||
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz"; | ||
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr"; | ||
}) {}).fetchFromGitHub { | ||
inherit owner repo rev sha256 fetchSubmodules private; | ||
}; | ||
json = builtins.fromJSON (builtins.readFile ./github.json); | ||
in fetch json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ haskellNix ? ../deps/haskell.nix }: | ||
|
||
let haskell = import ../deps/nix-haskell { inherit haskellNix; }; | ||
pkgs = haskell.pkgs; | ||
|
||
platforms = [ | ||
"gnu64" | ||
"ghcjs" | ||
]; | ||
compilers = [ | ||
"ghc94" | ||
"ghc96" | ||
"ghc98" | ||
"ghc910" | ||
]; | ||
|
||
project = compiler: (haskell.project { | ||
project = { | ||
src = ../../.; | ||
compiler-nix-name = compiler; | ||
}; | ||
}); | ||
|
||
perCompiler = proj: with pkgs.lib; genAttrs compilers (compiler: | ||
proj compiler | ||
); | ||
perPlatform = with pkgs.lib; genAttrs platforms (platform: | ||
perCompiler (compiler: (project compiler).projectCross.${platform}.projectCoverageReport) | ||
); | ||
|
||
in with pkgs.lib; pkgs.runCommand "release" {} '' | ||
mkdir -p $out | ||
${ | ||
concatStringsSep "\n" | ||
(forEach platforms (platform: | ||
concatStringsSep "\n" | ||
(forEach compilers (compiler: '' | ||
mkdir -p "$out/${platform}" | ||
ln -s "${perPlatform.${platform}.${compiler}}" "$out/${platform}/${compiler}" | ||
'')) | ||
)) | ||
} | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ reflex-platform-fun ? import ../deps/reflex-platform | ||
}: | ||
|
||
let native-reflex-platform = reflex-platform-fun { __useNewerCompiler = true; }; | ||
inherit (native-reflex-platform.nixpkgs) lib; | ||
systems = [ | ||
"x86_64-linux" | ||
# "x86_64-darwin" | ||
]; | ||
|
||
perPlatform = lib.genAttrs systems (system: let | ||
srcFilter = | ||
builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [ | ||
"release.nix" | ||
".git" | ||
"dist" | ||
"dist-newstyle" | ||
"cabal.haskell-ci" | ||
"cabal.project" | ||
".travis.yml" | ||
])); | ||
reflex-platform = reflex-platform-fun { inherit system; __useNewerCompiler = true; }; | ||
compilers = [ | ||
"ghc" | ||
"ghcjs" | ||
] ++ lib.optionals (reflex-platform.androidSupport) [ | ||
"ghcAndroidAarch64" | ||
"ghcAndroidAarch32" | ||
] ++ lib.optionals (reflex-platform.iosSupport) [ | ||
"ghcIosAarch64" | ||
]; | ||
nixpkgsGhcs = | ||
let | ||
pkgs = import ../deps/nixpkgs { inherit system; }; | ||
nixGhc945 = pkgs.haskell.packages.ghc945.override { | ||
}; | ||
nixGhc961 = pkgs.haskell.packages.ghc961.override { | ||
}; | ||
in | ||
{ | ||
ghc945 = nixGhc945.callCabal2nix "patch" srcFilter {}; | ||
ghc961 = nixGhc961.callCabal2nix "patch" srcFilter {}; | ||
}; | ||
compilerPkgs = lib.genAttrs compilers (ghc: let | ||
reflex-platform = reflex-platform-fun { | ||
inherit system; | ||
__useNewerCompiler = true; | ||
haskellOverlays = [ | ||
# Use this package's source for reflex | ||
(self: super: { | ||
_dep = super._dep // { | ||
patch = srcFilter ../../.; | ||
}; | ||
}) | ||
]; | ||
}; | ||
in reflex-platform.${ghc}.patch); | ||
in compilerPkgs // nixpkgsGhcs // { | ||
cache = reflex-platform.pinBuildInputs "patch-${system}" | ||
(builtins.attrValues compilerPkgs); | ||
}); | ||
|
||
metaCache = native-reflex-platform.pinBuildInputs "patch-everywhere" | ||
(map (a: a.cache) (builtins.attrValues perPlatform)); | ||
|
||
in perPlatform // { inherit metaCache; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ haskellNix ? ../deps/haskell.nix }: | ||
|
||
let haskell = import ../deps/nix-haskell { inherit haskellNix; }; | ||
|
||
project = haskell.project { | ||
project = { | ||
src = ../../.; | ||
compiler-nix-name = "ghc910"; | ||
}; | ||
}; | ||
|
||
in project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
let | ||
rp = import ../deps/reflex-platform { __useNewerCompiler = true; }; | ||
pkgs = rp.nixpkgs; | ||
system = builtins.currentSystem; | ||
in | ||
pkgs.mkShell { | ||
name = "shell"; | ||
buildInputs = [ | ||
pkgs.cabal-install | ||
pkgs.ghcid | ||
]; | ||
inputsFrom = [ | ||
(import ../release/reflex-platform.nix {}).${system}.ghc.env | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,11 @@ | ||
{ reflex-platform-fun ? import ./dep/reflex-platform | ||
}: | ||
{ pkgs ? import <nixpkgs> {} }: | ||
|
||
let | ||
native-reflex-platform = reflex-platform-fun { __useNewerCompiler = true; }; | ||
inherit (native-reflex-platform.nixpkgs) lib; | ||
systems = ["x86_64-linux"]; | ||
let reflex-platform-release = import ./nix/release/reflex-platform.nix {}; | ||
haskell-nix-release = import ./nix/release/haskell.nix {}; | ||
|
||
perPlatform = lib.genAttrs systems (system: let | ||
reflex-platform = reflex-platform-fun { inherit system; __useNewerCompiler = true; }; | ||
compilers = [ | ||
"ghc" | ||
"ghcjs" | ||
] ++ lib.optionals (reflex-platform.androidSupport) [ | ||
"ghcAndroidAarch64" | ||
"ghcAndroidAarch32" | ||
] ++ lib.optionals (reflex-platform.iosSupport) [ | ||
"ghcIosAarch64" | ||
]; | ||
nixpkgsGhcs = | ||
let | ||
pkgs = import ./nixpkgs { inherit system; }; | ||
nixGhc945 = pkgs.haskell.packages.ghc945.override { | ||
}; | ||
nixGhc961 = pkgs.haskell.packages.ghc961.override { | ||
}; | ||
in | ||
{ | ||
ghc945 = nixGhc945.callCabal2nix "patch" (import ./src.nix) {}; | ||
ghc961 = nixGhc961.callCabal2nix "patch" (import ./src.nix) {}; | ||
}; | ||
compilerPkgs = lib.genAttrs compilers (ghc: let | ||
reflex-platform = reflex-platform-fun { | ||
inherit system; | ||
__useNewerCompiler = true; | ||
haskellOverlays = [ | ||
# Use this package's source for reflex | ||
(self: super: { | ||
_dep = super._dep // { | ||
patch = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [ | ||
"release.nix" | ||
".git" | ||
"dist" | ||
"dist-newstyle" | ||
"cabal.haskell-ci" | ||
"cabal.project" | ||
".travis.yml" | ||
])) ./.; | ||
}; | ||
}) | ||
]; | ||
}; | ||
in reflex-platform.${ghc}.patch); | ||
in compilerPkgs // nixpkgsGhcs // { | ||
cache = reflex-platform.pinBuildInputs "patch-${system}" | ||
(builtins.attrValues compilerPkgs); | ||
}); | ||
in pkgs.runCommand "release" {} '' | ||
mkdir -p $out | ||
metaCache = native-reflex-platform.pinBuildInputs "patch-everywhere" | ||
(map (a: a.cache) (builtins.attrValues perPlatform)); | ||
|
||
in perPlatform // { inherit metaCache; } | ||
ln -s ${reflex-platform-release.metaCache} $out/reflex-platform | ||
ln -s ${haskell-nix-release} $out/haskell-nix | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
let | ||
rp = import ./dep/reflex-platform { __useNewerCompiler = true; }; | ||
pkgs = rp.nixpkgs; | ||
system = builtins.currentSystem; | ||
in | ||
pkgs.mkShell { | ||
name = "shell"; | ||
buildInputs = [ | ||
pkgs.cabal-install | ||
pkgs.ghcid | ||
]; | ||
inputsFrom = [ | ||
(import ./release.nix {}).${system}.ghc.env | ||
]; | ||
} | ||
{ pkgs ? import <nixpkgs> {} }: | ||
|
||
let reflex-platform-shell = import ./nix/shell/reflex-platform.nix; | ||
haskell-nix-shell = import ./nix/shell/haskell.nix {}; | ||
|
||
in { | ||
inherit reflex-platform-shell; | ||
inherit haskell-nix-shell; | ||
} |