Format nixpkgs

This commit is contained in:
bad 2022-08-02 19:15:07 +02:00
parent 3f91ac23a0
commit f690335d83
2 changed files with 18 additions and 16 deletions

View File

@ -8,7 +8,7 @@
{ {
overlays.default = final: prev: { overlays.default = final: prev: {
rizin-unwrapped = prev.rizin.overrideAttrs (o: { rizin-unwrapped = prev.rizin.overrideAttrs (o: {
mesonFlags = o.mesonFlags ++ ["-Dportable=true"]; mesonFlags = o.mesonFlags ++ [ "-Dportable=true" ];
}); });
rizin = self.packages.${prev.system}.rizin; rizin = self.packages.${prev.system}.rizin;
rizinPlugins = { rizinPlugins = {

View File

@ -1,21 +1,23 @@
{ rizin-unwrapped, rizinPlugins, symlinkJoin }: { rizin-unwrapped, rizinPlugins, symlinkJoin }:
let let
makeRizinPackageWithPlugins = plugins: makeRizinPackageWithPlugins = plugins:
symlinkJoin { symlinkJoin
name = "rizin"; {
paths = [ rizin-unwrapped ] ++ plugins; name = "rizin";
postBuild = '' paths = [ rizin-unwrapped ] ++ plugins;
cd $out/bin/ postBuild = ''
for file in ./*; do cd $out/bin/
# Rizin loads plugins from a path relative to /proc/self/exe. for file in ./*; do
# /proc/self/exe resolves symlinks so we need to copy the resulting binary. # Rizin loads plugins from a path relative to /proc/self/exe.
# This is obviously not ideal, but the binaries weight only a few kibibytes # /proc/self/exe resolves symlinks so we need to copy the resulting binary.
# and nix can replace the copy with a hardlink automatically, via nix store optimize # This is obviously not ideal, but the binaries weight only a few kibibytes
# and nix can replace the copy with a hardlink automatically, via nix store optimize
cp --remove-destination "$(readlink "$file")" "$file" cp --remove-destination "$(readlink "$file")" "$file"
done done
''; '';
} // { } // {
withPlugins = p: makeRizinPackageWithPlugins (plugins ++ (p rizinPlugins)); withPlugins = p: makeRizinPackageWithPlugins (plugins ++ (p rizinPlugins));
}; };
in makeRizinPackageWithPlugins [] in
makeRizinPackageWithPlugins [ ]