I’m trying to patch simp1e-cursors (nix package source, upstream) to add some in-between sizes.
This means I need to change the file sizes.txt
.
Presently this is my overlay setup:
{ ... }:
let
addPatches =
pkg: patches:
pkg.overrideAttrs (oldAttrs: {
patches = (oldAttrs.patches or [ ]) ++ patches;
});
in
{
additions = final: _prev: import ../packages final.pkgs;
modifications = final: prev: {
foot = addPatches prev.foot [ ./foot-ctrl-c.patch ];
simp1e-cursors = addPatches prev.simp1e-cursors [ ./simp1e-sizes.patch ];
};
}
with the following simp1e-sizes.patch
:
--- a/sizes.txt
+++ b/sizes.txt
@@ -1,1 +1,1 @@
-24,32,48,72
+24,26,28,30,32,48,72
This doesn’t work, after the rebuild has finished I can cat /nix/store/83...98-source/sizes.txt
and it hasn’t changed.
I also tried
...
simp1e-cursors = prev.simp1e-cursors.overrideAttrs (old: {
prePatch = ''
substituteInPlace sizes.txt \
--replace-{fail,warn,quiet} '24,32,48,72' '24,26,28,30,32,48,72'
cat sizes.txt
exit 1
'';
...
but that told me there wasn’t any matching text:
last 5 log lines:
> Running phase: unpackPhase
> unpacking source archive /nix/store/83r3w27bm4raalxam26xw9vbsz1bg098-source
> source root is source
> Running phase: patchPhase
> substituteStream() in derivation simp1e-cursors-20250223: ERROR: pattern --replace-warn doesn't match anything in file 'sizes.txt'
I also tried the previous method with
...
prePatch = ''
rm sizes.txt
echo 24,26,28,30,32,48,72 > sizes.txt
'';
...
This doesn’t work, after the rebuild has finished I can cat /nix/store/83...98-source/sizes.txt
and it hasn’t changed.
Where am I going wrong? Any help appreciated!