{ lib , stdenv , fetchFromGitHub , rustPlatform , just , pkg-config , makeBinaryWrapper , libxkbcommon , wayland }: rustPlatform.buildRustPackage rec { pname = "cosmic-bg"; version = "1.0.0-alpha.2"; src = fetchFromGitHub { owner = "pop-os"; repo = pname; rev = "epoch-${version}"; hash = "sha256-lAFAZBo5FnXgJV3MrZhaYmBxqtH1E7+Huj53ho/hPik="; }; useFetchCargoVendor = true; cargoHash = "sha256-up3yNsKxTC9YrRuTPsGlCHTp9S/woDXPc5HcYcEY9Xc="; postPatch = '' substituteInPlace justfile --replace-fail '#!/usr/bin/env' "#!$(command -v env)" ''; nativeBuildInputs = [ just pkg-config makeBinaryWrapper ]; buildInputs = [ libxkbcommon wayland ]; dontUseJustBuild = true; justFlags = [ "--set" "prefix" (placeholder "out") "--set" "bin-src" "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-bg" ]; postInstall = '' wrapProgram $out/bin/cosmic-bg \ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [wayland]}" ''; meta = with lib; { homepage = "https://github.com/pop-os/cosmic-bg"; description = "Applies Background for the COSMIC Desktop Environment"; license = licenses.mpl20; maintainers = with maintainers; [ nyabinary ]; platforms = platforms.linux; mainProgram = "cosmic-bg"; }; }