2023-08-22 20:05:09 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, bash
|
|
|
|
, btrfs-progs
|
|
|
|
, cmake
|
|
|
|
, coreutils
|
|
|
|
, git
|
|
|
|
, pkg-config
|
2024-04-21 15:54:59 +00:00
|
|
|
, qt6
|
2023-08-22 20:05:09 +00:00
|
|
|
, snapper
|
|
|
|
, util-linux
|
|
|
|
, enableSnapper ? true
|
2024-04-21 15:54:59 +00:00
|
|
|
, nix-update-script
|
2023-08-22 20:05:09 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "btrfs-assistant";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.0";
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "btrfs-assistant";
|
|
|
|
repo = "btrfs-assistant";
|
|
|
|
rev = finalAttrs.version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-nE8Vsc0leXWhbrjMgJDef6jl9MqdojRniGcvUmrQNUQ=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
git
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
btrfs-progs
|
2024-04-21 15:54:59 +00:00
|
|
|
qt6.qtbase
|
|
|
|
qt6.qtsvg
|
|
|
|
qt6.qttools
|
|
|
|
qt6.qtwayland
|
2023-08-22 20:05:09 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
propagatedBuildInputs = [ qt6.wrapQtAppsHook ];
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace src/util/System.cpp \
|
|
|
|
--replace '/bin/bash' "${lib.getExe bash}"
|
|
|
|
''
|
|
|
|
+ lib.optionalString enableSnapper ''
|
|
|
|
substituteInPlace src/main.cpp \
|
|
|
|
--replace '/usr/bin/snapper' "${lib.getExe snapper}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/org.btrfs-assistant.pkexec.policy \
|
|
|
|
--replace '/usr/bin' "$out/bin"
|
|
|
|
|
|
|
|
substituteInPlace src/btrfs-assistant \
|
|
|
|
--replace 'btrfs-assistant-bin' "$out/bin/btrfs-assistant-bin"
|
|
|
|
|
|
|
|
substituteInPlace src/btrfs-assistant-launcher \
|
|
|
|
--replace 'btrfs-assistant' "$out/bin/btrfs-assistant"
|
|
|
|
''
|
|
|
|
+ lib.optionalString enableSnapper ''
|
|
|
|
substituteInPlace src/btrfs-assistant.conf \
|
|
|
|
--replace '/usr/bin/snapper' "${lib.getExe snapper}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
qtWrapperArgs =
|
|
|
|
let
|
|
|
|
runtimeDeps = lib.makeBinPath ([
|
|
|
|
coreutils
|
|
|
|
util-linux
|
|
|
|
]
|
|
|
|
++ lib.optionals enableSnapper [ snapper ]);
|
|
|
|
in
|
|
|
|
[
|
|
|
|
"--prefix PATH : ${runtimeDeps}"
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
meta = {
|
|
|
|
description = "A GUI management tool to make managing a Btrfs filesystem easier";
|
|
|
|
homepage = "https://gitlab.com/btrfs-assistant/btrfs-assistant";
|
|
|
|
license = lib.licenses.gpl3Only;
|
|
|
|
mainProgram = "btrfs-assistant-bin";
|
|
|
|
maintainers = with lib.maintainers; [ khaneliman ];
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
})
|