nixpkgs-update/pkgs/default.nix

73 lines
1.8 KiB
Nix
Raw Normal View History

2021-08-25 06:23:54 +03:00
{ nixpkgs
, nixpkgs-review
, mmdoc
, system
, self
, ...
}:
let
pkgs = import nixpkgs { inherit system; config = { allowBroken = true; }; };
developPackageAttrs = {
name = "nixpkgs-update";
root = self;
returnShellEnv = false;
};
drvAttrs = attrs: with pkgs; {
NIX = nix;
GIT = git;
HUB = gitAndTools.hub;
JQ = jq;
TREE = tree;
GIST = gist;
# TODO: are there more coreutils paths that need locking down?
TIMEOUT = coreutils;
NIXPKGSREVIEW = (import nixpkgs-review { inherit pkgs; });
};
haskellPackages = pkgs.haskellPackages.override {
overrides = _: haskellPackages: {
polysemy-plugin = pkgs.haskell.lib.dontCheck haskellPackages.polysemy-plugin;
polysemy = pkgs.haskell.lib.dontCheck haskellPackages.polysemy;
nixpkgs-update =
pkgs.haskell.lib.justStaticExecutables (
pkgs.haskell.lib.failOnAllWarnings (
pkgs.haskell.lib.disableExecutableProfiling (
pkgs.haskell.lib.disableLibraryProfiling (
pkgs.haskell.lib.generateOptparseApplicativeCompletion "nixpkgs-update" (
(haskellPackages.developPackage developPackageAttrs).overrideAttrs drvAttrs
)
)
)
)
);
};
};
shell = haskellPackages.shellFor {
nativeBuildInputs = with pkgs; [
cabal-install
ghcid
];
packages = ps: [ ps.nixpkgs-update ];
shellHook = ''
'';
};
doc = pkgs.stdenvNoCC.mkDerivation rec {
name = "nixpkgs-update-doc";
src = self;
phases = [ "mmdocPhase" ];
mmdocPhase = "${mmdoc.packages.${system}.mmdoc}/bin/mmdoc nixpkgs-update $src/doc $out";
};
in
{
nixpkgs-update = haskellPackages.nixpkgs-update;
nixpkgs-update-doc = doc;
devShell = shell;
}