From 0db76f77ab23433cf0136808de6e2411c323692b Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Thu, 24 Aug 2023 22:46:28 +0800 Subject: [PATCH 01/22] Remove flake-utils --- flake.lock | 17 ----- flake.nix | 162 ++++++++++++++++++++++++------------------ hix/init/flake.nix | 2 +- hix/project/flake.nix | 2 +- 4 files changed, 93 insertions(+), 90 deletions(-) diff --git a/flake.lock b/flake.lock index 86eec2026f..5a0f1f8426 100644 --- a/flake.lock +++ b/flake.lock @@ -100,22 +100,6 @@ "type": "github" } }, - "flake-utils": { - "locked": { - "lastModified": 1679360468, - "narHash": "sha256-LGnza3cfXF10Biw3ZTg0u9o9t7s680Ww200t5KkHTh8=", - "owner": "hamishmack", - "repo": "flake-utils", - "rev": "e1ea268ff47ad475443dbabcd54744b4e5b9d4f5", - "type": "github" - }, - "original": { - "owner": "hamishmack", - "ref": "hkm/nested-hydraJobs", - "repo": "flake-utils", - "type": "github" - } - }, "ghc-8.6.5-iohk": { "flake": false, "locked": { @@ -444,7 +428,6 @@ "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", "flake-compat": "flake-compat", - "flake-utils": "flake-utils", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", "hackage": "hackage", "hls-1.10": "hls-1.10", diff --git a/flake.nix b/flake.nix index 9dbd532b61..3d81175187 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,6 @@ nixpkgs-2305 = { url = "github:NixOS/nixpkgs/nixpkgs-23.05-darwin"; }; nixpkgs-unstable = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; }; flake-compat = { url = "github:input-output-hk/flake-compat/hkm/gitlab-fix"; flake = false; }; - flake-utils = { url = "github:hamishmack/flake-utils/hkm/nested-hydraJobs"; }; "hls-1.10" = { url = "github:haskell/haskell-language-server/1.10.0.0"; flake = false; }; "hls-2.0" = { url = "github:haskell/haskell-language-server/2.0.0.1"; flake = false; }; hydra.url = "hydra"; @@ -66,13 +65,15 @@ }; }; - outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-2105, nixpkgs-2111, nixpkgs-2205, nixpkgs-2211, nixpkgs-2305, flake-compat, flake-utils, ... }@inputs: + outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-2105, nixpkgs-2111, nixpkgs-2205, nixpkgs-2211, nixpkgs-2305, flake-compat, ... }@inputs: let callFlake = import flake-compat; compiler = "ghc928"; config = import ./config.nix; + inherit (nixpkgs) lib; + traceNames = prefix: builtins.mapAttrs (n: v: if builtins.isAttrs v then if v ? type && v.type == "derivation" @@ -91,6 +92,7 @@ "aarch64-darwin" ]; + forEachSystem = lib.genAttrs systems; in traceHydraJobs ({ inherit config; overlay = self.overlays.combined; @@ -104,10 +106,15 @@ sources = inputs; overlaysOverrideable = import ./overlays; + # Compatibility with old default.nix - compat = { checkMaterialization ? - false # Allows us to easily switch on materialization checking - , system, sourcesOverride ? { }, ... }@args: rec { + compat = + { checkMaterialization ? false # Allows us to easily switch on materialization checking + , system + , sourcesOverride ? { } + , ... + }@args: + rec { sources = inputs // sourcesOverride; allOverlays = import ./overlays (args // { inherit sources; }); inherit config; @@ -115,16 +122,12 @@ # flake outputs so that we can incorporate the args passed # to the compat layer (e.g. sourcesOverride). overlays = [ allOverlays.combined ] - ++ (if checkMaterialization then - [ + ++ lib.optional checkMaterialization (final: prev: { haskell-nix = prev.haskell-nix // { checkMaterialization = true; }; - }) - ] - else - [ ]); + }); nixpkgsArgs = { inherit config overlays; }; @@ -146,74 +149,90 @@ }; }; + legacyPackages = forEachSystem (system: + (self.internal.compat { inherit system; }).pkgs); + + legacyPackagesUnstable = forEachSystem (system: + (self.internal.compat { inherit system; }).pkgs-unstable); + + # Exposed so that buildkite can check that `allow-import-from-derivation=false` works for core of haskell.nix + roots = forEachSystem (system: + self.legacyPackagesUnstable.${system}.haskell-nix.roots compiler); + # Note: `nix flake check` evaluates outputs for all platforms, and haskell.nix # uses IFD heavily, you have to have the ability to build for all platforms # supported by haskell.nix, e.g. with remote builders, in order to check this flake. # If you want to run the tests for just your platform, run `./test/tests.sh` or # `nix-build -A checks.$PLATFORM` - } // flake-utils.lib.eachSystem systems (system: - let - legacyPackages = (self.internal.compat { inherit system; }).pkgs; - nix-tools-hydraJobs = - let cf = callFlake { pkgs = legacyPackages; inherit system; src = ./nix-tools; }; - in cf.defaultNix.hydraJobs; - in rec { - inherit legacyPackages; - legacyPackagesUnstable = (self.internal.compat { inherit system; }).pkgs-unstable; - - # FIXME: Currently `nix flake check` requires `--impure` because coverage-golden - # (and maybe other tests) import projects that use builtins.currentSystem - checks = builtins.listToAttrs (map (pkg: { - name = pkg.name; - value = pkg; - }) (nixpkgs.lib.collect nixpkgs.lib.isDerivation (import ./test rec { - haskellNix = self.internal.compat { inherit system; }; - compiler-nix-name = compiler; - pkgs = haskellNix.pkgs; - }))); - # Exposed so that buildkite can check that `allow-import-from-derivation=false` works for core of haskell.nix - roots = legacyPackagesUnstable.haskell-nix.roots compiler; - - packages = (self.internal.compat { inherit system; }).hix.apps; - - allJobs = - let - inherit (import ./ci-lib.nix { pkgs = legacyPackagesUnstable; }) stripAttrsForHydra filterDerivations; - ci = import ./ci.nix { inherit (self.internal) compat; inherit system; }; - in stripAttrsForHydra (filterDerivations ci); - - requiredJobs = - let - inherit (legacyPackages) lib; - names = x: lib.filter (n: n != "recurseForDerivations" && n != "meta") - (builtins.attrNames x); - in - builtins.listToAttrs ( - lib.concatMap (nixpkgsVer: - let nixpkgsJobs = allJobs.${nixpkgsVer}; - in lib.concatMap (compiler-nix-name: - let ghcJobs = nixpkgsJobs.${compiler-nix-name}; - in builtins.map (crossPlatform: { - name = "required-${nixpkgsVer}-${compiler-nix-name}-${crossPlatform}"; - value = legacyPackages.releaseTools.aggregate { - name = "haskell.nix-${nixpkgsVer}-${compiler-nix-name}-${crossPlatform}"; - meta.description = "All ${nixpkgsVer} ${compiler-nix-name} ${crossPlatform} jobs"; - constituents = lib.collect lib.isDerivation ghcJobs.${crossPlatform}; - }; - }) (names ghcJobs) - ) (names nixpkgsJobs) - ) (names allJobs)); - - hydraJobs = - allJobs + # FIXME: Currently `nix flake check` requires `--impure` because coverage-golden + # (and maybe other tests) import projects that use builtins.currentSystem + checks = forEachSystem (system: + builtins.listToAttrs ( + map + (pkg: { name = pkg.name; value = pkg; }) + (lib.collect + lib.isDerivation + (import ./test + rec { + haskellNix = self.internal.compat { inherit system; }; + compiler-nix-name = compiler; + pkgs = haskellNix.pkgs; + }) + ) + ) + ); + + packages = forEachSystem (system: + (self.internal.compat { inherit system; }).hix.apps + ); + + allJobs = forEachSystem (system: + let + inherit (import ./ci-lib.nix { pkgs = self.legacyPackagesUnstable.${system}; }) stripAttrsForHydra filterDerivations; + ci = import ./ci.nix { inherit (self.internal) compat; inherit system; }; + in stripAttrsForHydra (filterDerivations ci)); + + requiredJobs = forEachSystem (system: + let + inherit (self.legacyPackages.${system}) lib; + names = x: lib.filter (n: n != "recurseForDerivations" && n != "meta") + (builtins.attrNames x); + in + builtins.listToAttrs ( + lib.concatMap (nixpkgsVer: + let nixpkgsJobs = self.allJobs.${system}.${nixpkgsVer}; + in lib.concatMap (compiler-nix-name: + let ghcJobs = nixpkgsJobs.${compiler-nix-name}; + in builtins.map (crossPlatform: { + name = "required-${nixpkgsVer}-${compiler-nix-name}-${crossPlatform}"; + value = self.legacyPackages.${system}.releaseTools.aggregate { + name = "haskell.nix-${nixpkgsVer}-${compiler-nix-name}-${crossPlatform}"; + meta.description = "All ${nixpkgsVer} ${compiler-nix-name} ${crossPlatform} jobs"; + constituents = lib.collect lib.isDerivation ghcJobs.${crossPlatform}; + }; + }) (names ghcJobs) + ) (names nixpkgsJobs) + ) (names self.allJobs.${system}))); + + hydraJobs = forEachSystem (system: + self.allJobs.${system} + // + { # Include hydraJobs from nix-tools subflake. # NOTE: These derivations do not depend on the haskell.nix in ./. but # on the version of haskell.nix locked in the subflake. They are # evaluated within their own flake and independently of anything # else. Here we only expose them in the main flake. - // { nix-tools = nix-tools-hydraJobs.${system} or {}; }; + nix-tools = (callFlake { + inherit system; + pkgs = self.legacyPackages.${system}; + src = ./nix-tools; + }).defaultNix.hydraJobs or {}; + }); - devShells = with self.legacyPackages.${system}; { + devShells = forEachSystem (system: + let inherit (self.legacyPackages.${system}) mkShell nixUnstable cabal-install haskell-nix; + in { default = mkShell { buildInputs = [ @@ -222,7 +241,7 @@ haskell-nix.compiler.${compiler} ]; }; - } // __mapAttrs (compiler-nix-name: compiler: + } // builtins.mapAttrs (compiler-nix-name: compiler: mkShell { buildInputs = [ compiler @@ -237,8 +256,9 @@ "ghc881" "ghc882" "ghc883" "ghc8101" "ghc8102" "ghc8103" "ghc8104" "ghc8105" "ghc8106" "ghc810420210212" "ghc901" - "ghc921" "ghc922" "ghc923"]); - })); + "ghc921" "ghc922" "ghc923"]) + ); + }); # --- Flake Local Nix Configuration ---------------------------- nixConfig = { diff --git a/hix/init/flake.nix b/hix/init/flake.nix index 0ff50743ec..d37d972523 100644 --- a/hix/init/flake.nix +++ b/hix/init/flake.nix @@ -2,7 +2,7 @@ # This is a template created by `hix init` inputs.haskellNix.url = "github:input-output-hk/haskell.nix"; inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable"; - inputs.flake-utils.follows = "haskellNix/flake-utils"; + inputs.flake-utils.url = "github:hamishmack/flake-utils/hkm/nested-hydraJobs"; outputs = { self, nixpkgs, flake-utils, haskellNix }: let supportedSystems = [ diff --git a/hix/project/flake.nix b/hix/project/flake.nix index 72caaba440..134857315f 100644 --- a/hix/project/flake.nix +++ b/hix/project/flake.nix @@ -4,7 +4,7 @@ description = "Default hix flake"; inputs.haskellNix.url = "github:input-output-hk/haskell.nix"; inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable"; - inputs.flake-utils.follows = "haskellNix/flake-utils"; + inputs.flake-utils.url = "github:hamishmack/flake-utils/hkm/nested-hydraJobs"; inputs.src.flake = false; outputs = { self, src, nixpkgs, flake-utils, haskellNix }: flake-utils.lib.eachSystem [ "EVAL_SYSTEM" ] (system: From 91181f252c03969133c4669a8191220eefca8b7c Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Thu, 24 Aug 2023 23:27:26 +0800 Subject: [PATCH 02/22] WIP --- ci.nix | 1 - flake.nix | 137 +++++++++++++++++++++++-------------------- overlays/default.nix | 7 +-- overlays/haskell.nix | 8 +-- overlays/hydra.nix | 2 +- 5 files changed, 81 insertions(+), 74 deletions(-) diff --git a/ci.nix b/ci.nix index 84f06a4ac6..84a72b4ce1 100644 --- a/ci.nix +++ b/ci.nix @@ -2,7 +2,6 @@ # on a machine with e.g. no way to build the Darwin IFDs you need! { ifdLevel ? 3 # Whether or not we are evaluating in restricted mode. This is true in Hydra, but not in Hercules. -, restrictEval ? false , checkMaterialization ? false , compat , system diff --git a/flake.nix b/flake.nix index 3d81175187..ba3990df82 100644 --- a/flake.nix +++ b/flake.nix @@ -92,69 +92,32 @@ "aarch64-darwin" ]; + nixpkgsArgs = { + inherit config; + overlays = [ self.overlay ]; + }; + forEachSystem = lib.genAttrs systems; + in traceHydraJobs ({ - inherit config; overlay = self.overlays.combined; overlays = import ./overlays { sources = inputs; }; - internal = { - nixpkgsArgs = { - inherit config; - overlays = [ self.overlay ]; - }; - - sources = inputs; - - overlaysOverrideable = import ./overlays; - - # Compatibility with old default.nix - compat = - { checkMaterialization ? false # Allows us to easily switch on materialization checking - , system - , sourcesOverride ? { } - , ... - }@args: - rec { - sources = inputs // sourcesOverride; - allOverlays = import ./overlays (args // { inherit sources; }); - inherit config; - # We are overriding 'overlays' and 'nixpkgsArgs' from the - # flake outputs so that we can incorporate the args passed - # to the compat layer (e.g. sourcesOverride). - overlays = [ allOverlays.combined ] - ++ lib.optional checkMaterialization - (final: prev: { - haskell-nix = prev.haskell-nix // { - checkMaterialization = true; - }; - }); - nixpkgsArgs = { - inherit config overlays; - }; - pkgs = import nixpkgs - (nixpkgsArgs // { localSystem = { inherit system; }; }); - pkgs-2105 = import nixpkgs-2105 - (nixpkgsArgs // { localSystem = { inherit system; }; }); - pkgs-2111 = import nixpkgs-2111 - (nixpkgsArgs // { localSystem = { inherit system; }; }); - pkgs-2205 = import nixpkgs-2205 - (nixpkgsArgs // { localSystem = { inherit system; }; }); - pkgs-2211 = import nixpkgs-2211 - (nixpkgsArgs // { localSystem = { inherit system; }; }); - pkgs-2305 = import nixpkgs-2305 - (nixpkgsArgs // { localSystem = { inherit system; }; }); - pkgs-unstable = import nixpkgs-unstable - (nixpkgsArgs // { localSystem = { inherit system; }; }); - hix = import ./hix/default.nix { inherit pkgs; }; - }; - }; legacyPackages = forEachSystem (system: - (self.internal.compat { inherit system; }).pkgs); + import nixpkgs { + inherit config; + overlays = [ self.overlay ]; + localSystem = { inherit system; }; + }); legacyPackagesUnstable = forEachSystem (system: - (self.internal.compat { inherit system; }).pkgs-unstable); + import nixpkgs-unstable { + inherit config; + overlays = [ self.overlay ]; + localSystem = { inherit system; }; + }); + # FIXME: buildkite is gone # Exposed so that buildkite can check that `allow-import-from-derivation=false` works for core of haskell.nix roots = forEachSystem (system: self.legacyPackagesUnstable.${system}.haskell-nix.roots compiler); @@ -172,29 +135,75 @@ (pkg: { name = pkg.name; value = pkg; }) (lib.collect lib.isDerivation - (import ./test - rec { - haskellNix = self.internal.compat { inherit system; }; - compiler-nix-name = compiler; - pkgs = haskellNix.pkgs; - }) + (import ./test { + haskellNix.sources = inputs; + haskellNix.nixpkgsArgs = nixpkgsArgs; + compiler-nix-name = compiler; + pkgs = self.legacyPackages.${system}; + }) ) ) ); packages = forEachSystem (system: - (self.internal.compat { inherit system; }).hix.apps + (import ./hix/default.nix { pkgs = self.legacyPackages.${system}; }).apps ); allJobs = forEachSystem (system: let - inherit (import ./ci-lib.nix { pkgs = self.legacyPackagesUnstable.${system}; }) stripAttrsForHydra filterDerivations; - ci = import ./ci.nix { inherit (self.internal) compat; inherit system; }; + inherit + (import ./ci-lib.nix { pkgs = self.legacyPackagesUnstable.${system}; }) + stripAttrsForHydra + filterDerivations; + + # Compatibility with old default.nix + ci = import ./ci.nix { + inherit system; + compat = + { checkMaterialization ? false # Allows us to easily switch on materialization checking + , system + }: + let + # We are overriding 'overlays' and 'nixpkgsArgs' from the + # flake outputs so that we can incorporate the args passed + # to the compat layer (e.g. sourcesOverride). + overlays = [ self.overlay ] + ++ lib.optional checkMaterialization + (final: prev: { + haskell-nix = prev.haskell-nix // { + checkMaterialization = true; + }; + }); + pkgs = import nixpkgs + (nixpkgsArgs // { localSystem = { inherit system; }; }); + in + { + inherit config overlays; + sources = inputs; + allOverlays = overlays; + nixpkgsArgs = { + inherit config overlays; + }; + inherit pkgs; + pkgs-2105 = import nixpkgs-2105 + (nixpkgsArgs // { localSystem = { inherit system; }; }); + pkgs-2111 = import nixpkgs-2111 + (nixpkgsArgs // { localSystem = { inherit system; }; }); + pkgs-2205 = import nixpkgs-2205 + (nixpkgsArgs // { localSystem = { inherit system; }; }); + pkgs-2211 = import nixpkgs-2211 + (nixpkgsArgs // { localSystem = { inherit system; }; }); + pkgs-2305 = import nixpkgs-2305 + (nixpkgsArgs // { localSystem = { inherit system; }; }); + pkgs-unstable = import nixpkgs-unstable + (nixpkgsArgs // { localSystem = { inherit system; }; }); + hix = import ./hix/default.nix { inherit pkgs; }; + }; + }; in stripAttrsForHydra (filterDerivations ci)); requiredJobs = forEachSystem (system: let - inherit (self.legacyPackages.${system}) lib; names = x: lib.filter (n: n != "recurseForDerivations" && n != "meta") (builtins.attrNames x); in diff --git a/overlays/default.nix b/overlays/default.nix index 38d2d3e35c..3a8b95929e 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,9 +1,8 @@ -{ sources, ...}@args: - +{ sources }: let overlays = { wine = import ./wine.nix; - haskell = import ./haskell.nix args; + haskell = import ./haskell.nix { inherit sources; }; # Here is where we import nix-tools into the overlays that haskell.nix is # going to use. To cut the evaluation time of nix-tools (which would itself @@ -58,7 +57,7 @@ let bootstrap = import ./bootstrap.nix; ghc = import ./ghc.nix; ghc-packages = import ./ghc-packages.nix; - hydra = import ./hydra.nix args; + hydra = import ./hydra.nix { inherit sources; }; darwin = import ./darwin.nix; windows = import ./windows.nix; armv6l-linux = import ./armv6l-linux.nix; diff --git a/overlays/haskell.nix b/overlays/haskell.nix index 11514cd86a..e46741c1ce 100644 --- a/overlays/haskell.nix +++ b/overlays/haskell.nix @@ -1,4 +1,4 @@ -{ sources, ... }: +{ sources }: # The haskell.nix infrastructure # # for hygienic reasons we'll use haskell-nix as a prefix. @@ -105,7 +105,7 @@ final: prev: { { stack-pkgs # Path to the output of stack-to-nix , pkg-def-extras ? [] , modules ? [] - }@args: + }: let # The Stackage release referenced in the stack config pkg-def = stackage.${stack-pkgs.resolver} or (throw '' @@ -238,7 +238,7 @@ final: prev: { }) ]; - dotCabal = { index-state, sha256, cabal-install, extra-hackage-tarballs ? {}, extra-hackage-repos ? {}, nix-tools, ... }@args: + dotCabal = { index-state, sha256, cabal-install, extra-hackage-tarballs ? {}, extra-hackage-repos ? {}, nix-tools, ... }: let # NOTE: root-keys: aaa is because key-threshold: 0 does not seem to be enough by itself bootstrapIndexTarball = name: index: final.runCommand "cabal-bootstrap-index-tarball-${name}" { @@ -741,7 +741,7 @@ final: prev: { then components.library else components.${haskellLib.prefixComponent.${builtins.elemAt m 0}}.${builtins.elemAt m 1}; - coverageReport = haskellLib.coverageReport (rec { + coverageReport = haskellLib.coverageReport ({ name = package.identifier.name + "-" + package.identifier.version; # Include the checks for a single package. checks = final.lib.filter (final.lib.isDerivation) (final.lib.attrValues package'.checks); diff --git a/overlays/hydra.nix b/overlays/hydra.nix index 4fd22044c3..71cc6ac501 100644 --- a/overlays/hydra.nix +++ b/overlays/hydra.nix @@ -1,4 +1,4 @@ -{ sources, ...}: +{ sources }: # This hydra overlay is required to circumvent problems with builtins.path # in restricted eval mode. # This can be removed once hydra in nixpkgs is based on a recent enough nix, From faccb70a1d0268f5f77d54702f8913519c8d6900 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Thu, 24 Aug 2023 23:51:02 +0800 Subject: [PATCH 03/22] Try to depend on pkgs rather than system --- flake.nix | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index ba3990df82..d64a3b2e2f 100644 --- a/flake.nix +++ b/flake.nix @@ -98,6 +98,7 @@ }; forEachSystem = lib.genAttrs systems; + forEachSystem' = f: lib.genAttrs systems (system: f self.legacyPackages.${system}); in traceHydraJobs ({ overlay = self.overlays.combined; @@ -129,7 +130,7 @@ # `nix-build -A checks.$PLATFORM` # FIXME: Currently `nix flake check` requires `--impure` because coverage-golden # (and maybe other tests) import projects that use builtins.currentSystem - checks = forEachSystem (system: + checks = forEachSystem' (pkgs: builtins.listToAttrs ( map (pkg: { name = pkg.name; value = pkg; }) @@ -139,14 +140,14 @@ haskellNix.sources = inputs; haskellNix.nixpkgsArgs = nixpkgsArgs; compiler-nix-name = compiler; - pkgs = self.legacyPackages.${system}; + inherit pkgs; }) ) ) ); - packages = forEachSystem (system: - (import ./hix/default.nix { pkgs = self.legacyPackages.${system}; }).apps + packages = forEachSystem' (pkgs: + (import ./hix/default.nix { inherit pkgs; }).apps ); allJobs = forEachSystem (system: @@ -239,8 +240,8 @@ }).defaultNix.hydraJobs or {}; }); - devShells = forEachSystem (system: - let inherit (self.legacyPackages.${system}) mkShell nixUnstable cabal-install haskell-nix; + devShells = forEachSystem' (pkgs: + let inherit (pkgs) mkShell nixUnstable cabal-install haskell-nix; in { default = mkShell { @@ -250,22 +251,24 @@ haskell-nix.compiler.${compiler} ]; }; - } // builtins.mapAttrs (compiler-nix-name: compiler: + } + // + builtins.mapAttrs + (compiler-nix-name: compiler: mkShell { buildInputs = [ compiler haskell-nix.cabal-install.${compiler-nix-name} ]; - } - ) ( - # Exclude old versions of GHC to speed up `nix flake check` - builtins.removeAttrs haskell-nix.compiler - [ "ghc844" - "ghc861" "ghc862" "ghc863" "ghc864" - "ghc881" "ghc882" "ghc883" - "ghc8101" "ghc8102" "ghc8103" "ghc8104" "ghc8105" "ghc8106" "ghc810420210212" - "ghc901" - "ghc921" "ghc922" "ghc923"]) + }) + ( # Exclude old versions of GHC to speed up `nix flake check` + builtins.removeAttrs haskell-nix.compiler + [ "ghc844" + "ghc861" "ghc862" "ghc863" "ghc864" + "ghc881" "ghc882" "ghc883" + "ghc8101" "ghc8102" "ghc8103" "ghc8104" "ghc8105" "ghc8106" "ghc810420210212" + "ghc901" + "ghc921" "ghc922" "ghc923"]) ); }); From c1cd8fc95be87c19d144c7b92fcbdf7dc2954154 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 25 Aug 2023 13:30:03 +0800 Subject: [PATCH 04/22] Use builtins --- ci.nix | 24 ++++++++++++------------ default.nix | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ci.nix b/ci.nix index 84a72b4ce1..93fb2f5c24 100644 --- a/ci.nix +++ b/ci.nix @@ -28,15 +28,15 @@ nixpkgs.lib.filterAttrs (compiler-nix-name: _: # We have less x86_64-darwin build capacity so build fewer GhC versions (system != "x86_64-darwin" || ( - !__elem compiler-nix-name ["ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921" "ghc922"])) + !builtins.elem compiler-nix-name ["ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921" "ghc922"])) && # aarch64-darwin requires ghc 8.10.7 (system != "aarch64-darwin" || ( - !__elem compiler-nix-name ["ghc865" "ghc884" "ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921" "ghc922"])) + !builtins.elem compiler-nix-name ["ghc865" "ghc884" "ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921" "ghc922"])) && # aarch64-linux requires ghc 8.8.4 (system != "aarch64-linux" || ( - !__elem compiler-nix-name ["ghc865" "ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921" "ghc922"] + !builtins.elem compiler-nix-name ["ghc865" "ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921" "ghc922"] ))) (builtins.mapAttrs (compiler-nix-name: runTests: { inherit runTests; @@ -72,24 +72,24 @@ # of 'lib.systems.examples' are not understood between all versions let lib = nixpkgs.lib; in lib.optionalAttrs (nixpkgsName == "unstable" - && ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) - || (system == "aarch64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) - || (system == "x86_64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) - || (system == "aarch64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) + && ((system == "x86_64-linux" && builtins.elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) + || (system == "aarch64-linux" && builtins.elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) + || (system == "x86_64-darwin" && builtins.elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) + || (system == "aarch64-darwin" && builtins.elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) )) { inherit (lib.systems.examples) ghcjs; } // lib.optionalAttrs (nixpkgsName == "unstable" - && ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) - || (system == "x86_64-darwin" && __elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity + && ((system == "x86_64-linux" && builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) + || (system == "x86_64-darwin" && builtins.elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity inherit (lib.systems.examples) mingwW64; - } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) { + } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) { # Musl cross only works on linux # aarch64 cross only works on linux inherit (lib.systems.examples) musl64 aarch64-multiplatform; - } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928"]) { + } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc927" "ghc928"]) { # TODO fix this for the compilers we build with hadrian (ghc >=9.4) inherit (lib.systems.examples) aarch64-multiplatform-musl; - } // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) { + } // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) { inherit (lib.systems.examples) aarch64-multiplatform-musl; }; isDisabled = d: d.meta.disabled or false; diff --git a/default.nix b/default.nix index 2ec0e3a898..3f5501ad81 100644 --- a/default.nix +++ b/default.nix @@ -1,7 +1,7 @@ {...}@args: let - pins = (__fromJSON (__readFile ./flake.lock)).nodes; + pins = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes; nixpkgsPin = pins.nixpkgs-2211.locked; flakeCompatPin = pins.flake-compat.locked; nixpkgsSrc = From b35fafb81e6c46e4b49606d9c8a36c25f518d680 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 25 Aug 2023 14:50:51 +0800 Subject: [PATCH 05/22] Try putting back internal as it was --- flake.nix | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index d64a3b2e2f..9b82b26c3b 100644 --- a/flake.nix +++ b/flake.nix @@ -65,7 +65,18 @@ }; }; - outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-2105, nixpkgs-2111, nixpkgs-2205, nixpkgs-2211, nixpkgs-2305, flake-compat, ... }@inputs: + outputs = + { self + , nixpkgs + , nixpkgs-unstable + , nixpkgs-2105 + , nixpkgs-2111 + , nixpkgs-2205 + , nixpkgs-2211 + , nixpkgs-2305 + , flake-compat + , ... + }@inputs: let callFlake = import flake-compat; @@ -101,9 +112,74 @@ forEachSystem' = f: lib.genAttrs systems (system: f self.legacyPackages.${system}); in traceHydraJobs ({ + inherit config; overlay = self.overlays.combined; overlays = import ./overlays { sources = inputs; }; + internal = { + nixpkgsArgs = { + inherit config; + overlays = [ self.overlay ]; + }; + + sources = inputs; + + overlaysOverrideable = import ./overlays; + + # Compatibility with old default.nix + compat = + { # Allows us to easily switch on materialization checking + checkMaterialization ? false + , system + , sourcesOverride ? { } + , ... + }: + let + sources = inputs // sourcesOverride; + allOverlays = import ./overlays { inherit sources; }; + # We are overriding 'overlays' and 'nixpkgsArgs' from the + # flake outputs so that we can incorporate the args passed + # to the compat layer (e.g. sourcesOverride). + overlays = [ allOverlays.combined ] + ++ lib.optional checkMaterialization + (final: prev: { + haskell-nix = prev.haskell-nix // { + checkMaterialization = true; + }; + }); + nixpkgsArgs = { + inherit config overlays; + }; + pkgs = import nixpkgs (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + in + { + inherit sources; + inherit allOverlays overlays; + inherit config nixpkgsArgs pkgs; + pkgs-2105 = import nixpkgs-2105 (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + pkgs-2111 = import nixpkgs-2111 (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + pkgs-2205 = import nixpkgs-2205 (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + pkgs-2211 = import nixpkgs-2211 (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + pkgs-2305 = import nixpkgs-2305 (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + pkgs-unstable = import nixpkgs-unstable (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + hix = import ./hix/default.nix { inherit pkgs; }; + }; + }; + legacyPackages = forEachSystem (system: import nixpkgs { inherit config; From 6a7a2534a52eb32916b886aea7fa4397ad6c2666 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 12:41:38 +0800 Subject: [PATCH 06/22] Remove/update some comments --- ci.nix | 1 - flake.nix | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci.nix b/ci.nix index 93fb2f5c24..91d2b13ab1 100644 --- a/ci.nix +++ b/ci.nix @@ -1,7 +1,6 @@ # 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluating # on a machine with e.g. no way to build the Darwin IFDs you need! { ifdLevel ? 3 -# Whether or not we are evaluating in restricted mode. This is true in Hydra, but not in Hercules. , checkMaterialization ? false , compat , system diff --git a/flake.nix b/flake.nix index 9b82b26c3b..d229f6e39c 100644 --- a/flake.nix +++ b/flake.nix @@ -194,8 +194,9 @@ localSystem = { inherit system; }; }); - # FIXME: buildkite is gone - # Exposed so that buildkite can check that `allow-import-from-derivation=false` works for core of haskell.nix + # Exposed so CI can check that `allow-import-from-derivation=false` works + # for core of haskell.nix E.g. this should always work: + # nix build .#roots.x86_64-linux --accept-flake-config --option allow-import-from-derivation false roots = forEachSystem (system: self.legacyPackagesUnstable.${system}.haskell-nix.roots compiler); From e5997038d2c2d97af791f9d838d2c30a15c86aa1 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 12:44:58 +0800 Subject: [PATCH 07/22] Better name for forEachSystem' --- flake.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index d229f6e39c..4d03af141f 100644 --- a/flake.nix +++ b/flake.nix @@ -109,7 +109,7 @@ }; forEachSystem = lib.genAttrs systems; - forEachSystem' = f: lib.genAttrs systems (system: f self.legacyPackages.${system}); + forEachSystemPkgs = f: forEachSystem (system: f self.legacyPackages.${system}); in traceHydraJobs ({ inherit config; @@ -207,7 +207,7 @@ # `nix-build -A checks.$PLATFORM` # FIXME: Currently `nix flake check` requires `--impure` because coverage-golden # (and maybe other tests) import projects that use builtins.currentSystem - checks = forEachSystem' (pkgs: + checks = forEachSystemPkgs (pkgs: builtins.listToAttrs ( map (pkg: { name = pkg.name; value = pkg; }) @@ -223,7 +223,7 @@ ) ); - packages = forEachSystem' (pkgs: + packages = forEachSystemPkgs (pkgs: (import ./hix/default.nix { inherit pkgs; }).apps ); @@ -317,7 +317,7 @@ }).defaultNix.hydraJobs or {}; }); - devShells = forEachSystem' (pkgs: + devShells = forEachSystemPkgs (pkgs: let inherit (pkgs) mkShell nixUnstable cabal-install haskell-nix; in { default = From d9092211b1c9aac3c705543b45bc4c2fc68d5e07 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 13:14:33 +0800 Subject: [PATCH 08/22] Minor changes --- default.nix | 24 ++++++++++++------------ flake.nix | 2 ++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/default.nix b/default.nix index 3f5501ad81..d673044969 100644 --- a/default.nix +++ b/default.nix @@ -1,20 +1,20 @@ -{...}@args: +{ ... }@args: let - pins = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes; - nixpkgsPin = pins.nixpkgs-2211.locked; - flakeCompatPin = pins.flake-compat.locked; - nixpkgsSrc = + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + flake-compat = + with lock.nodes.flake-compat.locked; builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/${nixpkgsPin.rev}.tar.gz"; - sha256 = nixpkgsPin.narHash; + url = "https://github.com/input-output-hk/flake-compat/archive/${rev}.tar.gz"; + sha256 = narHash; }; - pkgs = args.pkgs or (import nixpkgsSrc {}); - flake-compat = - pkgs.fetchzip { - url = "https://github.com/input-output-hk/flake-compat/archive/${flakeCompatPin.rev}.tar.gz"; - sha256 = flakeCompatPin.narHash; + nixpkgs = + with lock.nodes.nixpkgs-2211.locked; + builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; + sha256 = narHash; }; + pkgs = args.pkgs or (import nixpkgs { }); self = import flake-compat { # We bypass flake-compat's rootSrc cleaning by evading its detection of this as a git # repo. diff --git a/flake.nix b/flake.nix index 4d03af141f..c1db7b89e4 100644 --- a/flake.nix +++ b/flake.nix @@ -223,6 +223,8 @@ ) ); + # NOTE: these are the hix cli utilities, which is a separate thing from + # the hix.nix overlays (which extends haskell.nix with hixProject). packages = forEachSystemPkgs (pkgs: (import ./hix/default.nix { inherit pkgs; }).apps ); From aaf3cb8bbcc2c26065c3bd28e5647034e34feac3 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 13:19:38 +0800 Subject: [PATCH 09/22] Remove extra nixpkgs in default.nix --- default.nix | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/default.nix b/default.nix index d673044969..f28359ec4b 100644 --- a/default.nix +++ b/default.nix @@ -8,13 +8,6 @@ let url = "https://github.com/input-output-hk/flake-compat/archive/${rev}.tar.gz"; sha256 = narHash; }; - nixpkgs = - with lock.nodes.nixpkgs-2211.locked; - builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; - sha256 = narHash; - }; - pkgs = args.pkgs or (import nixpkgs { }); self = import flake-compat { # We bypass flake-compat's rootSrc cleaning by evading its detection of this as a git # repo. @@ -26,7 +19,6 @@ let # in `test/default.nix`). If `flake-compat` copies the whole git repo, any change to the # repo causes a change of input for all tests. src = { outPath = ./.; }; - inherit pkgs; }; in self.defaultNix // (self.defaultNix.internal.compat -({ system = args.pkgs.system or builtins.currentSystem; } // args)) +({ system = builtins.currentSystem; } // args)) From 25bf2e28ae106b0ba9c41df5c7571954a09a8201 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 13:41:38 +0800 Subject: [PATCH 10/22] Use flake-compat override-inputs to implement sourcesOverride This makes the overlays in compat internal the same as the ones in the flake. --- default.nix | 14 +++++++++++--- flake.nix | 11 ++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/default.nix b/default.nix index f28359ec4b..1f6de03c15 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,8 @@ -{ ... }@args: +{ system ? builtins.currentSystem +, sourcesOverride ? { } +, checkMaterialization ? false +, ... +}: let lock = builtins.fromJSON (builtins.readFile ./flake.lock); @@ -19,6 +23,10 @@ let # in `test/default.nix`). If `flake-compat` copies the whole git repo, any change to the # repo causes a change of input for all tests. src = { outPath = ./.; }; + override-inputs = sourcesOverride; }; -in self.defaultNix // (self.defaultNix.internal.compat -({ system = builtins.currentSystem; } // args)) +in +self.defaultNix // ( + self.defaultNix.internal.compat { + inherit system checkMaterialization; + }) diff --git a/flake.nix b/flake.nix index c1db7b89e4..263bccc83b 100644 --- a/flake.nix +++ b/flake.nix @@ -131,16 +131,13 @@ { # Allows us to easily switch on materialization checking checkMaterialization ? false , system - , sourcesOverride ? { } , ... }: let - sources = inputs // sourcesOverride; - allOverlays = import ./overlays { inherit sources; }; # We are overriding 'overlays' and 'nixpkgsArgs' from the # flake outputs so that we can incorporate the args passed # to the compat layer (e.g. sourcesOverride). - overlays = [ allOverlays.combined ] + overlays = [ self.overlay ] ++ lib.optional checkMaterialization (final: prev: { haskell-nix = prev.haskell-nix // { @@ -155,9 +152,9 @@ }); in { - inherit sources; - inherit allOverlays overlays; - inherit config nixpkgsArgs pkgs; + inherit overlays config nixpkgsArgs pkgs; + sources = inputs; + allOverlays = self.overlays; pkgs-2105 = import nixpkgs-2105 (nixpkgsArgs // { localSystem = { inherit system; }; }); From 48b828de88e70f85b345e417143570a5d2f76e0f Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 13:47:52 +0800 Subject: [PATCH 11/22] Deprecate using overlaysOverrideable --- flake.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 263bccc83b..1af2e278a2 100644 --- a/flake.nix +++ b/flake.nix @@ -124,7 +124,10 @@ sources = inputs; - overlaysOverrideable = import ./overlays; + overlaysOverrideable = + lib.warn + "Using this attribute is deprecated. Import ${./overlays} directly or use the flake overlays output with override-inut." + (import ./overlays); # Compatibility with old default.nix compat = From 5ee6346e9f82ab020c1ef1c605993a3d7a810260 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 14:19:50 +0800 Subject: [PATCH 12/22] Move internal.compat to default.nix --- default.nix | 49 ++++++++++++++++++++++++++--- flake.nix | 91 +++-------------------------------------------------- 2 files changed, 48 insertions(+), 92 deletions(-) diff --git a/default.nix b/default.nix index 1f6de03c15..ce77ec2411 100644 --- a/default.nix +++ b/default.nix @@ -12,7 +12,7 @@ let url = "https://github.com/input-output-hk/flake-compat/archive/${rev}.tar.gz"; sha256 = narHash; }; - self = import flake-compat { + self = (import flake-compat { # We bypass flake-compat's rootSrc cleaning by evading its detection of this as a git # repo. # This is done for 3 reasons: @@ -24,9 +24,48 @@ let # repo causes a change of input for all tests. src = { outPath = ./.; }; override-inputs = sourcesOverride; + }).defaultNix; + + inherit (self.inputs.nixpkgs) lib; + + # coming from internal.compat + overlays = [ self.overlay ] + ++ lib.optional checkMaterialization + (final: prev: { + haskell-nix = prev.haskell-nix // { + checkMaterialization = true; + }; + }); + nixpkgsArgs = { + inherit overlays; + inherit (self) config; }; + pkgs = import self.inputs.nixpkgs (nixpkgsArgs // { + localSystem = { inherit system; }; + }); in -self.defaultNix // ( - self.defaultNix.internal.compat { - inherit system checkMaterialization; - }) +self // { + inherit nixpkgsArgs pkgs; + inherit (nixpkgsArgs) config overlays; + sources = self.inputs; + allOverlays = self.overlays; + pkgs-2105 = import self.inputs.nixpkgs-2105 (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + pkgs-2111 = import self.inputs.nixpkgs-2111 (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + pkgs-2205 = import self.inputs.nixpkgs-2205 (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + pkgs-2211 = import self.inputs.nixpkgs-2211 (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + pkgs-2305 = import self.inputs.nixpkgs-2305 (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + pkgs-unstable = import self.inputs.nixpkgs-unstable (nixpkgsArgs // { + localSystem = { inherit system; }; + }); + hix = import ./hix/default.nix { inherit pkgs; }; +} diff --git a/flake.nix b/flake.nix index 1af2e278a2..10e5964982 100644 --- a/flake.nix +++ b/flake.nix @@ -131,53 +131,9 @@ # Compatibility with old default.nix compat = - { # Allows us to easily switch on materialization checking - checkMaterialization ? false - , system - , ... - }: - let - # We are overriding 'overlays' and 'nixpkgsArgs' from the - # flake outputs so that we can incorporate the args passed - # to the compat layer (e.g. sourcesOverride). - overlays = [ self.overlay ] - ++ lib.optional checkMaterialization - (final: prev: { - haskell-nix = prev.haskell-nix // { - checkMaterialization = true; - }; - }); - nixpkgsArgs = { - inherit config overlays; - }; - pkgs = import nixpkgs (nixpkgsArgs // { - localSystem = { inherit system; }; - }); - in - { - inherit overlays config nixpkgsArgs pkgs; - sources = inputs; - allOverlays = self.overlays; - pkgs-2105 = import nixpkgs-2105 (nixpkgsArgs // { - localSystem = { inherit system; }; - }); - pkgs-2111 = import nixpkgs-2111 (nixpkgsArgs // { - localSystem = { inherit system; }; - }); - pkgs-2205 = import nixpkgs-2205 (nixpkgsArgs // { - localSystem = { inherit system; }; - }); - pkgs-2211 = import nixpkgs-2211 (nixpkgsArgs // { - localSystem = { inherit system; }; - }); - pkgs-2305 = import nixpkgs-2305 (nixpkgsArgs // { - localSystem = { inherit system; }; - }); - pkgs-unstable = import nixpkgs-unstable (nixpkgsArgs // { - localSystem = { inherit system; }; - }); - hix = import ./hix/default.nix { inherit pkgs; }; - }; + lib.warn + "Using this attribute is deprecated. You can pass the same arguments to ${./default.nix} instead" + (import ./default.nix); }; legacyPackages = forEachSystem (system: @@ -239,46 +195,7 @@ # Compatibility with old default.nix ci = import ./ci.nix { inherit system; - compat = - { checkMaterialization ? false # Allows us to easily switch on materialization checking - , system - }: - let - # We are overriding 'overlays' and 'nixpkgsArgs' from the - # flake outputs so that we can incorporate the args passed - # to the compat layer (e.g. sourcesOverride). - overlays = [ self.overlay ] - ++ lib.optional checkMaterialization - (final: prev: { - haskell-nix = prev.haskell-nix // { - checkMaterialization = true; - }; - }); - pkgs = import nixpkgs - (nixpkgsArgs // { localSystem = { inherit system; }; }); - in - { - inherit config overlays; - sources = inputs; - allOverlays = overlays; - nixpkgsArgs = { - inherit config overlays; - }; - inherit pkgs; - pkgs-2105 = import nixpkgs-2105 - (nixpkgsArgs // { localSystem = { inherit system; }; }); - pkgs-2111 = import nixpkgs-2111 - (nixpkgsArgs // { localSystem = { inherit system; }; }); - pkgs-2205 = import nixpkgs-2205 - (nixpkgsArgs // { localSystem = { inherit system; }; }); - pkgs-2211 = import nixpkgs-2211 - (nixpkgsArgs // { localSystem = { inherit system; }; }); - pkgs-2305 = import nixpkgs-2305 - (nixpkgsArgs // { localSystem = { inherit system; }; }); - pkgs-unstable = import nixpkgs-unstable - (nixpkgsArgs // { localSystem = { inherit system; }; }); - hix = import ./hix/default.nix { inherit pkgs; }; - }; + compat = import ./default.nix; }; in stripAttrsForHydra (filterDerivations ci)); From 4707c530178243d74b00f8489d4b92bcdd793dde Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 18:00:56 +0800 Subject: [PATCH 13/22] Adapt ci.nix --- ci-lib.nix | 7 ++----- ci.nix | 55 +++++++++++++++++++++++++++++++++++++----------------- flake.nix | 6 +++--- 3 files changed, 43 insertions(+), 25 deletions(-) diff --git a/ci-lib.nix b/ci-lib.nix index e526ed23d3..b0f3a565cd 100644 --- a/ci-lib.nix +++ b/ci-lib.nix @@ -1,8 +1,5 @@ -{ - # Generic nixpkgs, use *only* for lib functions that are stable across versions - pkgs, - lib ? pkgs.lib -}: rec { +{ lib }: +rec { inherit (import ./dimension.nix) dimension; # A filter for removing packages that aren't supported on the current platform diff --git a/ci.nix b/ci.nix index 91d2b13ab1..c99049d261 100644 --- a/ci.nix +++ b/ci.nix @@ -2,26 +2,48 @@ # on a machine with e.g. no way to build the Darwin IFDs you need! { ifdLevel ? 3 , checkMaterialization ? false -, compat -, system -, evalSystem ? builtins.currentSystem or "x86_64-linux" -, pkgs ? (compat { inherit system; }).pkgs }: +, system ? builtins.currentSystem +, evalSystem ? system + # NOTE: we apply checkMaterialization when defining nixpkgsArgs +, haskellNix ? import ./default.nix { inherit system ; } +}: let - inherit (import ./ci-lib.nix { inherit pkgs; }) dimension platformFilterGeneric filterAttrsOnlyRecursive; - inherit (pkgs.haskell-nix) sources; + inherit (haskellNix) inputs; + inherit (inputs.nixpkgs) lib; + inherit + (import ./ci-lib.nix { inherit lib; }) + dimension + platformFilterGeneric + filterAttrsOnlyRecursive; + + # short names for nixpkgs versions nixpkgsVersions = { - "R2205" = "nixpkgs-2205"; - "R2211" = "nixpkgs-2211"; - "R2305" = "nixpkgs-2305"; - "unstable" = "nixpkgs-unstable"; + "R2205" = inputs.nixpkgs-2205; + "R2211" = inputs.nixpkgs-2211; + "R2305" = inputs.nixpkgs-2305; + "unstable" = inputs.nixpkgs-unstable; }; - haskellNix = compat { inherit checkMaterialization system; }; - nixpkgsArgs = haskellNix.nixpkgsArgs // { + + nixpkgsArgs = { + # set checkMaterialization as per top-level argument + overlays = [ + haskellNix.overlay + (final: prev: { + haskell-nix = prev.haskell-nix // { + inherit checkMaterialization; + }; + }) + ]; # Needed for dwarf tests - config = haskellNix.nixpkgsArgs.config // { - permittedInsecurePackages = ["libdwarf-20210528" "libdwarf-20181024" "dwarfdump-20181024"]; + config = haskellNix.config // { + permittedInsecurePackages = [ + "libdwarf-20210528" + "libdwarf-20181024" + "dwarfdump-20181024" + ]; }; }; + compilerNixNames = nixpkgsName: nixpkgs: # Include only the GHC versions that are supported by haskell.nix nixpkgs.lib.filterAttrs (compiler-nix-name: _: @@ -93,9 +115,8 @@ }; isDisabled = d: d.meta.disabled or false; in -dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin: - let pinnedNixpkgsSrc = sources.${nixpkgs-pin}; - evalPackages = import pinnedNixpkgsSrc (nixpkgsArgs // { system = evalSystem; }); +dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: pinnedNixpkgsSrc: + let evalPackages = import pinnedNixpkgsSrc (nixpkgsArgs // { system = evalSystem; }); in dimension "GHC version" (compilerNixNames nixpkgsName evalPackages) (compiler-nix-name: {runTests}: let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; }); build = import ./build.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name haskellNix; }; diff --git a/flake.nix b/flake.nix index 10e5964982..8f757d1221 100644 --- a/flake.nix +++ b/flake.nix @@ -188,14 +188,14 @@ allJobs = forEachSystem (system: let inherit - (import ./ci-lib.nix { pkgs = self.legacyPackagesUnstable.${system}; }) + (import ./ci-lib.nix { inherit lib; }) stripAttrsForHydra filterDerivations; - # Compatibility with old default.nix + # This is awkward. ci = import ./ci.nix { inherit system; - compat = import ./default.nix; + haskellNix = self; }; in stripAttrsForHydra (filterDerivations ci)); From de481184da7413f55d8d9bd06edefbb4aaa1f6bf Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 20:45:59 +0800 Subject: [PATCH 14/22] ghc945 -> ghc947 --- ci.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ci.nix b/ci.nix index c99049d261..1f3a64bbc4 100644 --- a/ci.nix +++ b/ci.nix @@ -72,19 +72,19 @@ ghc8107 = false; ghc902 = false; ghc928 = false; - ghc945 = false; + ghc947 = false; } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2305") { ghc8107 = false; ghc902 = false; ghc928 = false; - ghc945 = false; + ghc947 = false; ghc962 = false; } // nixpkgs.lib.optionalAttrs (nixpkgsName == "unstable") { ghc884 = false; ghc8107 = true; ghc902 = false; ghc928 = true; - ghc945 = true; + ghc947 = true; ghc962 = true; ghc9820230704 = true; })); @@ -100,17 +100,17 @@ )) { inherit (lib.systems.examples) ghcjs; } // lib.optionalAttrs (nixpkgsName == "unstable" - && ((system == "x86_64-linux" && builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) + && ((system == "x86_64-linux" && builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc928" "ghc947" "ghc962" "ghc9820230704"]) || (system == "x86_64-darwin" && builtins.elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity inherit (lib.systems.examples) mingwW64; - } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) { + } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc947" "ghc962" "ghc9820230704"]) { # Musl cross only works on linux # aarch64 cross only works on linux inherit (lib.systems.examples) musl64 aarch64-multiplatform; } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc927" "ghc928"]) { # TODO fix this for the compilers we build with hadrian (ghc >=9.4) inherit (lib.systems.examples) aarch64-multiplatform-musl; - } // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) { + } // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc927" "ghc928" "ghc947" "ghc962" "ghc9820230704"]) { inherit (lib.systems.examples) aarch64-multiplatform-musl; }; isDisabled = d: d.meta.disabled or false; From b09a7e4b29b2ddcf331b2f0d2fd0b0ce785e2238 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 21:15:41 +0800 Subject: [PATCH 15/22] Minor changes --- flake.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index 29e2ba26ff..8694c4a5a6 100644 --- a/flake.nix +++ b/flake.nix @@ -112,6 +112,11 @@ forEachSystem = lib.genAttrs systems; forEachSystemPkgs = f: forEachSystem (system: f self.legacyPackages.${system}); + inherit + (import ./ci-lib.nix { inherit lib; }) + stripAttrsForHydra + filterDerivations; + # Include hydraJobs from nix-tools subflake. # NOTE: These derivations do not depend on the haskell.nix in ./. but # on the version of haskell.nix locked in the subflake. They are @@ -200,18 +205,12 @@ ); allJobs = forEachSystem (system: - let - inherit - (import ./ci-lib.nix { inherit lib; }) - stripAttrsForHydra - filterDerivations; - + stripAttrsForHydra (filterDerivations ( # This is awkward. - ci = import ./ci.nix { + import ./ci.nix { inherit system; haskellNix = self; - }; - in stripAttrsForHydra (filterDerivations ci)); + }))); requiredJobs = forEachSystem (system: let From 734b11be7cffefe6e1e68e69089a914b70ba9f06 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 21:46:04 +0800 Subject: [PATCH 16/22] Slightly more readable --- flake.nix | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index 8694c4a5a6..6c19f80e3f 100644 --- a/flake.nix +++ b/flake.nix @@ -214,24 +214,26 @@ requiredJobs = forEachSystem (system: let - names = x: lib.filter (n: n != "recurseForDerivations" && n != "meta") - (builtins.attrNames x); + inherit (self.legacyPackages.${system}) releaseTools; in - builtins.listToAttrs ( - lib.concatMap (nixpkgsVer: - let nixpkgsJobs = self.allJobs.${system}.${nixpkgsVer}; - in lib.concatMap (compiler-nix-name: - let ghcJobs = nixpkgsJobs.${compiler-nix-name}; - in builtins.map (crossPlatform: { - name = "required-${nixpkgsVer}-${compiler-nix-name}-${crossPlatform}"; - value = self.legacyPackages.${system}.releaseTools.aggregate { - name = "haskell.nix-${nixpkgsVer}-${compiler-nix-name}-${crossPlatform}"; - meta.description = "All ${nixpkgsVer} ${compiler-nix-name} ${crossPlatform} jobs"; - constituents = lib.collect lib.isDerivation ghcJobs.${crossPlatform}; - }; - }) (names ghcJobs) - ) (names nixpkgsJobs) - ) (names self.allJobs.${system}))); + lib.concatMapAttrs (nixpkgsVer: + lib.concatMapAttrs (compiler-nix-name: + lib.concatMapAttrs (crossPlatform: ghcJobs: + let + name = "required-${nixpkgsVer}-${compiler-nix-name}-${crossPlatform}"; + value = releaseTools.aggregate { + name = "haskell.nix-${nixpkgsVer}-${compiler-nix-name}-${crossPlatform}"; + meta.description = "All ${nixpkgsVer} ${compiler-nix-name} ${crossPlatform} jobs"; + constituents = lib.collect lib.isDerivation ghcJobs; + }; + in + lib.optionalAttrs + (crossPlatform != "recurseForDerivations" && crossPlatform != "meta") + { ${name} = value; }) + ) + ) + self.allJobs.${system} + ); hydraJobs = forEachSystem (system: self.allJobs.${system} // { nix-tools = nix-tools-hydraJobs.${system} or {}; } From 82b2c14c9353deba803d345b581a9d8b04c109a4 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 1 Sep 2023 21:47:13 +0800 Subject: [PATCH 17/22] Fix --- test/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/default.nix b/test/default.nix index 299efbf927..aa46781f3e 100644 --- a/test/default.nix +++ b/test/default.nix @@ -17,7 +17,7 @@ with pkgs; let - inherit (import ../ci-lib.nix { inherit pkgs; }) filterAttrsOnlyRecursive; + inherit (import ../ci-lib.nix { lib = pkgs.lib; }) filterAttrsOnlyRecursive; isDisabled = d: d.meta.disabled or false; # Set recurseForDerivations for both children and grand-children values in From a5ff33b43676df1d0ee9420587419310d8a177f1 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Mon, 4 Sep 2023 12:23:13 +0800 Subject: [PATCH 18/22] Bump haskell.nix in nix-tools flake. This removes the transitive dependency on https://github.com/hamishmack/flake-utils which is not needed anymore. --- nix-tools/flake.lock | 65 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 15 deletions(-) diff --git a/nix-tools/flake.lock b/nix-tools/flake.lock index 114c7e66c7..46814b489a 100644 --- a/nix-tools/flake.lock +++ b/nix-tools/flake.lock @@ -101,17 +101,19 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1679360468, - "narHash": "sha256-LGnza3cfXF10Biw3ZTg0u9o9t7s680Ww200t5KkHTh8=", - "owner": "hamishmack", + "lastModified": 1692799911, + "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", + "owner": "numtide", "repo": "flake-utils", - "rev": "e1ea268ff47ad475443dbabcd54744b4e5b9d4f5", + "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", "type": "github" }, "original": { - "owner": "hamishmack", - "ref": "hkm/nested-hydraJobs", + "owner": "numtide", "repo": "flake-utils", "type": "github" } @@ -136,11 +138,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1691195156, - "narHash": "sha256-cy5qo3aE/a6lymbzOAcxdW9ZLGRCnanDuu/xQL2dQo8=", + "lastModified": 1693786968, + "narHash": "sha256-QNQ2dM3iqNV1o+0kWiO5GbMZWNA+of8wCknNKnBBQPI=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "4dcf5a4a045945aa55c1f2be9d2dadce968488fa", + "rev": "4e9caa4ef2cc7a17a8a31ff7a44bcbbc1a314842", "type": "github" }, "original": { @@ -162,6 +164,7 @@ "hackage": "hackage", "hls-1.10": "hls-1.10", "hls-2.0": "hls-2.0", + "hls-2.2": "hls-2.2", "hpc-coveralls": "hpc-coveralls", "hydra": "hydra", "iserv-proxy": "iserv-proxy", @@ -180,11 +183,11 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1691466972, - "narHash": "sha256-YWe6Ydc3gcv5Dn6bh3ZU/gE+E1xsGI4oI4QRXzHTG7g=", + "lastModified": 1693795950, + "narHash": "sha256-tvTquqMdRQqBbefNO7f+198hq3VuVlY0rjiN5hmzGFw=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "d7ff136e7fd2a73c740bcb0f9fd32c84fa446893", + "rev": "e166d754a739f5e41d389c537498ccdc6150be0b", "type": "github" }, "original": { @@ -227,6 +230,23 @@ "type": "github" } }, + "hls-2.2": { + "flake": false, + "locked": { + "lastModified": 1693064058, + "narHash": "sha256-8DGIyz5GjuCFmohY6Fa79hHA/p1iIqubfJUTGQElbNk=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "b30f4b6cf5822f3112c35d14a0cba51f3fe23b85", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.2.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, "hpc-coveralls": { "flake": false, "locked": { @@ -493,11 +513,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1691366993, - "narHash": "sha256-H58GhNWd4YgJN/JYogAKIZOjuxtqTtjRwa4MAwHvT0U=", + "lastModified": 1693786159, + "narHash": "sha256-IzpBwbwD90CIdhOKfdzS98+o3AtoADNsSz5QBr281Gg=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "28eadbd982b345fca498b098a1827c3418f67b9c", + "rev": "69d620fde80c1dfbe78b081db1b5725e9c0ce9e2", "type": "github" }, "original": { @@ -505,6 +525,21 @@ "repo": "stackage.nix", "type": "github" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", From 26c386dfa43cd9a4a252c7bec853689c196c9e54 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Mon, 4 Sep 2023 14:07:34 +0800 Subject: [PATCH 19/22] Pre-fetch nixpkgs before calling flake-compat --- default.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/default.nix b/default.nix index ce77ec2411..4a1c872b70 100644 --- a/default.nix +++ b/default.nix @@ -6,13 +6,37 @@ let lock = builtins.fromJSON (builtins.readFile ./flake.lock); + + # NOTE: This has to be whitelisted in restricted evaluation mode flake-compat = with lock.nodes.flake-compat.locked; builtins.fetchTarball { url = "https://github.com/input-output-hk/flake-compat/archive/${rev}.tar.gz"; sha256 = narHash; }; + + # With flake-compat you will end up fetching the flake inputs with + # builtins.fetchTarball. This is simply because you don't have access to any + # nixpkgs before fetching the inputs. + # + # This won't work in restricted evaluation mode. + # + # Under the mild assumtion that https://github.com/NixOS is whitelisted, we + # can manually fetch nixpkgs and let flake-compat fetch the rest of the + # inputs with the nixpkgs just fetched. + # + # Manually fetch nixpkgs + nixpkgs = + with lock.nodes.nixpkgs.locked; + builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; + sha256 = narHash; + }; + # + # Instantiate the flake fetching the other inputs with the nixpkgs already + # fetched self = (import flake-compat { + pkgs = import nixpkgs { }; # We bypass flake-compat's rootSrc cleaning by evading its detection of this as a git # repo. # This is done for 3 reasons: From 389bb934821c80d51e760d7f450447d5ca81b975 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Mon, 4 Sep 2023 15:04:22 +0800 Subject: [PATCH 20/22] Fix evalSystem in ci.nix --- ci.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci.nix b/ci.nix index ac5928243d..b2f3e12f12 100644 --- a/ci.nix +++ b/ci.nix @@ -3,7 +3,7 @@ { ifdLevel ? 3 , checkMaterialization ? false , system ? builtins.currentSystem -, evalSystem ? system +, evalSystem ? builtins.currentSystem or "x86_64-linux" # NOTE: we apply checkMaterialization when defining nixpkgsArgs , haskellNix ? import ./default.nix { inherit system ; } }: From 379945a72aec802b9dc74f85628f89ce65138b3d Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Mon, 4 Sep 2023 15:48:36 +0800 Subject: [PATCH 21/22] Avoid issues with restricted evaluation --- flake.nix | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index 6c19f80e3f..12d8927892 100644 --- a/flake.nix +++ b/flake.nix @@ -117,21 +117,6 @@ stripAttrsForHydra filterDerivations; - # Include hydraJobs from nix-tools subflake. - # NOTE: These derivations do not depend on the haskell.nix in ./. but - # on the version of haskell.nix locked in the subflake. They are - # evaluated within their own flake and independently of anything - # else. Here we only expose them in the main flake. - nix-tools-hydraJobs = - let cf = callFlake { - src = ./nix-tools; - override-inputs = { - # Avoid downloading another `hackage.nix`. - inherit (inputs) hackage; - }; - }; - in cf.defaultNix.hydraJobs; - in traceHydraJobs ({ inherit config; overlay = self.overlays.combined; @@ -236,6 +221,24 @@ ); hydraJobs = forEachSystem (system: + let + # Include hydraJobs from nix-tools subflake. + # NOTE: These derivations do not depend on the haskell.nix in ./. but + # on the version of haskell.nix locked in the subflake. They are + # evaluated within their own flake and independently of anything + # else. Here we only expose them in the main flake. + nix-tools-hydraJobs = + let cf = callFlake { + inherit system; + pkgs = self.legacyPackages.${system}; + src = ./nix-tools; + override-inputs = { + # Avoid downloading another `hackage.nix`. + inherit (inputs) hackage; + }; + }; + in cf.defaultNix.hydraJobs; + in self.allJobs.${system} // { nix-tools = nix-tools-hydraJobs.${system} or {}; } ); From 083dc5909f0a9185b13b5d5806ea7b04959cb6f6 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Mon, 4 Sep 2023 16:36:14 +0800 Subject: [PATCH 22/22] Trivial change --- test/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/default.nix b/test/default.nix index aa46781f3e..ae670df841 100644 --- a/test/default.nix +++ b/test/default.nix @@ -17,7 +17,7 @@ with pkgs; let - inherit (import ../ci-lib.nix { lib = pkgs.lib; }) filterAttrsOnlyRecursive; + inherit (import ../ci-lib.nix { inherit lib; }) filterAttrsOnlyRecursive; isDisabled = d: d.meta.disabled or false; # Set recurseForDerivations for both children and grand-children values in