cosmic-osd: substitue path for audio-volume-change.oga file

The path `/usr/share/sounds/freedesktop/stereo/audio-volume-change.oga`
is not accessible on NixOS because the directory `/usr` does not exist
on NixOS. But the `audio-volume-change.oga` file is available in the
`sound-theme-freedesktop` package. So substitute the full, FHS-compliant
path with the path of the `sound-theme-freedesktop` package from the Nix
store.
This commit is contained in:
Pratham Patel
2025-04-10 17:31:37 +05:30
parent fbcf6fdd65
commit c14ed78ea3
+6
View File
@@ -1,6 +1,7 @@
{
lib,
fetchFromGitHub,
sound-theme-freedesktop,
rustPlatform,
libcosmicAppHook,
pulseaudio,
@@ -20,6 +21,11 @@ rustPlatform.buildRustPackage (finalAttrs: {
hash = "sha256-ezOeRgqI/GOWFknUVZI7ZLEy1GYaBI+/An83HWKL6ho=";
};
postPatch = ''
substituteInPlace src/components/app.rs \
--replace-fail '/usr/share/sounds/freedesktop/stereo/audio-volume-change.oga' '${sound-theme-freedesktop}/share/sounds/freedesktop/stereo/audio-volume-change.oga'
'';
useFetchCargoVendor = true;
cargoHash = "sha256-vYehF2RjPrTZiuGcRUe4XX3ftRo7f+SIoKizD/kOtR8=";