mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-09-17 09:57:27 +03:00
d5d304d5b5
* Include dependencies of haskell.nix that were tracked in `nix/sources.json` as flake inputs (`flake.lock` replaces `nix/sources.json`). * Use `flake-compat` to continue to provide a compatible interface for non flake projects. Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru> Co-authored-by: Shea Levy <shea@shealevy.com>
35 lines
856 B
Nix
35 lines
856 B
Nix
{ stdenv, lib, writeScript, coreutils, glibc, git, openssh
|
|
, nix-tools, cabal-install, nixFlakes
|
|
, gawk, bash, curl, findutils
|
|
, update-index-state-hashes }@args:
|
|
|
|
import ./update-external.nix
|
|
(removeAttrs args ["update-index-state-hashes"]) {
|
|
name = "hackage";
|
|
script = ''
|
|
# Clone or update the Hackage Nix expressions repo.
|
|
if [ -d hackage.nix ]; then
|
|
cd hackage.nix
|
|
git pull --ff-only
|
|
cd ..
|
|
else
|
|
git clone git@github.com:input-output-hk/hackage.nix.git
|
|
fi
|
|
|
|
set -x
|
|
# Make sure the hackage index is recent.
|
|
echo "Updating local hackage index..."
|
|
cabal update
|
|
|
|
echo "Running hackage-to-nix..."
|
|
|
|
hackage-to-nix hackage.nix
|
|
|
|
echo "Running update-index-state-hashes..."
|
|
|
|
cd hackage.nix
|
|
|
|
${update-index-state-hashes}/bin/update-index-state-hashes > index-state-hashes.nix
|
|
'';
|
|
}
|