Skip to content

Commit 0ad4dcb

Browse files
Revamp nix flake for nix-tools (#2010)
* Rework static-nix-tool * Remove buildkite configuration * Use exeName for packages * Move nix-tools to its own overlay * Remove nix-prefetch-git from nix-tools closure * Uhm.... * Make clear that nix-tools are compiled with a single GHC * Fix error if attribute is missing * Restore testing truncate-index * Add some tests * Add missing --accept-flake-config * Update materialisations * Reword warning * Fix tests * WIP * WIP: move everything nix-tools related to the subflake * Better name * Remove unused binding * Strip compiler name from nix-tools, there's only one * Almost fix importing nix-tools overlay * Actually fix importing nix-tools's overlay * Only one nix-tools-unchecked * Make sure exes and project are also exposed by nix-tools.${compiler-nix-name} * Temporarily restore internal-nix-tools * Fix truncate-index test * Temporarily disable static tarballs * Move nix-tools back to ghc 8.10.7 * Update materialized plan after changing the compiler * ifdLevel 0 * ifdLevel 1 * ifdLevel 2 * Use the same index-state as haskell.nix internal one * ifdLevel 0 * ifdLevel 1 * Try index-state 2023-07-03T00:00:00Z * And update the materialisation * Only check materialization `nix-tools` when told to * ifdLevel 2 * ifdLevel 3 --------- Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
1 parent 490f9e9 commit 0ad4dcb

File tree

557 files changed

+660
-24615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

557 files changed

+660
-24615
lines changed

.github/workflows/pipeline.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,8 @@ jobs:
234234
- name: "Check hix -- run github:haskell/cabal/3.10#cabal-install:exe:cabal -- --version"
235235
run: "HIX_DIR=$(mktemp -d) nix run .#hix --accept-flake-config -- run github:haskell/cabal/3.10#cabal-install:exe:cabal --accept-flake-config --override-input haskellNix . -- --version"
236236

237-
nix-tools-build:
237+
nix-tools:
238238
runs-on: [self-hosted, linux]
239239
steps:
240240
- uses: actions/checkout@v3
241-
- name: "nix-tools build"
242-
run: cd ./nix-tools && .buildkite/nix-tools-build.sh
241+
- run: nix build ./nix-tools#checks.x86_64-linux.truncate-index --accept-flake-config

build.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ in rec {
9494
check-closure-size = pkgs.buildPackages.callPackage ./scripts/check-closure-size.nix {
9595
# Includes cabal-install since this is commonly used.
9696
nix-tools = pkgs.linkFarm "common-tools" [
97-
{ name = "nix-tools"; path = haskell.nix-tools.${compiler-nix-name}; }
97+
{ name = "nix-tools"; path = haskell.nix-tools; }
9898
{ name = "cabal-install"; path = haskell.cabal-install.${compiler-nix-name}; }
9999
];
100100
};

lib/call-cabal-project-to-nix.nix

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ pkgs, runCommand, cacert, index-state-hashes, haskellLib }@defaults:
1+
{ pkgs, runCommand, cacert, index-state-hashes, haskellLib }:
22
{ name ? src.name or null # optional name for better error messages
33
, src
44
, materialized-dir ? ../materialized
@@ -66,13 +66,13 @@
6666
let
6767
inherit (evalPackages.haskell-nix) materialize dotCabal;
6868

69-
# These defaults are hear rather than in modules/cabal-project.nix to make them
69+
# These defaults are here rather than in modules/cabal-project.nix to make them
7070
# lazy enough to avoid infinite recursion issues.
7171
# Using null as the default also improves performance as they are not forced by the
7272
# nix module system for `nix-tools-unchecked` and `cabal-install-unchecked`.
7373
nix-tools = if args.nix-tools or null != null
7474
then args.nix-tools
75-
else evalPackages.haskell-nix.nix-tools-unchecked.${compiler-nix-name};
75+
else evalPackages.haskell-nix.nix-tools-unchecked;
7676
cabal-install = if args.cabal-install or null != null
7777
then args.cabal-install
7878
else evalPackages.haskell-nix.cabal-install-unchecked.${compiler-nix-name};
@@ -148,8 +148,6 @@ in let
148148
then index-state
149149
else pkgs.lib.last (builtins.attrNames index-state-hashes);
150150

151-
pkgconfPkgs = import ./pkgconf-nixpkgs-map.nix pkgs;
152-
153151
# If a hash was not specified find a suitable cached index state to
154152
# use that will contain all the packages we need. By using the
155153
# first one after the desired index-state we can avoid recalculating

materialized/ghc902/nix-tools/.plan.nix/hackage-db.nix

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)