disko/package.nix

30 lines
954 B
Nix
Raw Permalink Normal View History

{ stdenvNoCC, makeWrapper, lib, path, nix, coreutils, nixos-install-tools }:
2022-12-09 13:22:45 +00:00
2024-03-07 15:43:43 +00:00
stdenvNoCC.mkDerivation (finalAttrs: {
2022-12-09 13:22:45 +00:00
name = "disko";
2023-02-02 12:51:49 +00:00
src = ./.;
nativeBuildInputs = [
makeWrapper
];
installPhase = ''
2022-12-09 13:22:45 +00:00
mkdir -p $out/bin $out/share/disko
2024-03-07 15:43:43 +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 nixos-install-tools ]} \
2024-03-07 15:43:43 +00:00
--prefix NIX_PATH : "nixpkgs=${path}"
done
2022-12-09 13:22:45 +00: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 15:43:43 +00:00
mainProgram = finalAttrs.name;
};
2024-03-07 15:43:43 +00:00
})