1{
2 mkDerivation,
3 lib,
4 extra-cmake-modules,
5 kdoctools,
6 wrapGAppsHook3,
7 kconfig,
8 kcrash,
9 kinit,
10 kpmcore,
11 polkit-qt,
12 cryptsetup,
13 lvm2,
14 mdadm,
15 smartmontools,
16 systemdMinimal,
17 util-linux,
18 btrfs-progs,
19 dosfstools,
20 e2fsprogs,
21 exfat,
22 f2fs-tools,
23 fatresize,
24 jfsutils,
25 nilfs-utils,
26 ntfs3g,
27 udftools,
28 xfsprogs,
29 zfs,
30}:
31
32let
33 # External programs are resolved by `partition-manager` and then
34 # invoked by `kpmcore_externalcommand` from `kpmcore` as root.
35 # So these packages should be in PATH of `partition-manager`.
36 # https://github.com/KDE/kpmcore/blob/06f15334ecfbe871730a90dbe2b694ba060ee998/src/util/externalcommand_whitelist.h
37 runtimeDeps = lib.makeBinPath [
38 cryptsetup
39 lvm2
40 mdadm
41 smartmontools
42 systemdMinimal
43 util-linux
44
45 btrfs-progs
46 dosfstools
47 e2fsprogs
48 exfat
49 f2fs-tools
50 fatresize
51 # hfsprogs intentionally omitted due to being unmaintained
52 jfsutils
53 nilfs-utils
54 ntfs3g
55 # reiser{4,fs}progs intentionally omitted due to filesystem removal from Linux.
56 udftools
57 xfsprogs
58 zfs
59
60 # FIXME: Missing command: tune.exfat hfsck hformat fsck.nilfs2 {fsck,mkfs,debugfs,tunefs}.ocfs2
61 ];
62
63in
64mkDerivation {
65 pname = "partitionmanager";
66
67 nativeBuildInputs = [
68 extra-cmake-modules
69 kdoctools
70 wrapGAppsHook3
71 ];
72
73 propagatedBuildInputs = [
74 kconfig
75 kcrash
76 kinit
77 kpmcore
78 polkit-qt
79 ];
80
81 dontWrapGApps = true;
82 preFixup = ''
83 qtWrapperArgs+=(
84 "''${gappsWrapperArgs[@]}"
85 --prefix PATH : "${runtimeDeps}"
86 )
87 '';
88
89 passthru = {
90 inherit kpmcore;
91 };
92
93 meta = with lib; {
94 description = "KDE Partition Manager";
95 longDescription = ''
96 KDE Partition Manager is a utility to help you manage the disks, partitions, and file systems on your computer.
97 It allows you to easily create, copy, move, delete, back up, restore, and resize them without losing data.
98 It supports a large number of file systems, including ext2/3/4, btrfs, NTFS, FAT16/32, JFS, XFS and more.
99
100 To install on NixOS, use the option `programs.partition-manager.enable = true`.
101 '';
102 license = with licenses; [
103 cc-by-40
104 cc0
105 gpl3Plus
106 lgpl3Plus
107 mit
108 ];
109 homepage = "https://www.kde.org/applications/system/kdepartitionmanager/";
110 maintainers = with maintainers; [
111 peterhoeg
112 oxalica
113 ];
114 mainProgram = "partitionmanager";
115 };
116}