1
1
mirror of https://github.com/srid/rib.git synced 2024-11-22 11:23:02 +03:00
rib/default.nix
Sridhar Ratnakumar 4b3d374aec Advance nixpkgs
2020-05-11 21:32:54 -04:00

46 lines
1.6 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 = "cfe68f2b68b7";
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; {
} // (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);
}