Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/symlinkScript/checks/filesToPatch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ test "filesToPatch-test" {
package = pkgs.hello;
wrapperImplementation = "binary";
wrapperVariants.fileToBePatched.exePath = "bin/hello"; # <- not the main one, the outer wrapper module will thus not wrap it automatically.
flags."--greeting" = "Hello, ${placeholder "out"}";
flags."--greeting" = "Hello,\0 ${placeholder "out"}";
}
)
];
Expand Down
4 changes: 2 additions & 2 deletions modules/symlinkScript/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
echo "Patching $file"
# Remove symlink and create a real file with patched content
rm "$file"
# Use replace-literal which works for both text and binary files
${pkgs.replace}/bin/replace-literal "$oldPath" "$newPath" < "$target" > "$file"
# Use gnused explicitly which works for both text and binary files
${pkgs.gnused}/bin/sed "s|$oldPath|$newPath|g" "$target" > "$file"
# Preserve permissions
chmod --reference="$target" "$file"
fi
Expand Down