disko/package.nix
2023-05-20 13:56:42 +02:00

27 lines
783 B
Nix

{ stdenvNoCC, makeWrapper, lib, path }:
stdenvNoCC.mkDerivation rec {
name = "disko";
src = ./.;
nativeBuildInputs = [
makeWrapper
];
installPhase = ''
mkdir -p $out/bin $out/share/disko
cp -r cli.nix default.nix disk-deactivate lib $out/share/disko
sed \
-e "s|libexec_dir=\".*\"|libexec_dir=\"$out/share/disko\"|" \
-e "s|#!/usr/bin/env.*|#!/usr/bin/env bash|" \
disko > $out/bin/disko
chmod 755 $out/bin/disko
wrapProgram $out/bin/disko --prefix NIX_PATH : "nixpkgs=${path}"
'';
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;
};
}