anchor.diff:  { stdenv
   , fetchFromGitHub
  -, fetchpatch
   , substituteAll
  +, desktop-file-utils
  +, pkg-config
   , writeScript
   , pantheon
   , gnome-keyring
  
positive.code:     substituteInPlace $out/share/xsessions/pantheon.desktop \
        --replace "gnome-session --session=pantheon" "$out/libexec/pantheon" \
        --replace "wingpanel" "${wingpanel}/bin/wingpanel"
  
      for f in $out/etc/xdg/autostart/*; do mv "$f" "''${f%.desktop}-pantheon.desktop"; done
  
      for autostart in $(grep -rl "OnlyShowIn=GNOME;" $out/etc/xdg/autostart)
      do
        echo "Patching OnlyShowIn to Pantheon in: $autostart"
        sed -i "s,OnlyShowIn=GNOME;,OnlyShowIn=Pantheon;," $autostart
      done
    '';
  
    passthru = {
      updateScript = pantheon.updateScript {
        attrPath = "pantheon.${pname}";
      };
      providedSessions = [ "pantheon" ];
    };
  
    meta = with stdenv.lib; {
  
negative.code: in
  
  stdenv.mkDerivation rec {
    pname = "elementary-session-settings-unstable";
    version = "2020-06-11";
  
    repoName = "session-settings";
  
    src = fetchFromGitHub {
      owner = "elementary";
      repo = repoName;
      rev = "130c9ae221913032ed18bcf6d21e3dcdba3c4209";
      sha256 = "0bzg9vbq0ssnxgcb2vxpx6x9zv8ngkm9r3ki5q83m9al9919n0pr";
    };
  
    nativeBuildInputs = [
      desktop-file-utils
      meson
      ninja
      pkg-config
    ];
  
    buildInputs = [
      pantheon.elementary-settings-daemon
      gnome-keyring
      onboard
      orca
    ];
  
    mesonFlags = [
      "-Dmimeapps-list=false"
      "-Dfallback-session=GNOME"
      "-Ddetect-program-prefixes=true"
      "--sysconfdir=${placeholder "out"}/etc"
    ];
  
    postInstall = ''
      mkdir -p $out/share/applications
      cp -av ${./pantheon-mimeapps.list} $out/share/applications/pantheon-mimeapps.list
  
      cp "${dockitemAutostart}" $out/etc/xdg/autostart/default-elementary-dockitems.desktop
  
  