2023-02-02 15:58:43 +03:00
|
|
|
{ stdenvNoCC, makeWrapper, lib, path }:
|
2022-12-09 16:22:45 +03:00
|
|
|
|
2022-12-09 16:27:30 +03:00
|
|
|
stdenvNoCC.mkDerivation rec {
|
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
|
2023-02-02 16:19:00 +03:00
|
|
|
cp -r cli.nix default.nix disk-deactivate types $out/share/disko
|
2022-12-09 16:22:45 +03:00
|
|
|
sed \
|
|
|
|
-e "s|libexec_dir=\".*\"|libexec_dir=\"$out/share/disko\"|" \
|
|
|
|
-e "s|#!/usr/bin/env.*|#!/usr/bin/env bash|" \
|
2023-02-02 15:51:49 +03:00
|
|
|
disko > $out/bin/disko
|
2022-12-09 16:22:45 +03:00
|
|
|
chmod 755 $out/bin/disko
|
2023-02-02 15:58:43 +03:00
|
|
|
wrapProgram $out/bin/disko --prefix NIX_PATH : "nixpkgs=${path}"
|
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;
|
|
|
|
};
|
2022-12-09 16:22:45 +03:00
|
|
|
}
|