1{2 lib,3 craneLib,4 rustPlatform,5 pam,6 coreutils,7}: let8 crateName = "polkit-backend";9in10 craneLib.buildPackage {11 src = lib.cleanSourceWith {12 src = ../.;13 filter = path: type:14 (lib.hasSuffix "\.conf" path)15 || (lib.hasSuffix "\.service" path)16 || (craneLib.filterCargoSources path type);17 };1819 pname = crateName;20 installPhase = ''21 mkdir -p $out/libexec22 cp -ar $src/cmds/${crateName}/share $out/23 cp -ar $src/cmds/${crateName}/etc $out/24 25 chmod a+w -R $out/share26 cp target/release/${crateName} $out/libexec/2728 substituteInPlace $out/share/dbus-1/system-services/lach.polkit.helper1.conf \29 --replace-fail /bin/false ${coreutils}/bin/false30 substituteInPlace $out/etc/systemd/system/remowt-polkit-helper.service \31 --replace-fail @libexecdir@ ${placeholder "out"}/libexec32 '';3334 cargoExtraArgs = "--locked -p ${crateName}";3536 buildInputs = [37 rustPlatform.bindgenHook38 pam39 ];40 }