kde ark: add unrar to decompress .rar archives

This commit is contained in:
Daniel Langbein 2025-01-06 18:57:51 +01:00
parent 8a0df61165
commit 2000500f76
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
3 changed files with 46 additions and 2 deletions

43
modules/ark.nix Normal file
View File

@ -0,0 +1,43 @@
# Archive manager: Compress and decompress
# https://github.com/NixOS/nixpkgs/issues/311240
# The package definition for `kdePackages.ark` does not specify the extra tools that can be used by Ark. The older definition `libsForQt5.ark` contains extra tools such as unar to handle extra types of archives.
#
# Solution: To extract `.rar` files, we manually override some of the attributes based on how it is done in the old file of `libsForQt5.ark`.
{ config, pkgs, mkKdeDerivation, lib, ... }:
let
extraTools = with pkgs; [
p7zip
lrzip
unar
unrar
];
# https://ryantm.github.io/nixpkgs/using/overrides/#sec-pkg-overrideAttrs
ark-with-unrar = pkgs.kdePackages.ark.overrideAttrs {
buildInputs = with pkgs; [
libarchive
libzip
] ++ extraTools;
qtWrapperArgs = [
"--prefix"
"PATH"
":"
(lib.makeBinPath extraTools)
];
};
in
{
allowUnfree = [
# Required for ark
"unrar"
];
users.users.yoda = {
packages = with pkgs; [
ark-with-unrar # Archive manager: Compress and decompress
];
};
}

View File

@ -40,6 +40,7 @@
#
environment.plasma6.excludePackages = with pkgs.kdePackages; [
krdp # Remote Desktop Protocol (RDP)
ark # Archive manager: Compress and decompress
];
# GNOME desktop integration.

View File

@ -1,7 +1,7 @@
{ config, pkgs, ... }:
{ config, pkgs, mkKdeDerivation, lib, ... }:
{
imports = [
./file-roller.nix
./ark.nix # Archive manager: Compress and decompress
];
nixpkgs.config.permittedInsecurePackages = [