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: {
rizin-unwrapped = prev.rizin.overrideAttrs (o: {
mesonFlags = o.mesonFlags ++ ["-Dportable=true"];
mesonFlags = o.mesonFlags ++ [ "-Dportable=true" ];
});
rizin = self.packages.${prev.system}.rizin;
rizinPlugins = {

View file

@ -1,21 +1,23 @@
{ rizin-unwrapped, rizinPlugins, symlinkJoin }:
let
makeRizinPackageWithPlugins = plugins:
symlinkJoin {
name = "rizin";
paths = [ rizin-unwrapped ] ++ plugins;
postBuild = ''
cd $out/bin/
for file in ./*; do
# Rizin loads plugins from a path relative to /proc/self/exe.
# /proc/self/exe resolves symlinks so we need to copy the resulting binary.
# 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
symlinkJoin
{
name = "rizin";
paths = [ rizin-unwrapped ] ++ plugins;
postBuild = ''
cd $out/bin/
for file in ./*; do
# Rizin loads plugins from a path relative to /proc/self/exe.
# /proc/self/exe resolves symlinks so we need to copy the resulting binary.
# 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"
done
'';
} // {
cp --remove-destination "$(readlink "$file")" "$file"
done
'';
} // {
withPlugins = p: makeRizinPackageWithPlugins (plugins ++ (p rizinPlugins));
};
in makeRizinPackageWithPlugins []
in
makeRizinPackageWithPlugins [ ]