nixpkgs/pkgs/by-name/ni/nim-unwrapped-1_0/package.nix
NAHO c8d4dabc43
pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00

30 lines
704 B
Nix

{
lib,
stdenv,
fetchurl,
nim-unwrapped-2,
}:
nim-unwrapped-2.overrideAttrs (
finalAttrs: prevAttrs: {
version = "1.6.20";
src = fetchurl {
url = "https://nim-lang.org/download/nim-${finalAttrs.version}.tar.xz";
hash = "sha256-/+0EdQTR/K9hDw3Xzz4Ce+kaKSsMnFEWFQTC87mE/7k=";
};
patches =
builtins.filter (
p:
builtins.elem (baseNameOf p) [
"NIM_CONFIG_DIR.patch"
"nixbuild.patch"
]
) nim-unwrapped-2.patches
++ [
./extra-mangling.patch
# Mangle store paths of modules to prevent runtime dependence.
]
++ lib.optional (!stdenv.hostPlatform.isWindows) ./toLocation.patch;
}
)