25 # USAGE like this: debootstrap sid /tmp/target-chroot-directory
26 # There is also cdebootstrap now. Is that easier to maintain?
28 binPath = lib.makeBinPath [
45 stdenv.mkDerivation rec {
46 pname = "debootstrap";
47 version = "1.0.140_bpo12+1";
49 src = fetchFromGitLab {
50 domain = "salsa.debian.org";
51 owner = "installer-team";
53 rev = "refs/tags/${version}";
54 hash = "sha256-4vINaMRo6IrZ6e2/DAJ06ODy2BWm4COR1JDSY52upUc=";
57 nativeBuildInputs = [ makeWrapper ];
64 substituteInPlace debootstrap \
65 --replace 'CHROOT_CMD="chroot ' 'CHROOT_CMD="${coreutils}/bin/chroot ' \
66 --replace 'CHROOT_CMD="unshare ' 'CHROOT_CMD="${util-linux}/bin/unshare ' \
67 --replace /usr/bin/dpkg ${dpkg}/bin/dpkg \
68 --replace '#!/bin/sh' '#!/bin/bash' \
69 --subst-var-by VERSION ${version}
71 d=$out/share/debootstrap
72 mkdir -p $out/{share/debootstrap,bin}
74 mv debootstrap $out/bin
78 wrapProgram $out/bin/debootstrap \
79 --set PATH ${binPath} \
80 --set-default DEBOOTSTRAP_DIR $d
82 mkdir -p $out/man/man8
83 mv debootstrap.8 $out/man/man8
91 updateScript = nix-update-script { };
92 tests.version = testers.testVersion {
93 package = debootstrap;
98 changelog = "https://salsa.debian.org/installer-team/debootstrap/-/blob/${version}/debian/changelog";
99 description = "Tool to create a Debian system in a chroot";
100 homepage = "https://wiki.debian.org/Debootstrap";
101 license = licenses.mit;
102 maintainers = with maintainers; [ marcweber ];
103 platforms = platforms.linux;
104 mainProgram = "debootstrap";