Skip to content

Commit 3a842c3

Browse files
committed
Fix nixpkgs warnings
1 parent 91c9a62 commit 3a842c3

File tree

69 files changed

+145
-146
lines changed

Some content is hidden

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

69 files changed

+145
-146
lines changed

build.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ in rec {
2020
tests = import ./test/default.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name; };
2121

2222
tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) (
23-
pkgs.recurseIntoAttrs ({
23+
pkgs.lib.recurseIntoAttrs ({
2424
cabal-latest = tool compiler-nix-name "cabal" ({
2525
inherit evalPackages;
2626
} // pkgs.lib.optionalAttrs (ghcFromTo "9.13" "9.14") {
@@ -100,8 +100,8 @@ in rec {
100100

101101
# These are pure parts of maintainer-script so they can be built by hydra
102102
# and added to the cache to speed up buildkite.
103-
maintainer-script-cache = pkgs.recurseIntoAttrs (
104-
(pkgs.lib.optionalAttrs (pkgs.system == "x86_64-linux") {
103+
maintainer-script-cache = pkgs.lib.recurseIntoAttrs (
104+
(pkgs.lib.optionalAttrs (pkgs.stdenv.hostPlatform.system == "x86_64-linux") {
105105
inherit (maintainer-scripts) check-hydra;
106106
})
107107
// (pkgs.lib.optionalAttrs (ifdLevel > 2) {

builder/hspkg-builder.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ let
6262

6363
in rec {
6464
components = haskellLib.applyComponents (buildComp pkg.allComponent) pkg;
65-
checks = pkgs.recurseIntoAttrs (builtins.mapAttrs
65+
checks = pkgs.lib.recurseIntoAttrs (builtins.mapAttrs
6666
(_: d: haskellLib.check d)
6767
(lib.filterAttrs (_: d: d.config.doCheck) components.tests));
6868
inherit (package) identifier detailLevel isLocal isProject buildType;

ci.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: pinnedNixpkgsSrc:
134134
in filterAttrsOnlyRecursive (_: v: platformFilter v && !(isDisabled v)) ({
135135
# Native builds
136136
# TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
137-
native = pkgs.recurseIntoAttrs ({
137+
native = pkgs.lib.recurseIntoAttrs ({
138138
roots = pkgs.haskell-nix.roots' { inherit compiler-nix-name evalPackages; } ifdLevel;
139139
} // pkgs.lib.optionalAttrs runTests {
140140
inherit (build) tests tools maintainer-scripts maintainer-script-cache;
@@ -156,7 +156,7 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: pinnedNixpkgsSrc:
156156
then import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; })
157157
else crossSystem (import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; }));
158158
build = import ./build.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name haskellNix; };
159-
in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) ({
159+
in pkgs.lib.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) ({
160160
roots = pkgs.haskell-nix.roots' { inherit compiler-nix-name evalPackages; } ifdLevel // {
161161
ghc = pkgs.buildPackages.haskell-nix.compiler.${compiler-nix-name}.override { ghcEvalPackages = evalPackages; };
162162
};

lib/default.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ pkgs, stdenv, lib, haskellLib, recurseIntoAttrs, srcOnly }:
1+
{ pkgs, stdenv, lib, haskellLib, srcOnly }:
22

33

44
with haskellLib;
@@ -166,7 +166,7 @@ in {
166166
components =
167167
if lib.isDerivation components || components == {}
168168
then components
169-
else recurseIntoAttrs components;
169+
else lib.recurseIntoAttrs components;
170170
};
171171
packageFilter = _name: package: (package.isHaskell or false) && packageSel package;
172172
filteredPkgs = lib.filterAttrs packageFilter haskellPackages;
@@ -177,7 +177,7 @@ in {
177177
lib.filterAttrs (_: components: components != {}) (
178178
builtins.mapAttrs (_name: packages:
179179
builtins.foldl' (a: b: a // b) {} (map (x: x.components) packages)) packagesGroupedByName);
180-
in recurseIntoAttrs combined;
180+
in lib.recurseIntoAttrs combined;
181181

182182
# Equivalent to collectComponents with (_: true) as selection function.
183183
# Useful for pre-filtered package-set.
@@ -193,7 +193,7 @@ in {
193193
# This can be used to collect all the test runs in your project, so that can be run in CI.
194194
collectChecks = packageSel: haskellPackages:
195195
let packageFilter = _name: package: (package.isHaskell or false) && packageSel package;
196-
in recurseIntoAttrs (lib.filterAttrs (_: x: x != {} && x != recurseIntoAttrs {}) (lib.mapAttrs (_: p: p.checks) (lib.filterAttrs packageFilter haskellPackages)));
196+
in lib.recurseIntoAttrs (lib.filterAttrs (_: x: x != {} && x != lib.recurseIntoAttrs {}) (lib.mapAttrs (_: p: p.checks) (lib.filterAttrs packageFilter haskellPackages)));
197197

198198
# Equivalent to collectChecks with (_: true) as selection function.
199199
# Useful for pre-filtered package-set.

modules/install-plan/redirect.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let
3939
// lib.optionalAttrs (componentsByName ? lib) {
4040
library = lookupComponent "" "" componentsByName.lib;
4141
};
42-
checks = pkgs.recurseIntoAttrs (
42+
checks = pkgs.lib.recurseIntoAttrs (
4343
lib.filterAttrs (_: x: x != {}) (
4444
builtins.mapAttrs
4545
(_: d: pkgs.haskell-nix.haskellLib.check d)

modules/project-common.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ with lib.types;
4343
};
4444
evalSystem = mkOption {
4545
type = str;
46-
default = pkgs.pkgsBuildBuild.stdenv.system;
46+
default = pkgs.pkgsBuildBuild.stdenv.hostPlatform.system;
4747
description = ''
4848
Specifies the system on which `cabal` and `nix-tools` should run.
4949
If not specified the `pkgsBuildBuild` system will be used.
@@ -55,7 +55,7 @@ with lib.types;
5555
evalPackages = mkOption {
5656
type = attrs;
5757
default =
58-
if pkgs.pkgsBuildBuild.stdenv.system == config.evalSystem
58+
if pkgs.pkgsBuildBuild.stdenv.hostPlatform.system == config.evalSystem
5959
then pkgs.pkgsBuildBuild
6060
else
6161
import pkgs.path {

nix-tools/flake.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
pkgs'.nix-tools-set { compilerSelection = lib.mkForce (p: p.haskell-nix.compiler); };
3030

3131
# tarball filename e.g. nix-tools-0.1.0.0-x86_64-unknown-linux-musl.tar.gz
32-
tarball-filename = "${toolset.name}-${pkgs.hostPlatform.config}.tar.gz";
32+
tarball-filename = "${toolset.name}-${pkgs.stdenv.hostPlatform.config}.tar.gz";
3333
in
3434
pkgs.runCommand tarball-filename
3535
{ preferLocalBuild = true; }
@@ -80,13 +80,13 @@
8080
# project's hydraJobs
8181
pkgs.nix-tools-eval-on-linux.project.flake'.hydraJobs
8282
# tarballs with static builds.
83-
// lib.optionalAttrs (pkgs.buildPlatform.system == "x86_64-linux")
83+
// lib.optionalAttrs (pkgs.stdenv.buildPlatform.system == "x86_64-linux")
8484
{ binary-tarball = mkTarball pkgs.pkgsCross.musl64; }
8585
# aarch64-multiplatform-musl cross compile is currently broken
86-
# // lib.optionalAttrs (pkgs.buildPlatform.system == "aarch64-linux")
86+
# // lib.optionalAttrs (pkgs.stdenv.buildPlatform.system == "aarch64-linux")
8787
# { binary-tarball = mkTarball pkgs.pkgsCross.aarch64-multiplatform-musl; }
8888
// {
89-
static = static-nix-tools-outputs.hydraJobs.${pkgs.system};
89+
static = static-nix-tools-outputs.hydraJobs.${pkgs.stdenv.hostPlatform.system};
9090
}
9191
);
9292
};

nix-tools/static/project.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let
4646
};
4747

4848

49-
add-static-libs-to-darwin = pkgs.lib.mkIf pkgs.hostPlatform.isDarwin {
49+
add-static-libs-to-darwin = pkgs.lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
5050
packages.cabal-install.ghcOptions = [
5151
"-L${pkgs.lib.getLib pkgs.static-gmp}/lib"
5252
];

nix-tools/static/zipped.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ let
3131
];
3232
in
3333
customPkgs.packaging.asZip {
34-
name = "${customPkgs.hostPlatform.system}-nix-tools-static";
34+
name = "${customPkgs.stdenv.hostPlatform.system}-nix-tools-static";
3535
drvs' = [
3636
hsPkgs.cabal-install.components.exes.cabal
3737
hsPkgs.hpack.components.exes.hpack
@@ -45,12 +45,12 @@ let
4545
stringifyInputs = inputs: pkgs.lib.mapAttrsToList (name: value: pkgs.lib.trace "${name}=${value}" "${value}") inputs;
4646
# stringifyInputs = inputs: map (x: "${x}") (builtins.attrValues inputs);
4747

48-
fragment-drv = "static-nix-tools-outputs.hydraJobs.${pkgs.hostPlatform.system}.zipped.${fragment-name}";
48+
fragment-drv = "static-nix-tools-outputs.hydraJobs.${pkgs.stdenv.hostPlatform.system}.zipped.${fragment-name}";
4949
in
50-
pkgs.runCommand "${pkgs.hostPlatform.system}-all-nix-tools" {
50+
pkgs.runCommand "${pkgs.stdenv.hostPlatform.system}-all-nix-tools" {
5151
requiredSystemFeatures = [ "recursive-nix" ];
5252
nativeBuildInputs =
53-
# [ inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.nix pkgs.gitMinimal ]
53+
# [ inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system}.nix pkgs.gitMinimal ]
5454
[ (pkgs.lib.trace pkgs.nix.version pkgs.nix) pkgs.gitMinimal ]
5555
++ stringifyInputs inputs
5656
++ stringifyInputs inputs.haskellNix.inputs;
@@ -59,7 +59,7 @@ let
5959
mkdir $out
6060
cp $(nix --offline --extra-experimental-features "flakes nix-command" \
6161
build --accept-flake-config --no-link --print-out-paths --no-allow-import-from-derivation \
62-
--system ${pkgs.hostPlatform.system} \
62+
--system ${pkgs.stdenv.hostPlatform.system} \
6363
${../.}#${fragment-drv})/*.zip $out/
6464
'';
6565

@@ -81,12 +81,12 @@ let
8181

8282

8383
allZippedTools =
84-
pkgs.lib.optionalAttrs (pkgs.system == "x86_64-darwin" || pkgs.system == "aarch64-darwin") {
84+
pkgs.lib.optionalAttrs (pkgs.stdenv.hostPlatform.system == "x86_64-darwin" || pkgs.stdenv.hostPlatform.system == "aarch64-darwin") {
8585
"nix-tools-static" = zippedToolsForDarwin;
8686
"nix-tools-static-no-ifd" = zippedToolsNoIfdFor "nix-tools-static";
8787
}
8888
//
89-
pkgs.lib.optionalAttrs (pkgs.system == "x86_64-linux") {
89+
pkgs.lib.optionalAttrs (pkgs.stdenv.hostPlatform.system == "x86_64-linux") {
9090
"nix-tools-static" = zippedToolsForLinux;
9191
"nix-tools-static-arm64" = zippedToolsForLinuxArm64;
9292

overlays/armv6l-linux.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ final: prev:
22
let
33
isLinuxCross =
44
prev.haskell-nix.haskellLib.isCrossHost
5-
&& prev.hostPlatform.isLinux
6-
&& (prev.hostPlatform.isAarch32
7-
|| prev.hostPlatform.isAarch64
8-
|| prev.hostPlatform.isi686);
5+
&& prev.stdenv.hostPlatform.isLinux
6+
&& (prev.stdenv.hostPlatform.isAarch32
7+
|| prev.stdenv.hostPlatform.isAarch64
8+
|| prev.stdenv.hostPlatform.isi686);
99

1010
in
1111
{

0 commit comments

Comments
 (0)