Files
nixpkgs/pkgs/by-name/cu/cutecosmic/package.nix
Peder Bergebakken Sundt 48bad6fefb treewide: use pname and version in fetchCargoVendor cargoDeps
I grepped for `fetchCargoVendor` and `inherit (finalAttrs) src;`, and wrote this patch by hand.
I tested this with `nix-build --check` on the following attributes, derived from `.meta.position`s that match any of the touched files:

* `amberol.cargoDeps.vendorStaging`
* `atuin-desktop.cargoDeps.vendorStaging`
* `chance.cargoDeps.vendorStaging`
* `clapgrep.cargoDeps.vendorStaging`
* `cutecosmic.cargoDeps.vendorStaging`
* `delineate.cargoDeps.vendorStaging`
* `drawpile.cargoDeps.vendorStaging`
* `drawpile-server-headless.cargoDeps.vendorStaging`
* `field-monitor.cargoDeps.vendorStaging`
* `fractal.cargoDeps.vendorStaging`
* `geopard.cargoDeps.vendorStaging`
* `git-cinnabar.cargoDeps.vendorStaging`
* `gnome-robots.cargoDeps.vendorStaging`
* `insulator2.cargoDeps.vendorStaging`
* `kana.cargoDeps.vendorStaging`
* `key-rack.cargoDeps.vendorStaging`
* `kime.cargoDeps.vendorStaging`
* `krunkit.cargoDeps.vendorStaging`
* `krunvm.cargoDeps.vendorStaging`
* `ladybird.cargoDeps.vendorStaging`
* `libchewing.cargoDeps.vendorStaging`
* `loupe.cargoDeps.vendorStaging`
* `metronome.cargoDeps.vendorStaging`
* `pdns-recursor.cargoDeps.vendorStaging`
* `python314Packages.copykitten.cargoDeps.vendorStaging`
* `python314Packages.django-vcache.cargoDeps.vendorStaging`
* `python314Packages.pdoc-pyo3-sample-library.cargoDeps.vendorStaging`
* `python314Packages.pycambia.cargoDeps.vendorStaging`
* `python314Packages.python-kadmin-rs.cargoDeps.vendorStaging`
* `python314Packages.tlparse.cargoDeps.vendorStaging`
* `python313Packages.copykitten.cargoDeps.vendorStaging`
* `python313Packages.django-vcache.cargoDeps.vendorStaging`
* `python313Packages.pdoc-pyo3-sample-library.cargoDeps.vendorStaging`
* `python313Packages.pycambia.cargoDeps.vendorStaging`
* `python313Packages.python-kadmin-rs.cargoDeps.vendorStaging`
* `python313Packages.tlparse.cargoDeps.vendorStaging`
* `share-preview.cargoDeps.vendorStaging`
* `stratisd.cargoDeps.vendorStaging`
* `taskwarrior3.cargoDeps.vendorStaging`
* `tsukimi.cargoDeps.vendorStaging`
* `wildcard.cargoDeps.vendorStaging`
2026-08-12 15:08:47 +02:00

101 lines
2.4 KiB
Nix

{
lib,
stdenv,
cargo,
cmake,
common-updater-scripts,
fetchFromGitHub,
nix-update,
qt6,
ripgrep,
rustPlatform,
rustc,
writeShellScript,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cutecosmic";
version = "0.1-unstable-2026-07-11";
src = fetchFromGitHub {
owner = "IgKh";
repo = "cutecosmic";
rev = "3f518924fbccc1b62f4d9e8db6c9eda7490959c9";
hash = "sha256-bombgw+vxn8LQ60ZWMrIJuwejsyJd+2dNkAjQBzVj3w=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
sourceRoot = "${finalAttrs.src.name}/bindings";
hash = "sha256-+1z0VoxDeOYSmb7BoFSdrwrfo1mmwkxeuEGP+CGFc8Y=";
};
cargoRoot = "bindings";
nativeBuildInputs = [
cmake
qt6.wrapQtAppsHook
rustPlatform.cargoSetupHook
cargo
rustc
];
buildInputs = [
qt6.qtbase
qt6.qtdeclarative
];
cmakeFlags = [
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_CORROSION" "${finalAttrs.passthru.sources.corrosion}")
];
postPatch = ''
substituteInPlace platformtheme/CMakeLists.txt \
--replace-fail "\''${QT_INSTALL_PLUGINS}/platformthemes" \
"${qt6.qtbase.qtPluginPrefix}/platformthemes"
'';
passthru = {
sources = {
# rev from source/bindings/CMakeLists.txt
corrosion = fetchFromGitHub {
owner = "corrosion-rs";
repo = "corrosion";
rev = "v0.5.2";
hash = "sha256-sO2U0llrDOWYYjnfoRZE+/ofg3kb+ajFmqvaweRvT7c=";
};
};
updateScript = writeShellScript "update-cutecosmic" ''
set -euo pipefail
${lib.getExe nix-update} cutecosmic --version branch=HEAD
src=$(nix-build -A cutecosmic.src --no-out-link)
# Corrosion-rs dependency
tag=$(${lib.getExe ripgrep} --multiline --pcre2 --only-matching \
'FetchContent_Declare\(\s*Corrosion[^)]*GIT_TAG\s+(v[\d.]+)' \
--replace '$1' \
"$src/bindings/CMakeLists.txt")
${lib.getExe' common-updater-scripts "update-source-version"} \
cutecosmic.sources.corrosion \
"$tag" \
--source-key=out \
--version-key=rev \
--file=${lib.escapeShellArg (toString ./.) + "/package.nix"}
'';
};
meta = {
homepage = "https://github.com/IgKh/cutecosmic";
description = "Qt platform theme for COSMIC Desktop environment";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
amozeo
thefossguy
];
platforms = lib.platforms.linux;
};
})