Skip to content

Commit cebf023

Browse files
committed
fix system handing in nix-portable derivation
1 parent 31dc4f3 commit cebf023

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

default.nix

+6-8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ with builtins;
66
unzip,
77
zip,
88
unixtools,
9+
stdenv,
10+
buildPackages,
911

1012
busybox ? pkgs.pkgsStatic.busybox,
1113
cacert ? pkgs.cacert,
@@ -17,8 +19,6 @@ with builtins;
1719
xz ? pkgs.pkgsStatic.xz,
1820
zstd ? pkgs.pkgsStatic.zstd,
1921
nixStatic ? pkgs.pkgsStatic.nix,
20-
21-
buildSystem ? builtins.currentSystem,
2222
# hardcode executable to run. Useful when creating a bundle.
2323
bundledPackage ? null,
2424
...
@@ -35,23 +35,21 @@ let
3535

3636
nixpkgsSrc = pkgs.path;
3737

38-
pkgsBuild = import pkgs.path { system = buildSystem; };
39-
4038
# TODO: git could be more minimal via:
4139
# perlSupport=false; guiSupport=false; nlsSupport=false;
4240
gitAttribute = "gitMinimal";
4341
git = pkgs."${gitAttribute}";
4442

4543
maketar = targets:
46-
pkgsBuild.stdenv.mkDerivation {
44+
stdenv.mkDerivation {
4745
name = "nix-portable-store-tarball";
48-
nativeBuildInputs = [ pkgsBuild.perl pkgsBuild.zstd ];
46+
nativeBuildInputs = [ perl zstd ];
4947
exportReferencesGraph = map (x: [("closure-" + baseNameOf x) x]) targets;
5048
buildCommand = ''
51-
storePaths=$(perl ${pkgsBuild.pathsFromGraph} ./closure-*)
49+
storePaths=$(perl ${buildPackages.pathsFromGraph} ./closure-*)
5250
mkdir $out
5351
echo $storePaths > $out/index
54-
cp -r ${pkgsBuild.closureInfo { rootPaths = targets; }} $out/closureInfo
52+
cp -r ${buildPackages.closureInfo { rootPaths = targets; }} $out/closureInfo
5553
5654
tar -cf - \
5755
--owner=0 --group=0 --mode=u+rw,uga+r \

flake.nix

+7-7
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@
5454
perl = pkgs.pkgsBuildBuild.perl;
5555
xz = pkgs.pkgsStatic.xz;
5656
zstd = pkgs.pkgsStatic.zstd;
57-
58-
# tar crashed on emulated aarch64 system
59-
buildSystem = "x86_64-linux";
6057
};
6158
in
6259
recursiveUpdate
@@ -87,9 +84,12 @@
8784
}
8885
);
8986

90-
checks = forAllSystems (system: pkgs: pkgs.callPackages ./testing/vm-tests.nix {
91-
inherit (self.packages.${system}) nix-portable;
92-
});
87+
checks = forAllSystems (system: pkgs: pkgs.callPackages ./testing/vm-tests.nix
88+
{inherit (self.packages.${system}) nix-portable;}
89+
// {
90+
inherit (self.packages.${system}.nix-portable);
91+
}
92+
);
9393

9494
packages = forAllSystems (system: pkgs: {
9595
default = self.packages.${system}.nix-portable;
@@ -122,7 +122,7 @@
122122
checks =
123123
lib.getAttrs
124124
[ "x86_64-linux" "aarch64-linux" ]
125-
(self.checks // self.packages);
125+
self.checks;
126126
};
127127
};
128128
}

0 commit comments

Comments
 (0)