From de7a7ec3183b0644e75ea45c6456b93c30696836 Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Mon, 24 Mar 2025 14:03:19 +0530 Subject: [PATCH 1/3] cosmic-session: install the cosmic dconf profile file While the dconf profile was specified, the profile file itself was not copied to the derivation's `out` output. Ideally, the Justfile in the source repository should have handled this but it doesn't. So, instead of patching the Justfile, install the dconf profile file manually in the `postInstall` phase. Also exit with a non-zero exit code in case the Justfile is updated and the manual install is no longer necessary, so that the maintainer(s) can remove it from the `postInstall` phase. --- pkgs/by-name/co/cosmic-session/package.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/by-name/co/cosmic-session/package.nix b/pkgs/by-name/co/cosmic-session/package.nix index 92f8bc2b56e4..8abee7818643 100644 --- a/pkgs/by-name/co/cosmic-session/package.nix +++ b/pkgs/by-name/co/cosmic-session/package.nix @@ -49,6 +49,18 @@ rustPlatform.buildRustPackage (finalAttrs: { env.XDP_COSMIC = "${xdg-desktop-portal-cosmic}/libexec/xdg-desktop-portal-cosmic"; + postInstall = '' + dconf_profile_dst=$out/etc/dconf/profile/cosmic + if [ ! -f $dconf_profile_dst ]; then + install -Dm0644 data/dconf/profile/cosmic $dconf_profile_dst + else + # future proofing + echo 'The Justfile is now correctly installing the dconf profile.' + echo 'Please remove the dconf profile from the `postInstall` phase.' + exit 1 + fi + ''; + passthru.providedSessions = [ "cosmic" ]; meta = { From 618af9ab90feb63f6d0670ff0b3f56d75c8d372b Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Sun, 23 Mar 2025 10:39:47 -0300 Subject: [PATCH 2/3] cosmic-session: override `cargo-target-dir` with just flag --- pkgs/by-name/co/cosmic-session/package.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/co/cosmic-session/package.nix b/pkgs/by-name/co/cosmic-session/package.nix index 8abee7818643..bd5245e367cf 100644 --- a/pkgs/by-name/co/cosmic-session/package.nix +++ b/pkgs/by-name/co/cosmic-session/package.nix @@ -24,8 +24,6 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-iYObxjWJUKgZKGTkqtYgQK4758k0EYZGhIAM/oLxxso="; postPatch = '' - substituteInPlace Justfile \ - --replace-fail '{{cargo-target-dir}}/release/cosmic-session' 'target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-session' 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" @@ -45,6 +43,9 @@ rustPlatform.buildRustPackage (finalAttrs: { "--set" "cosmic_dconf_profile" "cosmic" + "--set" + "cargo-target-dir" + "target/${stdenv.hostPlatform.rust.cargoShortTarget}" ]; env.XDP_COSMIC = "${xdg-desktop-portal-cosmic}/libexec/xdg-desktop-portal-cosmic"; From 2bb6f798c888d1057aaa7e0cdb927765f3e84666 Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Mon, 24 Mar 2025 21:23:15 +0530 Subject: [PATCH 3/3] cosmic-session: add maintainer: HeitorAugustoLN --- pkgs/by-name/co/cosmic-session/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/co/cosmic-session/package.nix b/pkgs/by-name/co/cosmic-session/package.nix index bd5245e367cf..3f3bf681c7b1 100644 --- a/pkgs/by-name/co/cosmic-session/package.nix +++ b/pkgs/by-name/co/cosmic-session/package.nix @@ -73,6 +73,7 @@ rustPlatform.buildRustPackage (finalAttrs: { a-kenji nyabinary thefossguy + HeitorAugustoLN ]; platforms = lib.platforms.linux; };