From 8bed1ba09d4a7156828676f926500313608be944 Mon Sep 17 00:00:00 2001 From: Kajus Naujokaitis Date: Mon, 29 Jun 2026 10:53:13 +0300 Subject: [PATCH 1/4] cosmic: sort package attributes into consistent order Refactored cosmic packages to follow a consistent attribute sorting order Signed-off-by: Kajus Naujokaitis --- pkgs/by-name/co/cosmic-comp/package.nix | 7 ++--- pkgs/by-name/co/cosmic-edit/package.nix | 7 ++--- pkgs/by-name/co/cosmic-ext-tweaks/package.nix | 1 + pkgs/by-name/co/cosmic-greeter/package.nix | 17 +++++------ pkgs/by-name/co/cosmic-icons/package.nix | 10 +++---- pkgs/by-name/co/cosmic-idle/package.nix | 8 ++--- .../co/cosmic-initial-setup/package.nix | 29 +++++++++---------- pkgs/by-name/co/cosmic-launcher/package.nix | 4 +-- pkgs/by-name/co/cosmic-osd/package.nix | 4 +-- pkgs/by-name/co/cosmic-player/package.nix | 9 +++--- pkgs/by-name/co/cosmic-protocols/package.nix | 3 +- pkgs/by-name/co/cosmic-reader/package.nix | 4 +-- pkgs/by-name/co/cosmic-session/package.nix | 24 +++++++-------- pkgs/by-name/co/cosmic-wallpapers/package.nix | 4 +-- .../co/cosmic-workspaces-epoch/package.nix | 5 ++-- 15 files changed, 67 insertions(+), 69 deletions(-) diff --git a/pkgs/by-name/co/cosmic-comp/package.nix b/pkgs/by-name/co/cosmic-comp/package.nix index 69552fdea6ad..f0d6a1b92d15 100644 --- a/pkgs/by-name/co/cosmic-comp/package.nix +++ b/pkgs/by-name/co/cosmic-comp/package.nix @@ -32,8 +32,10 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-ki+unf58rXBCpj5PCpBcg/6FWo16+MdPQWae+w1YkJ8="; - separateDebugInfo = true; + # Only default feature is systemd + buildNoDefaultFeatures = !useSystemd; + separateDebugInfo = true; __structuredAttrs = true; nativeBuildInputs = [ @@ -51,9 +53,6 @@ rustPlatform.buildRustPackage (finalAttrs: { ] ++ lib.optional useSystemd systemd; - # Only default feature is systemd - buildNoDefaultFeatures = !useSystemd; - makeFlags = [ "prefix=${placeholder "out"}" "CARGO_TARGET_DIR=target/${stdenv.hostPlatform.rust.cargoShortTarget}" diff --git a/pkgs/by-name/co/cosmic-edit/package.nix b/pkgs/by-name/co/cosmic-edit/package.nix index c6148a0cf930..c8db34877a10 100644 --- a/pkgs/by-name/co/cosmic-edit/package.nix +++ b/pkgs/by-name/co/cosmic-edit/package.nix @@ -26,14 +26,13 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "sha256-5DsnhaiJgmTakn+q9o2Q7IeuakAC/j0Ck3F3pfFx/EA="; }; - cargoHash = "sha256-2E+98uWtahyQufoZTzdUtkwbuISsUHwlqOmMSpyi1O8="; - - separateDebugInfo = true; - postPatch = '' substituteInPlace justfile --replace-fail '#!/usr/bin/env' "#!$(command -v env)" ''; + cargoHash = "sha256-2E+98uWtahyQufoZTzdUtkwbuISsUHwlqOmMSpyi1O8="; + + separateDebugInfo = true; __structuredAttrs = true; nativeBuildInputs = [ diff --git a/pkgs/by-name/co/cosmic-ext-tweaks/package.nix b/pkgs/by-name/co/cosmic-ext-tweaks/package.nix index 53df717d345e..f7662eaaa80a 100644 --- a/pkgs/by-name/co/cosmic-ext-tweaks/package.nix +++ b/pkgs/by-name/co/cosmic-ext-tweaks/package.nix @@ -26,6 +26,7 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-mC19GLLHrjqYXl052HoNFscz9zzQWVBBm0OxzXoUd8U="; separateDebugInfo = true; + __structuredAttrs = true; nativeBuildInputs = [ libcosmicAppHook diff --git a/pkgs/by-name/co/cosmic-greeter/package.nix b/pkgs/by-name/co/cosmic-greeter/package.nix index c9f04a86339b..c64dd85dfb4f 100644 --- a/pkgs/by-name/co/cosmic-greeter/package.nix +++ b/pkgs/by-name/co/cosmic-greeter/package.nix @@ -29,16 +29,20 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "sha256-oxXCAvBISkZu76VpvQ9AliFRJ8r5Ay7mjWf4sEwV0Xs="; }; + postPatch = '' + substituteInPlace src/greeter.rs --replace-fail '/usr/bin/env' '${lib.getExe' coreutils "env"}' + substituteInPlace src/greeter.rs --replace-fail '/usr/bin/orca' '${lib.getExe orca}' + ''; + cargoHash = "sha256-mfY2hsMxBooRjmTB2jgUIKyKHBpGfZ9Qslwv+2aEQyg="; - separateDebugInfo = true; - - env.VERGEN_GIT_SHA = finalAttrs.src.tag; - cargoBuildFlags = [ "--all" ]; + separateDebugInfo = true; __structuredAttrs = true; + env.VERGEN_GIT_SHA = finalAttrs.src.tag; + nativeBuildInputs = [ rustPlatform.bindgenHook cmake @@ -66,11 +70,6 @@ rustPlatform.buildRustPackage (finalAttrs: { "target/${stdenv.hostPlatform.rust.cargoShortTarget}" ]; - postPatch = '' - substituteInPlace src/greeter.rs --replace-fail '/usr/bin/env' '${lib.getExe' coreutils "env"}' - substituteInPlace src/greeter.rs --replace-fail '/usr/bin/orca' '${lib.getExe orca}' - ''; - preFixup = '' libcosmicAppWrapperArgs+=( --prefix PATH : ${lib.makeBinPath [ cosmic-randr ]} diff --git a/pkgs/by-name/co/cosmic-icons/package.nix b/pkgs/by-name/co/cosmic-icons/package.nix index 6e680b83e8fa..f7ef23983644 100644 --- a/pkgs/by-name/co/cosmic-icons/package.nix +++ b/pkgs/by-name/co/cosmic-icons/package.nix @@ -24,17 +24,17 @@ stdenvNoCC.mkDerivation (finalAttrs: { nativeBuildInputs = [ just ]; + propagatedBuildInputs = [ + pop-icon-theme + hicolor-icon-theme + ]; + justFlags = [ "--set" "prefix" (placeholder "out") ]; - propagatedBuildInputs = [ - pop-icon-theme - hicolor-icon-theme - ]; - dontDropIconThemeCache = true; passthru.updateScript = nix-update-script { diff --git a/pkgs/by-name/co/cosmic-idle/package.nix b/pkgs/by-name/co/cosmic-idle/package.nix index 05c0e99f8ff1..00ba10327ef2 100644 --- a/pkgs/by-name/co/cosmic-idle/package.nix +++ b/pkgs/by-name/co/cosmic-idle/package.nix @@ -26,6 +26,10 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "sha256-0tcrOfVT5b57ev3b5F2U78F2QPGFwp94bqFVNyKH0Yk="; }; + postPatch = '' + substituteInPlace src/main.rs --replace-fail '"/bin/sh"' '"${lib.getExe' bash "sh"}"' + ''; + cargoHash = "sha256-wAjFC6qAC3nllbnZf0KVaZTEztNYo6GTvwcp5FYmXLw="; separateDebugInfo = true; @@ -48,10 +52,6 @@ rustPlatform.buildRustPackage (finalAttrs: { "target/${stdenv.hostPlatform.rust.cargoShortTarget}" ]; - postPatch = '' - substituteInPlace src/main.rs --replace-fail '"/bin/sh"' '"${lib.getExe' bash "sh"}"' - ''; - passthru = { tests = { inherit (nixosTests) diff --git a/pkgs/by-name/co/cosmic-initial-setup/package.nix b/pkgs/by-name/co/cosmic-initial-setup/package.nix index cf7d5a6b55f1..6c627ec5248c 100644 --- a/pkgs/by-name/co/cosmic-initial-setup/package.nix +++ b/pkgs/by-name/co/cosmic-initial-setup/package.nix @@ -24,9 +24,15 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "sha256-UABqbmbwW2ZBOO7mq16/h0s55VCWRF2yyf/1TaubC88="; }; - cargoHash = "sha256-DESnl5NjakU4++Ep6CHxDZzHn+o0Gi0eREpXk5BN5iY="; + postPatch = '' + # Installs in $out/etc/xdg/autostart instead of /etc/xdg/autostart + substituteInPlace justfile \ + --replace-fail \ + "autostart-dst := rootdir / 'etc' / 'xdg' / 'autostart' / desktop-entry" \ + "autostart-dst := prefix / 'etc' / 'xdg' / 'autostart' / desktop-entry" + ''; - separateDebugInfo = true; + cargoHash = "sha256-DESnl5NjakU4++Ep6CHxDZzHn+o0Gi0eREpXk5BN5iY="; buildFeatures = [ "nixos" ]; @@ -38,8 +44,11 @@ rustPlatform.buildRustPackage (finalAttrs: { # https://github.com/rust-secure-code/cargo-auditable/issues/225 auditable = false; + separateDebugInfo = true; __structuredAttrs = true; + env.DISABLE_IF_EXISTS = "/iso/nix-store.squashfs"; + nativeBuildInputs = [ libcosmicAppHook just @@ -52,18 +61,6 @@ rustPlatform.buildRustPackage (finalAttrs: { udev ]; - postPatch = '' - # Installs in $out/etc/xdg/autostart instead of /etc/xdg/autostart - substituteInPlace justfile \ - --replace-fail \ - "autostart-dst := rootdir / 'etc' / 'xdg' / 'autostart' / desktop-entry" \ - "autostart-dst := prefix / 'etc' / 'xdg' / 'autostart' / desktop-entry" - ''; - - preFixup = '' - libcosmicAppWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ killall ]}) - ''; - dontUseJustBuild = true; dontUseJustCheck = true; @@ -76,7 +73,9 @@ rustPlatform.buildRustPackage (finalAttrs: { "target/${stdenv.hostPlatform.rust.cargoShortTarget}" ]; - env.DISABLE_IF_EXISTS = "/iso/nix-store.squashfs"; + preFixup = '' + libcosmicAppWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ killall ]}) + ''; passthru = { tests = { diff --git a/pkgs/by-name/co/cosmic-launcher/package.nix b/pkgs/by-name/co/cosmic-launcher/package.nix index 2f790b30098d..67cd03835e20 100644 --- a/pkgs/by-name/co/cosmic-launcher/package.nix +++ b/pkgs/by-name/co/cosmic-launcher/package.nix @@ -26,6 +26,8 @@ rustPlatform.buildRustPackage (finalAttrs: { separateDebugInfo = true; __structuredAttrs = true; + env."CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_RUSTFLAGS" = "--cfg tokio_unstable"; + nativeBuildInputs = [ just libcosmicAppHook @@ -43,8 +45,6 @@ rustPlatform.buildRustPackage (finalAttrs: { "target/${stdenv.hostPlatform.rust.cargoShortTarget}" ]; - env."CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_RUSTFLAGS" = "--cfg tokio_unstable"; - passthru = { tests = { inherit (nixosTests) diff --git a/pkgs/by-name/co/cosmic-osd/package.nix b/pkgs/by-name/co/cosmic-osd/package.nix index c3bdf6376f10..b77ec8ce3776 100644 --- a/pkgs/by-name/co/cosmic-osd/package.nix +++ b/pkgs/by-name/co/cosmic-osd/package.nix @@ -30,6 +30,8 @@ rustPlatform.buildRustPackage (finalAttrs: { separateDebugInfo = true; __structuredAttrs = true; + env.POLKIT_AGENT_HELPER_1 = "/run/wrappers/bin/polkit-agent-helper-1"; + nativeBuildInputs = [ just libcosmicAppHook @@ -55,8 +57,6 @@ rustPlatform.buildRustPackage (finalAttrs: { "target/${stdenv.hostPlatform.rust.cargoShortTarget}" ]; - env.POLKIT_AGENT_HELPER_1 = "/run/wrappers/bin/polkit-agent-helper-1"; - passthru = { tests = { inherit (nixosTests) diff --git a/pkgs/by-name/co/cosmic-player/package.nix b/pkgs/by-name/co/cosmic-player/package.nix index b12ec673f447..4e7ada2305b9 100644 --- a/pkgs/by-name/co/cosmic-player/package.nix +++ b/pkgs/by-name/co/cosmic-player/package.nix @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: Lily Foster +# Portions of this code are adapted from nixos-cosmic +# https://github.com/lilyinstarlight/nixos-cosmic { lib, stdenv, @@ -40,9 +44,6 @@ rustPlatform.buildRustPackage (finalAttrs: { rustPlatform.bindgenHook ]; - # Largely based on lilyinstarlight's work linked below - # https://github.com/lilyinstarlight/nixos-cosmic/blob/main/pkgs/cosmic-player/package.nix - buildInputs = [ alsa-lib ffmpeg @@ -67,7 +68,7 @@ rustPlatform.buildRustPackage (finalAttrs: { "target/${stdenv.hostPlatform.rust.cargoShortTarget}" ]; - postInstall = '' + preFixup = '' libcosmicAppWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0") ''; diff --git a/pkgs/by-name/co/cosmic-protocols/package.nix b/pkgs/by-name/co/cosmic-protocols/package.nix index 59601aa1f023..a8b83db04966 100644 --- a/pkgs/by-name/co/cosmic-protocols/package.nix +++ b/pkgs/by-name/co/cosmic-protocols/package.nix @@ -21,9 +21,10 @@ stdenv.mkDerivation { __structuredAttrs = true; strictDeps = true; - makeFlags = [ "PREFIX=${placeholder "out"}" ]; nativeBuildInputs = [ wayland-scanner ]; + makeFlags = [ "PREFIX=${placeholder "out"}" ]; + passthru = { tests = { inherit (nixosTests) diff --git a/pkgs/by-name/co/cosmic-reader/package.nix b/pkgs/by-name/co/cosmic-reader/package.nix index 3fd07573578c..e9aaa8d7d4cc 100644 --- a/pkgs/by-name/co/cosmic-reader/package.nix +++ b/pkgs/by-name/co/cosmic-reader/package.nix @@ -33,6 +33,8 @@ rustPlatform.buildRustPackage (finalAttrs: { separateDebugInfo = true; __structuredAttrs = true; + env.VERGEN_GIT_SHA = finalAttrs.src.rev; + nativeBuildInputs = [ just libcosmicAppHook @@ -64,8 +66,6 @@ rustPlatform.buildRustPackage (finalAttrs: { "target/${stdenv.hostPlatform.rust.cargoShortTarget}" ]; - env.VERGEN_GIT_SHA = finalAttrs.src.rev; - passthru.updateScript = nix-update-script { extraArgs = [ "--version" diff --git a/pkgs/by-name/co/cosmic-session/package.nix b/pkgs/by-name/co/cosmic-session/package.nix index cf4406a3cb21..f613444b3d6d 100644 --- a/pkgs/by-name/co/cosmic-session/package.nix +++ b/pkgs/by-name/co/cosmic-session/package.nix @@ -22,23 +22,25 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "sha256-FphY53MaOUUR2oQfZak3HbT+kvysUnw2AIc4L9O+TcU="; }; + postPatch = '' + substituteInPlace data/start-cosmic \ + --replace-fail '/usr/bin/cosmic-session' "$out/bin/cosmic-session" \ + --replace-fail '/usr/bin/dbus-run-session' "${lib.getBin dbus}/bin/dbus-run-session" + substituteInPlace data/cosmic.desktop \ + --replace-fail '/usr/bin/start-cosmic' "$out/bin/start-cosmic" + ''; + cargoHash = "sha256-5dLG40X+yxJo566guyHqOCLNp+uNSE+HONS8GIDm58A="; separateDebugInfo = true; - - postPatch = '' - substituteInPlace data/start-cosmic \ - --replace-fail '/usr/bin/cosmic-session' "${placeholder "out"}/bin/cosmic-session" \ - --replace-fail '/usr/bin/dbus-run-session' "${lib.getBin dbus}/bin/dbus-run-session" - substituteInPlace data/cosmic.desktop \ - --replace-fail '/usr/bin/start-cosmic' "${placeholder "out"}/bin/start-cosmic" - ''; - __structuredAttrs = true; - buildInputs = [ bash ]; + env.ORCA = "orca"; # get orca from $PATH + nativeBuildInputs = [ just ]; + buildInputs = [ bash ]; + dontUseJustBuild = true; justFlags = [ @@ -53,8 +55,6 @@ rustPlatform.buildRustPackage (finalAttrs: { "target/${stdenv.hostPlatform.rust.cargoShortTarget}" ]; - env.ORCA = "orca"; # get orca from $PATH - passthru = { providedSessions = [ "cosmic" ]; tests = { diff --git a/pkgs/by-name/co/cosmic-wallpapers/package.nix b/pkgs/by-name/co/cosmic-wallpapers/package.nix index a0ddd6e66db8..18ce48be87ef 100644 --- a/pkgs/by-name/co/cosmic-wallpapers/package.nix +++ b/pkgs/by-name/co/cosmic-wallpapers/package.nix @@ -19,11 +19,11 @@ stdenvNoCC.mkDerivation (finalAttrs: { hash = "sha256-m2cYppfitpBDKK8CC9i/lUrC9rfSYTuqUSZSyIKKGyg="; }; - makeFlags = [ "prefix=${placeholder "out"}" ]; - __structuredAttrs = true; strictDeps = true; + makeFlags = [ "prefix=${placeholder "out"}" ]; + passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex" diff --git a/pkgs/by-name/co/cosmic-workspaces-epoch/package.nix b/pkgs/by-name/co/cosmic-workspaces-epoch/package.nix index 92fa4090d020..27e938258398 100644 --- a/pkgs/by-name/co/cosmic-workspaces-epoch/package.nix +++ b/pkgs/by-name/co/cosmic-workspaces-epoch/package.nix @@ -27,7 +27,6 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-Z5dC3W8QoDBZWBjHwRj9MC8EScDjQwUiUcOPTRDToDA="; separateDebugInfo = true; - __structuredAttrs = true; nativeBuildInputs = [ @@ -41,13 +40,13 @@ rustPlatform.buildRustPackage (finalAttrs: { udev ]; - dontCargoInstall = true; - makeFlags = [ "prefix=${placeholder "out"}" "CARGO_TARGET_DIR=target/${stdenv.hostPlatform.rust.cargoShortTarget}" ]; + dontCargoInstall = true; + passthru = { tests = { inherit (nixosTests) From fb85b928b3e3de400947dd079e3e39e8d1823d4b Mon Sep 17 00:00:00 2001 From: Kajus Naujokaitis Date: Mon, 29 Jun 2026 11:04:18 +0300 Subject: [PATCH 2/4] cosmic: add missing VERGEN_GIT_SHA where possible Signed-off-by: Kajus Naujokaitis --- pkgs/by-name/co/cosmic-edit/package.nix | 2 ++ pkgs/by-name/co/cosmic-ext-tweaks/package.nix | 2 ++ pkgs/by-name/co/cosmic-files/package.nix | 2 ++ pkgs/by-name/co/cosmic-initial-setup/package.nix | 5 ++++- pkgs/by-name/co/cosmic-player/package.nix | 2 ++ pkgs/by-name/co/cosmic-store/package.nix | 2 ++ pkgs/by-name/co/cosmic-term/package.nix | 2 ++ 7 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/co/cosmic-edit/package.nix b/pkgs/by-name/co/cosmic-edit/package.nix index c8db34877a10..a96aabb57320 100644 --- a/pkgs/by-name/co/cosmic-edit/package.nix +++ b/pkgs/by-name/co/cosmic-edit/package.nix @@ -35,6 +35,8 @@ rustPlatform.buildRustPackage (finalAttrs: { separateDebugInfo = true; __structuredAttrs = true; + env.VERGEN_GIT_SHA = finalAttrs.src.tag; + nativeBuildInputs = [ just pkg-config diff --git a/pkgs/by-name/co/cosmic-ext-tweaks/package.nix b/pkgs/by-name/co/cosmic-ext-tweaks/package.nix index f7662eaaa80a..053aabe84074 100644 --- a/pkgs/by-name/co/cosmic-ext-tweaks/package.nix +++ b/pkgs/by-name/co/cosmic-ext-tweaks/package.nix @@ -28,6 +28,8 @@ rustPlatform.buildRustPackage (finalAttrs: { separateDebugInfo = true; __structuredAttrs = true; + env.VERGEN_GIT_SHA = finalAttrs.src.tag; + nativeBuildInputs = [ libcosmicAppHook just diff --git a/pkgs/by-name/co/cosmic-files/package.nix b/pkgs/by-name/co/cosmic-files/package.nix index cc0d584fd744..ce202aec8e60 100644 --- a/pkgs/by-name/co/cosmic-files/package.nix +++ b/pkgs/by-name/co/cosmic-files/package.nix @@ -27,6 +27,8 @@ rustPlatform.buildRustPackage (finalAttrs: { separateDebugInfo = true; __structuredAttrs = true; + env.VERGEN_GIT_SHA = finalAttrs.src.tag; + nativeBuildInputs = [ just libcosmicAppHook diff --git a/pkgs/by-name/co/cosmic-initial-setup/package.nix b/pkgs/by-name/co/cosmic-initial-setup/package.nix index 6c627ec5248c..e862e2929846 100644 --- a/pkgs/by-name/co/cosmic-initial-setup/package.nix +++ b/pkgs/by-name/co/cosmic-initial-setup/package.nix @@ -47,7 +47,10 @@ rustPlatform.buildRustPackage (finalAttrs: { separateDebugInfo = true; __structuredAttrs = true; - env.DISABLE_IF_EXISTS = "/iso/nix-store.squashfs"; + env = { + VERGEN_GIT_SHA = finalAttrs.src.tag; + DISABLE_IF_EXISTS = "/iso/nix-store.squashfs"; + }; nativeBuildInputs = [ libcosmicAppHook diff --git a/pkgs/by-name/co/cosmic-player/package.nix b/pkgs/by-name/co/cosmic-player/package.nix index 4e7ada2305b9..3f65b0933ac9 100644 --- a/pkgs/by-name/co/cosmic-player/package.nix +++ b/pkgs/by-name/co/cosmic-player/package.nix @@ -37,6 +37,8 @@ rustPlatform.buildRustPackage (finalAttrs: { separateDebugInfo = true; __structuredAttrs = true; + env.VERGEN_GIT_SHA = finalAttrs.src.tag; + nativeBuildInputs = [ just pkg-config diff --git a/pkgs/by-name/co/cosmic-store/package.nix b/pkgs/by-name/co/cosmic-store/package.nix index d29231e0e70d..b18e93b8d886 100644 --- a/pkgs/by-name/co/cosmic-store/package.nix +++ b/pkgs/by-name/co/cosmic-store/package.nix @@ -30,6 +30,8 @@ rustPlatform.buildRustPackage (finalAttrs: { separateDebugInfo = true; __structuredAttrs = true; + env.VERGEN_GIT_SHA = finalAttrs.src.tag; + nativeBuildInputs = [ just pkg-config diff --git a/pkgs/by-name/co/cosmic-term/package.nix b/pkgs/by-name/co/cosmic-term/package.nix index b99fcc991196..7fe8ca7f71fc 100644 --- a/pkgs/by-name/co/cosmic-term/package.nix +++ b/pkgs/by-name/co/cosmic-term/package.nix @@ -30,6 +30,8 @@ rustPlatform.buildRustPackage (finalAttrs: { separateDebugInfo = true; __structuredAttrs = true; + env.VERGEN_GIT_SHA = finalAttrs.src.tag; + nativeBuildInputs = [ just pkg-config From bdc1db11ddda2189c6245c44b56c0ef7a3a3e1a5 Mon Sep 17 00:00:00 2001 From: Kajus Naujokaitis Date: Wed, 1 Jul 2026 10:18:13 +0300 Subject: [PATCH 3/4] cosmic-app-library: fix naming to cosmic-app-library Signed-off-by: Kajus Naujokaitis --- nixos/modules/services/desktop-managers/cosmic.nix | 2 +- .../co/{cosmic-applibrary => cosmic-app-library}/package.nix | 2 +- pkgs/top-level/aliases.nix | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) rename pkgs/by-name/co/{cosmic-applibrary => cosmic-app-library}/package.nix (97%) diff --git a/nixos/modules/services/desktop-managers/cosmic.nix b/nixos/modules/services/desktop-managers/cosmic.nix index 14fdda18c235..61e01c090d7a 100644 --- a/nixos/modules/services/desktop-managers/cosmic.nix +++ b/nixos/modules/services/desktop-managers/cosmic.nix @@ -20,7 +20,7 @@ let with pkgs; [ cosmic-applets - cosmic-applibrary + cosmic-app-library cosmic-bg cosmic-comp cosmic-files diff --git a/pkgs/by-name/co/cosmic-applibrary/package.nix b/pkgs/by-name/co/cosmic-app-library/package.nix similarity index 97% rename from pkgs/by-name/co/cosmic-applibrary/package.nix rename to pkgs/by-name/co/cosmic-app-library/package.nix index b11295c763e4..73647cada606 100644 --- a/pkgs/by-name/co/cosmic-applibrary/package.nix +++ b/pkgs/by-name/co/cosmic-app-library/package.nix @@ -10,7 +10,7 @@ }: rustPlatform.buildRustPackage (finalAttrs: { - pname = "cosmic-applibrary"; + pname = "cosmic-app-library"; version = "1.1.0"; # nixpkgs-update: no auto update diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 05a043d8e174..e25946ed237c 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -576,6 +576,7 @@ mapAliases { cordless = throw "'cordless' has been removed due to being archived upstream. Consider using 'discordo' instead."; # Added 2025-06-07 corepack_latest = throw "'corepack_latest' has been removed, use 'corepack.override { nodejs-slim = pkgs.nodejs-slim_latest; }' instead"; # Added 2025-10-25 coreth = throw "'coreth' has been moved to 'avalanchego' by upstream"; # Added 2026-01-15 + cosmic-applibrary = warnAlias "'cosmic-applibrary' has been renamed to 'cosmic-app-library'" cosmic-app-library; # Added 2026-07-01 cosmic-tasks = throw "'cosmic-tasks' has been renamed to/replaced by 'tasks'"; # Converted to throw 2025-10-27 cotton = throw "'cotton' has been removed since it is vulnerable to CVE-2025-62518 and upstream is unmaintained"; # Added 2025-10-26 cpp-ipfs-api = throw "'cpp-ipfs-api' has been renamed to/replaced by 'cpp-ipfs-http-client'"; # Converted to throw 2025-10-27 From 7492a9f55e8600d691d35b3c91aed9a545a32b97 Mon Sep 17 00:00:00 2001 From: Kajus Naujokaitis Date: Mon, 29 Jun 2026 11:06:34 +0300 Subject: [PATCH 4/4] libcosmicAppHook: fix wrapping skipped when separateDebugInfo = true With separateDebugInfo, fixupOutputHooks runs the hook for the debug output first, which has no bin/libexec, then the old boolean guard causes the real output to be skipped entirely. Switch to a per-prefix guard so each output is processed independently, while still preventing duplicate runs for the same prefix. Also adds debug logging throughout the hook to make future diagnosis easier. Signed-off-by: Kajus Naujokaitis --- .../li/libcosmicAppHook/libcosmic-app-hook.sh | 58 +++++++++++++------ 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/li/libcosmicAppHook/libcosmic-app-hook.sh b/pkgs/by-name/li/libcosmicAppHook/libcosmic-app-hook.sh index e6a523191956..2263dd3db2ca 100644 --- a/pkgs/by-name/li/libcosmicAppHook/libcosmic-app-hook.sh +++ b/pkgs/by-name/li/libcosmicAppHook/libcosmic-app-hook.sh @@ -5,24 +5,25 @@ # shellcheck shell=bash libcosmicAppWrapperArgs=() +libcosmicAppWrapHookRanFor=() libcosmicAppVergenHook() { - if [ -z "${VERGEN_GIT_COMMIT_DATE-}" ]; then - # shellcheck disable=SC2155 - export VERGEN_GIT_COMMIT_DATE="$(date --utc --date=@"$SOURCE_DATE_EPOCH" '+%Y-%m-%d')" - fi + if [ -z "${VERGEN_GIT_COMMIT_DATE-}" ]; then + # shellcheck disable=SC2155 + export VERGEN_GIT_COMMIT_DATE="$(date --utc --date=@"$SOURCE_DATE_EPOCH" '+%Y-%m-%d')" + fi } libcosmicAppLinkerArgsHook() { - # Force linking to certain libraries like libEGL, which are always dlopen()ed - local flags="CARGO_TARGET_@cargoLinkerVar@_RUSTFLAGS" + # Force linking to certain libraries like libEGL, which are always dlopen()ed + local flags="CARGO_TARGET_@cargoLinkerVar@_RUSTFLAGS" - export "$flags"="${!flags-} -C link-arg=-Wl,--push-state,--no-as-needed" - # shellcheck disable=SC2043 - for lib in @cargoLinkLibs@; do - export "$flags"="${!flags} -C link-arg=-l${lib}" - done - export "$flags"="${!flags} -C link-arg=-Wl,--pop-state" + export "$flags"="${!flags-} -C link-arg=-Wl,--push-state,--no-as-needed" + # shellcheck disable=SC2043 + for lib in @cargoLinkLibs@; do + export "$flags"="${!flags} -C link-arg=-l${lib}" + done + export "$flags"="${!flags} -C link-arg=-Wl,--pop-state" } preConfigurePhases+=" libcosmicAppVergenHook libcosmicAppLinkerArgsHook" @@ -51,9 +52,18 @@ wrapLibcosmicApp() { # Note: $libcosmicAppWrapperArgs still gets defined even if ${dontWrapLibcosmicApp-} is set libcosmicAppWrapHook() { - # guard against running multiple times (e.g. due to propagation) - [ -z "$libcosmicAppWrapHookHasRun" ] || return 0 - libcosmicAppWrapHookHasRun=1 + # guard against running multiple times for the same prefix (e.g. due to propagation) + for _ranFor in "${libcosmicAppWrapHookRanFor[@]}"; do + if [[ "$_ranFor" == "$prefix" ]]; then + echo "[libcosmicAppWrapHook] already ran for prefix='${prefix}', returning early" + return 0 + fi + done + libcosmicAppWrapHookRanFor+=("$prefix") + + echo "[libcosmicAppWrapHook] prefix='${prefix}'" + echo "[libcosmicAppWrapHook] dontWrapLibcosmicApp='${dontWrapLibcosmicApp:-}'" + echo "[libcosmicAppWrapHook] libcosmicAppWrapperArgs=(${libcosmicAppWrapperArgs[*]})" if [[ -z "${dontWrapLibcosmicApp:-}" ]]; then targetDirsThatExist=() @@ -61,35 +71,47 @@ libcosmicAppWrapHook() { # wrap binaries targetDirs=("${prefix}/bin" "${prefix}/libexec") + echo "[libcosmicAppWrapHook] checking targetDirs: ${targetDirs[*]}" for targetDir in "${targetDirs[@]}"; do + echo "[libcosmicAppWrapHook] checking targetDir='${targetDir}' exists=$([ -d "${targetDir}" ] && echo yes || echo no)" if [[ -d "${targetDir}" ]]; then targetDirsThatExist+=("${targetDir}") targetDirsRealPath+=("$(realpath "${targetDir}")/") + echo "[libcosmicAppWrapHook] finding executables in '${targetDir}'" find "${targetDir}" -type f -executable -print0 | while IFS= read -r -d '' file; do - echo "Wrapping program '${file}'" + echo "[libcosmicAppWrapHook] wrapping program '${file}'" wrapLibcosmicApp "${file}" done fi done + echo "[libcosmicAppWrapHook] targetDirsThatExist=(${targetDirsThatExist[*]})" + echo "[libcosmicAppWrapHook] targetDirsRealPath=(${targetDirsRealPath[*]})" + # wrap links to binaries that point outside targetDirs # Note: links to binaries within targetDirs do not need # to be wrapped as the binaries have already been wrapped if [[ ${#targetDirsThatExist[@]} -ne 0 ]]; then + echo "[libcosmicAppWrapHook] finding symlinks in targetDirs" find "${targetDirsThatExist[@]}" -type l -xtype f -executable -print0 | while IFS= read -r -d '' linkPath; do linkPathReal=$(realpath "${linkPath}") + echo "[libcosmicAppWrapHook] checking link '${linkPath}' -> '${linkPathReal}'" for targetPath in "${targetDirsRealPath[@]}"; do if [[ "$linkPathReal" == "$targetPath"* ]]; then - echo "Not wrapping link: '$linkPath' (already wrapped)" + echo "[libcosmicAppWrapHook] not wrapping link: '$linkPath' (already wrapped)" continue 2 fi done - echo "Wrapping link: '$linkPath'" + echo "[libcosmicAppWrapHook] wrapping link: '$linkPath'" wrapLibcosmicApp "${linkPath}" done + else + echo "[libcosmicAppWrapHook] no targetDirs exist, skipping symlink wrapping" fi + else + echo "[libcosmicAppWrapHook] dontWrapLibcosmicApp is set, skipping all wrapping" fi }