2022-12-09 13:27:30 +00:00
|
|
|
{ stdenvNoCC, lib }:
|
2022-12-09 13:22:45 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inclFiles = {src, name}: files: lib.cleanSourceWith {
|
|
|
|
inherit src name;
|
|
|
|
filter = _path: _type: _type == "regular" && lib.any (file: builtins.baseNameOf _path == file) files;
|
|
|
|
};
|
|
|
|
in
|
2022-12-09 13:27:30 +00:00
|
|
|
stdenvNoCC.mkDerivation rec {
|
2022-12-09 13:22:45 +00:00
|
|
|
name = "disko";
|
2022-12-09 13:27:30 +00:00
|
|
|
src = inclFiles { inherit name; src = ./.; } [
|
|
|
|
"disko"
|
|
|
|
"cli.nix"
|
|
|
|
"default.nix"
|
|
|
|
"types.nix"
|
|
|
|
"options.nix"
|
|
|
|
];
|
|
|
|
installPhase = ''
|
2022-12-09 13:22:45 +00:00
|
|
|
mkdir -p $out/bin $out/share/disko
|
|
|
|
cp -r $src/* $out/share/disko
|
|
|
|
sed \
|
|
|
|
-e "s|libexec_dir=\".*\"|libexec_dir=\"$out/share/disko\"|" \
|
|
|
|
-e "s|#!/usr/bin/env.*|#!/usr/bin/env bash|" \
|
|
|
|
$src/disko > $out/bin/disko
|
|
|
|
chmod 755 $out/bin/disko
|
|
|
|
'';
|
2022-12-09 13:27:30 +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;
|
|
|
|
};
|
2022-12-09 13:22:45 +00:00
|
|
|
}
|