Use a patch instead of branch for handlebars-rust

This commit is contained in:
Paul Brinkmeier 2025-03-19 21:11:08 +01:00
parent 046e80f4f7
commit 79104ac007
3 changed files with 1926 additions and 9 deletions

1914
add-cargo-lockfile.patch Normal file

File diff suppressed because it is too large Load Diff

11
flake.lock generated
View File

@ -3,16 +3,15 @@
"handlebars-rust-src": { "handlebars-rust-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1739333321, "lastModified": 1742083927,
"narHash": "sha256-McP84Thhkp+MkMYYDSi21Kl+oTuQbl0WVNOp6/xZZmI=", "narHash": "sha256-sznEJH+YggDirDtp+DSCIn0pJyEjS1ombF3idL1T2qo=",
"owner": "pbrinkmeier-almato", "owner": "sunng87",
"repo": "handlebars-rust", "repo": "handlebars-rust",
"rev": "689af230cfae35ed38d1b2506125a680ffa7ca38", "rev": "7d666fb7cf117a951f44abb2a5a40029bd627ef7",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "pbrinkmeier-almato", "owner": "sunng87",
"ref": "cargo-lock",
"repo": "handlebars-rust", "repo": "handlebars-rust",
"type": "github" "type": "github"
} }

View File

@ -1,8 +1,7 @@
{ {
inputs = { inputs = {
handlebars-rust-src = { handlebars-rust-src = {
# TODO: Instead of a fork this could be integrated into this repo as a rather simple patch, reducing external depedencies. url = "github:sunng87/handlebars-rust";
url = "github:pbrinkmeier-almato/handlebars-rust/cargo-lock";
flake = false; flake = false;
}; };
naersk.url = "github:nix-community/naersk/master"; naersk.url = "github:nix-community/naersk/master";
@ -18,7 +17,12 @@
in in
rec { rec {
packages = { packages = {
handlebars-rust = naersk-lib.buildPackage handlebars-rust-src; # naersk doesnt work without a Cargo.lock => patch it in
handlebars-rust = naersk-lib.buildPackage (pkgs.applyPatches {
name = "patched-handlebars-rust-src";
src = handlebars-rust-src;
patches = [ ./add-cargo-lockfile.patch ];
});
squeezer = naersk-lib.buildPackage ./squeezer; squeezer = naersk-lib.buildPackage ./squeezer;
}; };
devShells = { devShells = {