disko/package.nix

27 lines
783 B
Nix
Raw Normal View History

{ stdenvNoCC, makeWrapper, lib, path }:
2022-12-09 16:22:45 +03:00
stdenvNoCC.mkDerivation rec {
2022-12-09 16:22:45 +03:00
name = "disko";
2023-02-02 15:51:49 +03:00
src = ./.;
nativeBuildInputs = [
makeWrapper
];
installPhase = ''
2022-12-09 16:22:45 +03:00
mkdir -p $out/bin $out/share/disko
2023-05-16 14:40:03 +03:00
cp -r cli.nix default.nix disk-deactivate lib $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
wrapProgram $out/bin/disko --prefix NIX_PATH : "nixpkgs=${path}"
2022-12-09 16:22:45 +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
}