Unverified Commit de7a7ec3 authored by Pratham Patel's avatar Pratham Patel
Browse files

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.
parent c06d2904
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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 = {