nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 24.05-beta 102 lines 2.1 kB view raw
1{ lib 2, stdenv 3, fetchFromGitLab 4, dpkg 5, gawk 6, perl 7, wget 8, binutils 9, bzip2 10, coreutils 11, util-linux 12, gnugrep 13, gnupg1 14, gnutar 15, gnused 16, gzip 17, xz 18, makeWrapper 19, nix-update-script 20, testers 21, debootstrap 22}: 23 24# USAGE like this: debootstrap sid /tmp/target-chroot-directory 25# There is also cdebootstrap now. Is that easier to maintain? 26let binPath = lib.makeBinPath [ 27 binutils 28 bzip2 29 coreutils 30 dpkg 31 gawk 32 gnugrep 33 gnupg1 34 gnused 35 gnutar 36 gzip 37 perl 38 wget 39 xz 40 ]; 41in stdenv.mkDerivation rec { 42 pname = "debootstrap"; 43 version = "1.0.131"; 44 45 src = fetchFromGitLab { 46 domain = "salsa.debian.org"; 47 owner = "installer-team"; 48 repo = pname; 49 rev = "refs/tags/${version}"; 50 hash = "sha256-rwNcrS2GzVs0JYxeHcpLMG9FDwSpthNmZIemn95hC6g="; 51 }; 52 53 nativeBuildInputs = [ makeWrapper ]; 54 55 dontBuild = true; 56 57 installPhase = '' 58 runHook preInstall 59 60 substituteInPlace debootstrap \ 61 --replace 'CHROOT_CMD="chroot ' 'CHROOT_CMD="${coreutils}/bin/chroot ' \ 62 --replace 'CHROOT_CMD="unshare ' 'CHROOT_CMD="${util-linux}/bin/unshare ' \ 63 --replace /usr/bin/dpkg ${dpkg}/bin/dpkg \ 64 --replace '#!/bin/sh' '#!/bin/bash' \ 65 --subst-var-by VERSION ${version} 66 67 d=$out/share/debootstrap 68 mkdir -p $out/{share/debootstrap,bin} 69 70 mv debootstrap $out/bin 71 72 cp -r . $d 73 74 wrapProgram $out/bin/debootstrap \ 75 --set PATH ${binPath} \ 76 --set-default DEBOOTSTRAP_DIR $d 77 78 mkdir -p $out/man/man8 79 mv debootstrap.8 $out/man/man8 80 81 rm -rf $d/debian 82 83 runHook postInstall 84 ''; 85 86 passthru = { 87 updateScript = nix-update-script { }; 88 tests.version = testers.testVersion { 89 package = debootstrap; 90 }; 91 }; 92 93 meta = with lib; { 94 changelog = "https://salsa.debian.org/installer-team/debootstrap/-/blob/${version}/debian/changelog"; 95 description = "Tool to create a Debian system in a chroot"; 96 homepage = "https://wiki.debian.org/Debootstrap"; 97 license = licenses.mit; 98 maintainers = with maintainers; [ marcweber ]; 99 platforms = platforms.linux; 100 mainProgram = "debootstrap"; 101 }; 102}