From c10374349f74ec61c894b18aaec69e1301c8cb48 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Tue, 25 Feb 2025 19:25:55 -0300 Subject: [PATCH 1/5] cosmic-launcher: refactor --- pkgs/by-name/co/cosmic-launcher/package.nix | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/co/cosmic-launcher/package.nix b/pkgs/by-name/co/cosmic-launcher/package.nix index b3ded86538ac..34532464d590 100644 --- a/pkgs/by-name/co/cosmic-launcher/package.nix +++ b/pkgs/by-name/co/cosmic-launcher/package.nix @@ -8,9 +8,6 @@ makeBinaryWrapper, libxkbcommon, wayland, - appstream-glib, - desktop-file-utils, - intltool, }: rustPlatform.buildRustPackage rec { @@ -20,7 +17,7 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "pop-os"; repo = "cosmic-launcher"; - rev = "epoch-${version}"; + tag = "epoch-${version}"; hash = "sha256-0htDjdS8431orzNnetK0ubNvjO/5748YYqeESJKTUUs="; }; @@ -32,15 +29,14 @@ rustPlatform.buildRustPackage rec { pkg-config makeBinaryWrapper ]; + buildInputs = [ libxkbcommon wayland - appstream-glib - desktop-file-utils - intltool ]; dontUseJustBuild = true; + dontUseJustCheck = true; justFlags = [ "--set" @@ -60,14 +56,14 @@ rustPlatform.buildRustPackage rec { --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ wayland ]}" ''; - RUSTFLAGS = "--cfg tokio_unstable"; + env."CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_RUSTFLAGS" = "--cfg tokio_unstable"; - meta = with lib; { + meta = { homepage = "https://github.com/pop-os/cosmic-launcher"; description = "Launcher for the COSMIC Desktop Environment"; mainProgram = "cosmic-launcher"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ nyabinary ]; - platforms = platforms.linux; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ nyabinary ]; + platforms = lib.platforms.linux; }; } From c89ddf743b5820dcc962f82d7bd729e17dd1846f Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Tue, 25 Feb 2025 19:32:37 -0300 Subject: [PATCH 2/5] cosmic-launcher: use libcosmicAppHook --- pkgs/by-name/co/cosmic-launcher/package.nix | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/co/cosmic-launcher/package.nix b/pkgs/by-name/co/cosmic-launcher/package.nix index 34532464d590..ab319d7ba3f7 100644 --- a/pkgs/by-name/co/cosmic-launcher/package.nix +++ b/pkgs/by-name/co/cosmic-launcher/package.nix @@ -4,10 +4,7 @@ fetchFromGitHub, rustPlatform, just, - pkg-config, - makeBinaryWrapper, - libxkbcommon, - wayland, + libcosmicAppHook, }: rustPlatform.buildRustPackage rec { @@ -26,13 +23,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ just - pkg-config - makeBinaryWrapper - ]; - - buildInputs = [ - libxkbcommon - wayland + libcosmicAppHook ]; dontUseJustBuild = true; @@ -51,11 +42,6 @@ rustPlatform.buildRustPackage rec { substituteInPlace justfile --replace-fail '#!/usr/bin/env' "#!$(command -v env)" ''; - postInstall = '' - wrapProgram $out/bin/cosmic-launcher \ - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ wayland ]}" - ''; - env."CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_RUSTFLAGS" = "--cfg tokio_unstable"; meta = { From fa5b9d97497bf8975cb89fb262f1fbc89ecfac03 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Tue, 25 Feb 2025 19:39:35 -0300 Subject: [PATCH 3/5] cosmic-launcher: add updateScript --- pkgs/by-name/co/cosmic-launcher/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/co/cosmic-launcher/package.nix b/pkgs/by-name/co/cosmic-launcher/package.nix index ab319d7ba3f7..308933e7f164 100644 --- a/pkgs/by-name/co/cosmic-launcher/package.nix +++ b/pkgs/by-name/co/cosmic-launcher/package.nix @@ -5,6 +5,7 @@ rustPlatform, just, libcosmicAppHook, + nix-update-script, }: rustPlatform.buildRustPackage rec { @@ -44,6 +45,15 @@ rustPlatform.buildRustPackage rec { env."CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_RUSTFLAGS" = "--cfg tokio_unstable"; + passthru.updateScript = nix-update-script { + extraArgs = [ + "--version" + "unstable" + "--version-regex" + "epoch-(.*)" + ]; + }; + meta = { homepage = "https://github.com/pop-os/cosmic-launcher"; description = "Launcher for the COSMIC Desktop Environment"; From b426ec8500320cf2b59f96a70bdb6a632a67c2e2 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Tue, 25 Feb 2025 19:40:08 -0300 Subject: [PATCH 4/5] cosmic-launcher: add HeitorAugustoLN to maintainers --- pkgs/by-name/co/cosmic-launcher/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/co/cosmic-launcher/package.nix b/pkgs/by-name/co/cosmic-launcher/package.nix index 308933e7f164..35d2737f35f4 100644 --- a/pkgs/by-name/co/cosmic-launcher/package.nix +++ b/pkgs/by-name/co/cosmic-launcher/package.nix @@ -59,7 +59,10 @@ rustPlatform.buildRustPackage rec { description = "Launcher for the COSMIC Desktop Environment"; mainProgram = "cosmic-launcher"; license = lib.licenses.gpl3Only; - maintainers = with lib.maintainers; [ nyabinary ]; + maintainers = with lib.maintainers; [ + nyabinary + HeitorAugustoLN + ]; platforms = lib.platforms.linux; }; } From b762ea39195dd0bf037a9133edca3f2bcf30bf17 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Tue, 25 Feb 2025 19:41:47 -0300 Subject: [PATCH 5/5] cosmic-launcher: 1.0.0-alpha.5.1 -> 1.0.0-alpha.6 --- pkgs/by-name/co/cosmic-launcher/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/co/cosmic-launcher/package.nix b/pkgs/by-name/co/cosmic-launcher/package.nix index 35d2737f35f4..3db03c2d7c51 100644 --- a/pkgs/by-name/co/cosmic-launcher/package.nix +++ b/pkgs/by-name/co/cosmic-launcher/package.nix @@ -10,17 +10,17 @@ rustPlatform.buildRustPackage rec { pname = "cosmic-launcher"; - version = "1.0.0-alpha.5.1"; + version = "1.0.0-alpha.6"; src = fetchFromGitHub { owner = "pop-os"; repo = "cosmic-launcher"; tag = "epoch-${version}"; - hash = "sha256-0htDjdS8431orzNnetK0ubNvjO/5748YYqeESJKTUUs="; + hash = "sha256-BtYnL+qkM/aw+Air5yOKH098V+TQByM5mh1DX7v+v+s="; }; useFetchCargoVendor = true; - cargoHash = "sha256-WW1o9MFxNd41ODS5p4piLQtpy277E5a/oN2yYdJc8y4="; + cargoHash = "sha256-g7Qr3C8jQg65KehXAhftdXCpEukag0w12ClvZFkxfqs="; nativeBuildInputs = [ just