2024-03-07 18:43:43 +03:00
|
|
|
{ stdenvNoCC, makeWrapper, lib, path, nix, coreutils }:
|
2022-12-09 16:22:45 +03:00
|
|
|
|
2024-03-07 18:43:43 +03:00
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
2022-12-09 16:22:45 +03:00
|
|
|
name = "disko";
|
2023-02-02 15:51:49 +03:00
|
|
|
src = ./.;
|
2023-02-02 15:58:43 +03:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
2022-12-09 16:27:30 +03:00
|
|
|
installPhase = ''
|
2022-12-09 16:22:45 +03:00
|
|
|
mkdir -p $out/bin $out/share/disko
|
2024-03-07 18:43:43 +03: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 ]} \
|
|
|
|
--prefix NIX_PATH : "nixpkgs=${path}"
|
|
|
|
done
|
2022-12-09 16:22:45 +03:00
|
|
|
'';
|
2022-12-09 16:27:30 +03:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Format disks with nix-config";
|
|
|
|
homepage = "https://github.com/nix-community/disko";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ lassulus ];
|
|
|
|
platforms = platforms.linux;
|
2024-03-07 18:43:43 +03:00
|
|
|
mainProgram = finalAttrs.name;
|
2022-12-09 16:27:30 +03:00
|
|
|
};
|
2024-03-07 18:43:43 +03:00
|
|
|
})
|