Skip to content

Commit 00f9f7f

Browse files
committed
test build time with xcp
1 parent 785c1e0 commit 00f9f7f

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

disko-install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ main() {
256256
if [[ ! -d "${mountPoint}/nix/store" ]]; then
257257
echo "Copying store paths" >&2
258258
mkdir -p "${mountPoint}/nix/store"
259-
xargs cp --recursive --target "${mountPoint}/nix/store" < "${closure_info}/store-paths"
259+
xargs xcp --recursive --target-directory "${mountPoint}/nix/store" < "${closure_info}/store-paths"
260260
echo "Loading nix database" >&2
261261
NIX_STATE_DIR=${mountPoint}/nix/var/nix nix-store --load-db < "${closure_info}/registration"
262262
fi

package.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
{ stdenvNoCC, makeWrapper, lib, path, nix, coreutils, nixos-install-tools, binlore, diskoVersion }:
1+
{ stdenvNoCC, makeWrapper, lib, path, nix, coreutils, nixos-install-tools, binlore, diskoVersion, xcp, callPackage }:
22

33
let
4+
xcp' = callPackage ./xcp.nix {
5+
inherit xcp;
6+
};
47
self = stdenvNoCC.mkDerivation (finalAttrs: {
58
name = "disko";
69
src = ./.;
@@ -16,7 +19,7 @@ let
1619
chmod 755 "$out/bin/$i"
1720
wrapProgram "$out/bin/$i" \
1821
--set DISKO_VERSION "${diskoVersion}" \
19-
--prefix PATH : ${lib.makeBinPath [ nix coreutils nixos-install-tools ]} \
22+
--prefix PATH : ${lib.makeBinPath [ nix coreutils nixos-install-tools xcp' ]} \
2023
--prefix NIX_PATH : "nixpkgs=${path}"
2124
done
2225
'';

xcp.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
rustPlatform,
3+
fetchFromGitHub,
4+
lib,
5+
xcp,
6+
}:
7+
if lib.versionAtLeast xcp.version "0.22.0" then
8+
xcp
9+
else
10+
rustPlatform.buildRustPackage rec {
11+
pname = "xcp";
12+
version = "0.22.0";
13+
14+
src = fetchFromGitHub {
15+
owner = "tarka";
16+
repo = pname;
17+
rev = "v${version}";
18+
hash = "sha256-3Y8/zRdWD6GSkhp1UabGyDrU62h1ZADYd4D1saED1ug=";
19+
};
20+
21+
# no such file or directory errors
22+
doCheck = false;
23+
24+
cargoHash = "sha256-08Yw0HOaV8XKwzrODaBcHato6TfKBeVBa55MWzINAE0=";
25+
26+
inherit (xcp) meta;
27+
}

0 commit comments

Comments
 (0)