1 { lib, stdenv, fetchFromGitLab, makeWrapper, nixosTests,
2 # optional dependencies, the command(s) they provide
4 grub2, # grub-mount and grub-probe
5 cryptsetup, # cryptsetup
6 libuuid, # blkid and blockdev
13 stdenv.mkDerivation rec {
16 src = fetchFromGitLab {
17 domain = "salsa.debian.org";
18 owner = "installer-team";
21 sha256 = "sha256-3FXfGadIcmKp4qn6ZDcOSQHYsUNP2ObL1cJesNle+8A=";
24 nativeBuildInputs = [ makeWrapper ];
27 install -Dt $out/bin os-prober linux-boot-prober
28 install -Dt $out/lib newns
29 install -Dt $out/share common.sh
32 case "${stdenv.hostPlatform.system}" in
33 i686*|x86_64*) ARCH=x86;;
34 powerpc*) ARCH=powerpc;;
38 for probes in os-probes os-probes/mounted os-probes/init linux-boot-probes linux-boot-probes/mounted; do
39 install -Dt $out/lib/$probes $probes/common/*;
40 if [ -e "$probes/$ARCH" ]; then
41 mkdir -p $out/lib/$probes
42 cp -r $probes/$ARCH/* $out/lib/$probes;
45 if [ $ARCH = "x86" ]; then
46 cp -r os-probes/mounted/powerpc/20macosx $out/lib/os-probes/mounted;
50 for file in $(find $out -type f ! -name newns) ; do
51 substituteInPlace $file \
52 --replace /usr/share/os-prober/ $out/share/ \
53 --replace /usr/lib/os-probes/ $out/lib/os-probes/ \
54 --replace /usr/lib/linux-boot-probes/ $out/lib/linux-boot-probes/ \
55 --replace /usr/lib/os-prober/ $out/lib/
57 for file in $out/bin/*; do
59 --suffix PATH : ${lib.makeBinPath [ grub2 systemd coreutils cryptsetup libuuid ntfs3g lvm2 dmraid ]} \
60 --run "[ -d /var/lib/os-prober ] || mkdir /var/lib/os-prober"
65 os-prober = nixosTests.os-prober;
68 description = "Utility to detect other OSs on a set of drives";
69 homepage = "http://packages.debian.org/source/sid/os-prober";
70 license = licenses.gpl2Plus;
71 mainProgram = "os-prober";
72 maintainers = with maintainers; [ symphorien ];
73 platforms = platforms.linux;