diff --git a/flake.nix b/flake.nix index 748c828..e64ad8f 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = { diff --git a/rizin-with-plugin-support.nix b/rizin-with-plugin-support.nix index 0ca17e3..8d229b0 100644 --- a/rizin-with-plugin-support.nix +++ b/rizin-with-plugin-support.nix @@ -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 [ ]