1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-18 15:14:49 -04:00
nixpkgs/pkgs/by-name/co/cosmic-bg/package.nix
2024-09-25 19:41:19 +02:00

65 lines
1.6 KiB
Nix

{ 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=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"atomicwrites-0.4.2" = "sha256-QZSuGPrJXh+svMeFWqAXoqZQxLq/WfIiamqvjJNVhxA=";
"clipboard_macos-0.1.0" = "sha256-cG5vnkiyDlQnbEfV2sPbmBYKv1hd3pjJrymfZb8ziKk=";
"cosmic-config-0.1.0" = "sha256-mdRRfXLyDBYQIPmbuXgXGoOKUlyw6CiSmOUBz1b3vJY=";
"smithay-clipboard-0.8.0" = "sha256-4InFXm0ahrqFrtNLeqIuE3yeOpxKZJZx+Bc0yQDtv34=";
};
};
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";
};
}