{
lib,
fetchFromGitHub,
stdenv,
rustPlatform,
libcosmicAppHook,
just,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "cosmic-applibrary";
version = "1.0.0-alpha.6";
src = fetchFromGitHub {
owner = "pop-os";
repo = "cosmic-applibrary";
tag = "epoch-${version}";
hash = "sha256-hJOM5dZdLq6uYfhfspZzpbHgUOK/FWuIXuFPoisS8DU=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-95jTSn0yYj2PNVtfumfD1rPf1yLXHUi60FBqENK8CSw=";
nativeBuildInputs = [
just
libcosmicAppHook
];
dontUseJustBuild = true;
dontUseJustCheck = true;
justFlags = [
"--set"
"prefix"
(placeholder "out")
"bin-src"
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-app-library"
postPatch = ''
substituteInPlace justfile --replace '#!/usr/bin/env' "#!$(command -v env)"
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"unstable"
"--version-regex"
"epoch-(.*)"
meta = {
homepage = "https://github.com/pop-os/cosmic-applibrary";
description = "Application Template for the COSMIC Desktop Environment";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
nyabinary
HeitorAugustoLN
platforms = lib.platforms.linux;
mainProgram = "cosmic-app-library";
}