Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gnome shell extension pano #189091

Closed
wants to merge 5 commits into from

Conversation

michojel
Copy link
Contributor

Description of changes

Resolves #188736

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 6.topic: GNOME GNOME desktop environment and its underlying platform label Aug 31, 2022
@piegamesde
Copy link
Member

piegamesde commented Aug 31, 2022

How much work would it be to get this to work as an automatically packaged extension (i.e. through our patch mechanism in extensionOverrides.nix? Generally this is preferable to manually packaged extensions, as it will be easier to update in the future.

@michojel
Copy link
Contributor Author

@piegamesde Not sure yet, I will give it a shot.

@michojel
Copy link
Contributor Author

In the meantime, for anybody interested, this overlay works i.a. on nixos-22.05: https://github.com/michojel/NixOS/blob/master/overlays/gnome-shell-extension-pano.nix

@SamLukeYes
Copy link
Member

SamLukeYes commented Sep 12, 2022

I'm now using pano with the following overlay:

final: prev: with prev;
{
  pano = callPackage "${
    builtins.fetchTarball "https://github.com/michojel/nixpkgs/archive/gnome-shell-extension-pano.tar.gz"
  }/pkgs/desktops/gnome/extensions/pano" {};
}

I added pano to environment.systemPackages, but the icon of Danger Zone in settings is missing. Any ideas to fix it?

screenshot

@michojel
Copy link
Contributor Author

I'm now using pano with the following overlay:

I added pano to environment.systemPackages, but the icon of Danger Zone in settings is missing. Any ideas to fix it?

Good catch!

It looks to be a part of Yaru theme:

/nix/store/j3xmq2cajfcwm5885rxi105la33cf78y-yaru-22.04.4/share/icons/Yaru/scalable/emblems/app-remove-symbolic.svg

That seems like an unwanted dependency that should be reported upstream.

@michojel
Copy link
Contributor Author

@jtojnar would you agree to set gnome-software as a runtime dependency and make problematic icon paths absolute?
Or shall we update description for the recommendation of compatible Gnome icon theme?

@jtojnar
Copy link
Contributor

jtojnar commented Sep 12, 2022

I would just ignore it since it is a minor cosmetic detail. Or wait for upstream to vendor the icon as per GNOME guidelines.

@michojel
Copy link
Contributor Author

Bumped to v9. Removed yarn2nix.
For now, ignoring the icon potentially missing in user's selected icon theme.

Signed-off-by: Michal Minář <mm@michojel.cz>
based on: oae/gnome-shell-pano@d727754

Signed-off-by: Michal Minář <mm@michojel.cz>
Signed-off-by: Michal Minář <mm@michojel.cz>
Signed-off-by: Michal Minář <mm@michojel.cz>
as it is a standard path

Signed-off-by: Michal Minář <mm@michojel.cz>
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/684

@SamLukeYes
Copy link
Member

gnomeExtensions.pano is now available in nixos-unstable but broken. Maybe we still need this PR.

let
dataDirPaths = lib.concatStringsSep ":" [
"${gnome.gnome-shell}/share/gnome-shell"
"${gnome.mutter}/lib/mutter-10"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now mutter-11. You can use gnome.mutter.libdir instead.

Copy link
Contributor

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please follow the contributing guide on how commit messages should be structured.

});
in
stdenv.mkDerivation rec {
inherit pname version;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use those here directly, when we have rec attrset?

];

buildInputs = [
atk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not see gtk3 and atk needed.

name = "${pname}-modules-${version}";
packageJSON = "${src}/package.json";
yarnLock = "${src}/yarn.lock";
yarnNix = ./yarn.nix;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear how to update this. Maybe add an passthru.updateScript. Did not test it but something like the following should work:

  passthru = {
    lockFileNix = runCommand
      "pano-yarn.nix"
      {
        nativeBuildInputs = [
          yarn2nix-moretea
        ];
      }
      ''
        unpackPhase
        cd "''${sourceRoot:-.}"
        yarn2nix > "$out"
      '';
    updateScript =
      let
        updateSource = gitUpdater { };
        updateLockFile = _experimental-update-script-combinators.copyAttrOutputToFile "gnomeExtensions.pano.lockFileNix" ./yarn.nix;
      in
      _experimental-update-script-combinators.sequence [
        updateSource
        updateLockFile
      ];
  };

@piousdeer
Copy link
Contributor

@jtojnar would a small patch in extensionOverrides.nix be preferred to packaging this extension separately? With the following overlay the extension works just fine for me.

final: prev: {
  gnomeExtensions = prev.gnomeExtensions // {
    pano = prev.gnomeExtensions.pano.overrideAttrs (oldAttrs: {
      patches = [
        (final.substituteAll {
          src = ./pano.patch;
          gda_path = "${final.libgda}/lib/girepository-1.0";
          gsound_path = "${final.gsound}/lib/girepository-1.0";
        })
      ];
    });
  };
}
diff --git a/extension.js b/extension.js
index 26561f2..01209e7 100644
--- a/extension.js
+++ b/extension.js
@@ -1,3 +1,5 @@
+imports.gi.GIRepository.Repository.prepend_search_path('@gda_path@')
+imports.gi.GIRepository.Repository.prepend_search_path('@gsound_path@')
 
 try {
 

@piegamesde
Copy link
Member

@piousdeer yet it would be preferred: #189091 (comment)

A PR with your patch would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Package request] Pano
6 participants