2024-01-13 08:15:51 +00:00
|
|
|
{ stdenvNoCC
|
|
|
|
, makeWrapper
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, bash
|
|
|
|
, nix
|
2024-04-21 15:54:59 +00:00
|
|
|
, coreutils
|
2024-01-13 08:15:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
|
|
|
name = "disko";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.6.1";
|
2024-01-13 08:15:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "disko";
|
|
|
|
rev = "v${finalAttrs.version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-5CNvkH0Nf7yMwgKhjUNg/lUK40C7DXB4zKOuA2jVO90=";
|
2024-01-13 08:15:51 +00:00
|
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ bash ];
|
|
|
|
installPhase = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
runHook preInstall
|
2024-01-13 08:15:51 +00:00
|
|
|
mkdir -p $out/bin $out/share/disko
|
2024-04-21 15:54:59 +00:00
|
|
|
cp -r install-cli.nix cli.nix default.nix disk-deactivate lib $out/share/disko
|
|
|
|
|
|
|
|
for i in disko disko-install; do
|
|
|
|
sed -e "s|libexec_dir=\".*\"|libexec_dir=\"$out/share/disko\"|" "$i" > "$out/bin/$i"
|
|
|
|
chmod 755 "$out/bin/$i"
|
|
|
|
wrapProgram "$out/bin/$i" --prefix PATH : ${lib.makeBinPath [ nix coreutils ]}
|
|
|
|
done
|
|
|
|
runHook postInstall
|
2024-01-13 08:15:51 +00:00
|
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
runHook preInstallCheck
|
2024-01-13 08:15:51 +00:00
|
|
|
$out/bin/disko --help
|
2024-04-21 15:54:59 +00:00
|
|
|
$out/bin/disko-install --help
|
|
|
|
runHook postInstallCheck
|
2024-01-13 08:15:51 +00:00
|
|
|
'';
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/nix-community/disko";
|
|
|
|
description = "Declarative disk partitioning and formatting using nix";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
mainProgram = "disko";
|
|
|
|
maintainers = with lib.maintainers; [ mic92 lassulus ];
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
})
|