Skip to content

Move hackage back to flake.nix #2652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions configuration-ghc-921.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# nix version of cabal-ghc901.project
{ pkgs, hackage }:
{ pkgs, inputs }:

let
disabledPlugins = [
Expand All @@ -10,12 +10,12 @@ let
hpkgsOverride = hself: hsuper:
with pkgs.haskell.lib;
{
fourmolu = hself.callCabal2nix "fourmolu" hackage.fourmolu {};
fourmolu = hself.callCabal2nix "fourmolu" inputs.fourmolu {};
primitive-extras = hself.primitive-extras_0_10_1_2;
ghc-exactprint = hself.callCabal2nix "ghc-exactprint" hackage.ghc-exactprint {};
constraints-extras = hself.callCabal2nix "constraints-extras" hackage.constraints-extras {};
retrie = hself.callCabal2nix "retrie" hackage.retrie {};
hlint = doJailbreak (hself.callCabal2nix "hlint" hackage.hlint {});
ghc-exactprint = hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint {};
constraints-extras = hself.callCabal2nix "constraints-extras" inputs.constraints-extras {};
retrie = hself.callCabal2nix "retrie" inputs.retrie {};
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint {});

# Re-generate HLS drv excluding some plugins
haskell-language-server =
Expand Down
38 changes: 12 additions & 26 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 38 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,46 @@
flake = false;
};

hackage-sources.url = "path:./flake_hackage";
# List of hackage dependencies
lsp = {
url = "https://hackage.haskell.org/package/lsp-1.4.0.0/lsp-1.4.0.0.tar.gz";
flake = false;
};
lsp-types = {
url = "https://hackage.haskell.org/package/lsp-types-1.4.0.1/lsp-types-1.4.0.1.tar.gz";
flake = false;
};
lsp-test = {
url = "https://hackage.haskell.org/package/lsp-test-0.14.0.2/lsp-test-0.14.0.2.tar.gz";
flake = false;
};
ghc-exactprint = {
url = "https://hackage.haskell.org/package/ghc-exactprint-1.4.1/ghc-exactprint-1.4.1.tar.gz";
flake = false;
};
constraints-extras = {
url = "https://hackage.haskell.org/package/constraints-extras-0.3.2.1/constraints-extras-0.3.2.1.tar.gz";
flake = false;
};
retrie = {
url = "https://hackage.haskell.org/package/retrie-1.2.0.1/retrie-1.2.0.1.tar.gz";
flake = false;
};
fourmolu = {
url = "https://hackage.haskell.org/package/fourmolu-0.5.0.1/fourmolu-0.5.0.1.tar.gz";
flake = false;
};
hlint = {
url = "https://hackage.haskell.org/package/hlint-3.3.6/hlint-3.3.6.tar.gz";
flake = false;
};
};
outputs =
{ self, nixpkgs, flake-compat, flake-utils, pre-commit-hooks, gitignore, hackage-sources }:
inputs@{ self, nixpkgs, flake-compat, flake-utils, pre-commit-hooks, gitignore, ... }:
{
overlay = final: prev:
with prev;
let
hackage = hackage-sources.inputs;

haskellOverrides = hself: hsuper: {
# we override mkDerivation here to apply the following
# tweak to each haskell package:
Expand Down Expand Up @@ -79,9 +109,9 @@
# We need an older version
hiedb = hself.hiedb_0_4_1_0;

lsp = hsuper.callCabal2nix "lsp" hackage.lsp {};
lsp-types = hsuper.callCabal2nix "lsp-types" hackage.lsp-types {};
lsp-test = hsuper.callCabal2nix "lsp-test" hackage.lsp-test {};
lsp = hsuper.callCabal2nix "lsp" inputs.lsp {};
lsp-types = hsuper.callCabal2nix "lsp-types" inputs.lsp-types {};
lsp-test = hsuper.callCabal2nix "lsp-test" inputs.lsp-test {};

implicit-hie-cradle = hself.callCabal2nix "implicit-hie-cradle"
(builtins.fetchTarball {
Expand Down Expand Up @@ -135,7 +165,6 @@
} // (flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ])
(system:
let
hackage = hackage-sources.inputs;
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
Expand Down Expand Up @@ -174,7 +203,7 @@
};

ghc901Config = (import ./configuration-ghc-901.nix) { inherit pkgs; };
ghc921Config = (import ./configuration-ghc-921.nix) { inherit pkgs hackage; };
ghc921Config = (import ./configuration-ghc-921.nix) { inherit pkgs inputs; };

# GHC versions
ghcDefault = pkgs.hlsHpkgs ("ghc"
Expand Down
44 changes: 0 additions & 44 deletions flake_hackage/flake.nix

This file was deleted.