adapt nim.nix and nimble.nix to two previous commits

This commit is contained in:
Ivan FB 2026-04-04 16:56:20 +02:00
parent 8bfbe4f48f
commit f72437c573
No known key found for this signature in database
GPG Key ID: DF0C67A04C543270
2 changed files with 16 additions and 12 deletions

View File

@ -1,17 +1,19 @@
# Fetches the Nim source tree at the exact revision pinned in nimble.lock.
# Fetches the Nim source tree at the exact revision declared in waku.nimble.
# The compiler binary is still pkgs.nim-2_2 (pre-built); this source is
# used to pin the stdlib to the same commit.
# Regenerate sha256 with:
# nix shell nixpkgs#nix-prefetch-git --command \
# nix-prefetch-git --url <url> --rev <vcsRevision> --fetch-submodules
# nix-prefetch-git --url https://github.com/nim-lang/Nim.git --rev v<version> --fetch-submodules
{ pkgs }:
let
lock = builtins.fromJSON (builtins.readFile ../nimble.lock);
entry = lock.packages.nim;
lines = pkgs.lib.splitString "\n" (builtins.readFile ../waku.nimble);
versionLine = builtins.head (builtins.filter
(l: builtins.match "^const NimVersion.*" l != null) lines);
version = builtins.head (builtins.match ".*\"([0-9]+\\.[0-9]+\\.[0-9]+)\".*" versionLine);
in
pkgs.fetchgit {
url = entry.url;
rev = "v${entry.version}";
url = "https://github.com/nim-lang/Nim.git";
rev = "v${version}";
sha256 = "1g4nxbwbc6h174gbpa3gcs47xwk6scbmiqlp0nq1ig3af8fcqcnj";
fetchSubmodules = true;
}

View File

@ -1,15 +1,17 @@
# Fetches Nimble at the exact revision pinned in nimble.lock.
# Fetches Nimble at the exact revision declared in waku.nimble.
# Regenerate sha256 with:
# nix shell nixpkgs#nix-prefetch-git --command \
# nix-prefetch-git --url <url> --rev <vcsRevision> --fetch-submodules
# nix-prefetch-git --url https://github.com/nim-lang/nimble --rev v<version> --fetch-submodules
{ pkgs }:
let
lock = builtins.fromJSON (builtins.readFile ../nimble.lock);
entry = lock.packages.nimble;
lines = pkgs.lib.splitString "\n" (builtins.readFile ../waku.nimble);
versionLine = builtins.head (builtins.filter
(l: builtins.match "^const NimbleVersion.*" l != null) lines);
version = builtins.head (builtins.match ".*\"([0-9]+\\.[0-9]+\\.[0-9]+)\".*" versionLine);
in
pkgs.fetchgit {
url = entry.url;
rev = "v${entry.version}";
url = "https://github.com/nim-lang/nimble";
rev = "v${version}";
sha256 = "18cwsjwcgjmnm42kr310hfbw06lym3vaj641i4pla6r8w22xqpqd";
fetchSubmodules = true;
}