zram-generator: format with nixfmt, use --replace-fail instead of --replace

This commit is contained in:
Nick Cao 2024-11-27 23:06:33 -05:00
parent ff3f176cdd
commit 754f5fb90d
No known key found for this signature in database

View File

@ -1,13 +1,14 @@
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, pkg-config
, bash
, ronn
, systemd
, kmod
, nixosTests
{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
pkg-config,
bash,
ronn,
systemd,
kmod,
nixosTests,
}:
rustPlatform.buildRustPackage rec {
@ -28,10 +29,10 @@ rustPlatform.buildRustPackage rec {
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
substituteInPlace Makefile \
--replace 'target/$(BUILDTYPE)' 'target/${stdenv.hostPlatform.rust.rustcTargetSpec}/$(BUILDTYPE)'
--replace-fail 'target/$(BUILDTYPE)' 'target/${stdenv.hostPlatform.rust.rustcTargetSpec}/$(BUILDTYPE)'
substituteInPlace src/generator.rs \
--replace 'Command::new("systemd-detect-virt")' 'Command::new("${systemd}/bin/systemd-detect-virt")' \
--replace 'Command::new("modprobe")' 'Command::new("${kmod}/bin/modprobe")'
--replace-fail 'Command::new("systemd-detect-virt")' 'Command::new("${systemd}/bin/systemd-detect-virt")' \
--replace-fail 'Command::new("modprobe")' 'Command::new("${kmod}/bin/modprobe")'
substituteInPlace src/config.rs \
--replace-fail 'Command::new("/bin/sh")' 'Command::new("${bash}/bin/sh")'
'';