From c14ed78ea34831e8fbc3614b9aa98c3319e6aca3 Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Thu, 10 Apr 2025 17:07:43 +0530 Subject: [PATCH] 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. --- pkgs/by-name/co/cosmic-osd/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/co/cosmic-osd/package.nix b/pkgs/by-name/co/cosmic-osd/package.nix index 31be64525d5e..bef80f5a04bb 100644 --- a/pkgs/by-name/co/cosmic-osd/package.nix +++ b/pkgs/by-name/co/cosmic-osd/package.nix @@ -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=";