Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchurl,
5 autoPatchelfHook,
6 makeWrapper,
7 parted,
8 util-linux,
9 dosfstools,
10 exfatprogs,
11 e2fsprogs,
12 ntfs3g,
13 btrfs-progs,
14 xfsprogs,
15 jfsutils,
16 f2fs-tools,
17 nix-update-script,
18}:
19
20stdenv.mkDerivation (finalAttrs: {
21 pname = "tparted";
22 version = "2025-01-24";
23
24 src = fetchurl {
25 url = "https://github.com/Kagamma/tparted/releases/download/${finalAttrs.version}/linux_x86-64_tparted_${finalAttrs.version}.tar.gz";
26 hash = "sha256-7V3bdsP4uqZ5zyw3j/s8fhMYFCyQ1Rz5Z1JiPFc1oFY=";
27 };
28
29 nativeBuildInputs = [
30 autoPatchelfHook
31 makeWrapper
32 ];
33
34 postFixup = ''
35 wrapProgram $out/bin/tparted \
36 --prefix PATH : ${
37 lib.makeBinPath [
38 parted
39 util-linux
40 dosfstools
41 exfatprogs
42 e2fsprogs
43 ntfs3g
44 btrfs-progs
45 xfsprogs
46 jfsutils
47 f2fs-tools
48 ]
49 }
50 '';
51
52 runtimeDependencies = [
53 parted
54 util-linux
55 dosfstools
56 exfatprogs
57 e2fsprogs
58 ntfs3g
59 btrfs-progs
60 xfsprogs
61 jfsutils
62 f2fs-tools
63 ];
64
65 unpackPhase = ''
66 runHook preUnpack
67 tar xf $src
68 runHook postUnpack
69 '';
70
71 installPhase = ''
72 runHook preInstall
73 mkdir -p $out/bin
74 cp tparted $out/bin/
75 mkdir -p $out/opt/tparted
76 cp -r locale $out/opt/tparted/
77 runHook postInstall
78 '';
79
80 passthru = {
81 updateScript = nix-update-script { };
82 };
83
84 meta = {
85 description = "Text-based user interface (TUI) frontend for parted";
86 homepage = "https://github.com/Kagamma/tparted";
87 changelog = "https://github.com/Kagamma/tparted/releases/tag/${finalAttrs.version}";
88 license = lib.licenses.gpl3;
89 maintainers = with lib.maintainers; [ liberodark ];
90 sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
91 mainProgram = "tparted";
92 };
93})