initial mac nixos config

This commit is contained in:
mjallen18
2024-03-16 14:12:21 -05:00
parent 52aa4649a4
commit 039a697a55
27 changed files with 11010 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
{ rustPlatform
, stdenv
, rust
, fetchCrate
, pkg-config
, alsa-lib
}:
rustPlatform.buildRustPackage rec {
pname = "speakersafetyd";
# tracking: https://src.fedoraproject.org/rpms/rust-speakersafetyd
version = "0.1.9";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ alsa-lib ];
src = fetchCrate {
inherit pname version;
hash = "sha256-I1fL1U4vqKxPS1t6vujMTdi/JAAOCcPkvUqv6FqkId4=";
};
cargoHash = "sha256-Adwct+qFhUsOIao8XqNK2zcn13DBlQNA+X4aRFeIAXM=";
postPatch = ''
substituteInPlace speakersafetyd.service --replace "/usr" "$out"
substituteInPlace Makefile --replace "target/release" "target/${rust.lib.toRustTargetSpec stdenv.hostPlatform}/$cargoBuildType"
'';
installFlags = [
"DESTDIR=${placeholder "out"}"
"BINDIR=/bin"
"SHAREDIR=/share"
"TMPFILESDIR=/lib/tmpfiles.d"
];
dontCargoInstall = true;
}