2020-06-10 07:30:48 +03:00
|
|
|
{
|
|
|
|
description = "A flake for nixpkgs-update";
|
|
|
|
|
2020-10-18 19:31:10 +03:00
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
|
2020-10-18 14:29:13 +03:00
|
|
|
inputs.flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2020-06-10 07:30:48 +03:00
|
|
|
inputs.nixpkgs = {
|
|
|
|
type = "github";
|
|
|
|
owner = "nixos";
|
|
|
|
repo = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
inputs.nixpkgs-review = {
|
|
|
|
type = "github";
|
|
|
|
owner = "Mic92";
|
|
|
|
repo = "nixpkgs-review";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2020-10-18 19:31:10 +03:00
|
|
|
outputs = { self, flake-utils, flake-compat, nixpkgs, nixpkgs-review }:
|
2020-10-18 20:15:36 +03:00
|
|
|
flake-utils.lib.eachSystem ["x86_64-linux"] (system:
|
2020-10-18 19:31:10 +03:00
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
config = { allowBroken = true; };
|
|
|
|
};
|
2020-07-24 07:32:16 +03:00
|
|
|
|
2020-10-18 19:31:10 +03:00
|
|
|
compiler = pkgs.haskell.packages.ghc884;
|
2020-07-24 07:32:16 +03:00
|
|
|
|
2020-10-18 19:31:10 +03:00
|
|
|
developPackageAttrs = {
|
|
|
|
name = "nixpkgs-update";
|
|
|
|
root = self;
|
|
|
|
overrides = self: super: { };
|
|
|
|
source-overrides = { };
|
|
|
|
modifier = pkgs.haskell.lib.disableLibraryProfiling;
|
|
|
|
returnShellEnv = false;
|
|
|
|
};
|
2020-07-24 07:32:16 +03:00
|
|
|
|
2020-10-18 19:31:10 +03:00
|
|
|
developPackageShellAttrs = developPackageAttrs // {
|
|
|
|
returnShellEnv = true;
|
|
|
|
};
|
2020-07-24 07:32:16 +03:00
|
|
|
|
2020-10-18 19:31:10 +03:00
|
|
|
drvAttrs = attrs: with pkgs; {
|
|
|
|
# TODO: lock down coreutils paths too
|
|
|
|
NIX = nix;
|
|
|
|
GIT = git;
|
|
|
|
HUB = gitAndTools.hub;
|
|
|
|
JQ = jq;
|
|
|
|
TREE = tree;
|
|
|
|
GIST = gist;
|
|
|
|
NIXPKGSREVIEW = (import nixpkgs-review { inherit pkgs; });
|
|
|
|
};
|
2020-07-24 07:32:16 +03:00
|
|
|
|
2020-10-18 19:31:10 +03:00
|
|
|
drvShellAttrs = attrs: (drvAttrs attrs) // (with pkgs; {
|
|
|
|
nativeBuildInputs = attrs.nativeBuildInputs ++ [ cabal-install ghcid ];
|
|
|
|
});
|
2020-07-24 07:32:16 +03:00
|
|
|
|
2020-10-18 19:31:10 +03:00
|
|
|
pkg = (compiler.developPackage developPackageAttrs).overrideAttrs drvAttrs;
|
2020-07-24 07:32:16 +03:00
|
|
|
|
2020-10-18 19:31:10 +03:00
|
|
|
shell = (compiler.developPackage developPackageShellAttrs).overrideAttrs drvShellAttrs;
|
2020-07-24 07:32:16 +03:00
|
|
|
|
2020-10-18 19:31:10 +03:00
|
|
|
in {
|
|
|
|
devShell = shell;
|
|
|
|
packages.nixpkgs-update = pkg;
|
2020-10-18 19:56:02 +03:00
|
|
|
defaultPackage = pkg;
|
2020-10-18 19:31:10 +03:00
|
|
|
});
|
2020-06-10 07:30:48 +03:00
|
|
|
}
|