Add wrapped atool with every archiver

This commit is contained in:
NullBite 2024-02-15 19:48:52 +01:00
parent 6a727b61d5
commit b30056ca44
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
3 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,36 @@
{ lib,
atool,
makeBinaryWrapper,
stdenvNoCC,
lzip,
plzip,
lzop,
lzma,
zip,
unzip,
arj,
rpm,
cpio,
p7zip,
unrar,
lha,
unfree ? false }:
let
wrappedPath = lib.makeBinPath ([lzip plzip lzop lzma zip unzip arj rpm cpio p7zip] ++ lib.optionals unfree [unrar lha]);
in
stdenvNoCC.mkDerivation {
name = "atool-wrapped";
phases = [ "installPhase" ];
nativeBuildInputs = [ makeBinaryWrapper ];
src = ./.;
installPhase = ''
makeBinaryWrapper "${atool}/bin/atool" "$out/bin/atool" \
--inherit-argv0 --prefix PATH : "${wrappedPath}"
for i in acat adiff als apack arepack aunpack ; do
ln -s $out/bin/atool $out/bin/$i
done
# i have no idea if this is the "right" way to do this
mkdir -p "$out/share"
ln -s "${atool}/share/man" "$out/share/man"
'';
}

16
pkgs/cofi/shell.nix Normal file
View File

@ -0,0 +1,16 @@
{ pkgs ? import <nixpkgs> {} }:
let
rofi-dmenu-wrapped = pkgs.writeShellScript "rofi-dmenu" ''
exec "${pkgs.rofi-wayland}/bin/rofi" -dmenu "$@"
'';
in
pkgs.mkShell {
shellHook = ''
export COMMA_PICKER="${rofi-dmenu-wrapped}"
'';
nativeBuildInputs = with pkgs; [
rofi-wayland
libnotify
comma
];
}

View File

@ -6,4 +6,5 @@ in
{
google-fonts = callPackage ./google-fonts { };
wm-helpers = callPackage ./wm-helpers { };
atool = callPackage ./atool-wrapped { };
}