depot/third_party/nixpkgs/pkgs/by-name/co/cosmic-bg/package.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

63 lines
1.5 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, just
, pkg-config
, makeBinaryWrapper
, libxkbcommon
, wayland
}:
rustPlatform.buildRustPackage rec {
pname = "cosmic-bg";
version = "1.0.0-alpha.1";
src = fetchFromGitHub {
owner = "pop-os";
repo = pname;
rev = "epoch-${version}";
hash = "sha256-imGSOPS/ay3EycyrrQcIePDXNEYRk7NTAV+EtUPtEdg=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"atomicwrites-0.4.2" = "sha256-QZSuGPrJXh+svMeFWqAXoqZQxLq/WfIiamqvjJNVhxA=";
"cosmic-config-0.1.0" = "sha256-5J9tjpEcZJrUtW7barwXTOTNXNr33TLwYjApKkwDSvc=";
"smithay-client-toolkit-0.18.0" = "sha256-2WbDKlSGiyVmi7blNBr2Aih9FfF2dq/bny57hoA4BrE=";
};
};
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; [ nyanbinary ];
platforms = platforms.linux;
mainProgram = "cosmic-bg";
};
}