nixpkgs-update/flake.nix

72 lines
1.8 KiB
Nix
Raw Normal View History

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";
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 }:
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;
defaultPackage = pkg;
2020-10-18 19:31:10 +03:00
});
2020-06-10 07:30:48 +03:00
}