mirror of
https://github.com/srid/rib.git
synced 2024-11-25 19:54:33 +03:00
30676c26a7
Eg: that of reflex-platform
47 lines
1.7 KiB
Nix
47 lines
1.7 KiB
Nix
let
|
|
# Use https://status.nixos.org// to find the next hash to update nixpkgs to.
|
|
# Look for the "Last updated" commit hash for the entry `nixpkgs-unstable`
|
|
nixpkgsRev = "05f0934825c2";
|
|
|
|
inherit (import (builtins.fetchTarball "https://github.com/hercules-ci/gitignore/archive/7415c4f.tar.gz") { }) gitignoreSource;
|
|
ribRoot = gitignoreSource ./.;
|
|
in {
|
|
pkgs ? import (builtins.fetchTarball "https://github.com/nixos/nixpkgs/archive/${nixpkgsRev}.tar.gz") {}
|
|
, compiler ? pkgs.haskellPackages
|
|
, root ? ribRoot
|
|
, name ? "rib"
|
|
, source-overrides ? {}
|
|
, overrides ? self: super: {}
|
|
, additional-packages ? _: []
|
|
, ...
|
|
}:
|
|
let
|
|
optionals = pkgs.lib.lists.optionals;
|
|
in
|
|
compiler.developPackage {
|
|
inherit root name;
|
|
source-overrides = {
|
|
rib = ribRoot;
|
|
} // source-overrides;
|
|
overrides = self: super: with pkgs.haskell.lib; {
|
|
with-utf8 = super.callHackage "with-utf8" "1.0.1.0" {};
|
|
} // (overrides self super);
|
|
modifier = with pkgs.haskell.lib;
|
|
let
|
|
addRibDeps = drv:
|
|
addBuildTools drv (with pkgs.haskellPackages;
|
|
[ cabal-install
|
|
ghcid
|
|
]
|
|
# Additional packages would be available in `nix-build` as well, only
|
|
# as long as the built executable references it. When using as a
|
|
# Haskell library, however, you will have to override the package and
|
|
# add it to propagateBuildInputs (see neuron for an example).
|
|
++ additional-packages pkgs
|
|
# Shake recommends fsatrace, but it requires system configuration on
|
|
# macOS.
|
|
++ optionals (builtins.currentSystem == "x86_64-linux") [pkgs.fsatrace]
|
|
);
|
|
in drv: addRibDeps (dontHaddock drv);
|
|
}
|