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

glib: follow profile updates when searching apps #118100

Merged
merged 1 commit into from
Oct 27, 2021

Conversation

max-privatevoid
Copy link
Contributor

Motivation for this change

GNOME Shell monitors XDG_DATA_DIRS for changes using inotify for the
purpose of updating the list of applications displayed in the overview
as they are installed or removed. Because the relevant directories are
symlinks under NixOS and are swapped on change, Shell never notices it.
To remedy this, also monitor various profile directories to signal an
update whenever profiles are changed.

This uses a patch from Guix, slightly modified to also encompass user
environment profiles (/etc/profiles/per-user/$USER) in addition to the
system profile (/nix/var/nix/profiles/system) as well as regular user
profiles (/nix/var/nix/profiles/per-user/$USER/profile).

Fixes #12757

Known limitation: On installations to /etc/profiles/per-user, the list of applications gets updated, but Shell fails to find the icons for new applications. This is the case when installing them declaratively through home-manager's NixOS module. Other methods, such as ad-hoc via nix-env/nix profile install work fine.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@r-rmcgibbo
Copy link

r-rmcgibbo commented Mar 30, 2021

Result of nixpkgs-review pr 118100 at 5fa00518 run on aarch64-linux 1

830 packages marked as broken and skipped:
  • OVMF-CSM
  • adoptopenjdk-hotspot-bin-13
  • adoptopenjdk-hotspot-bin-14
  • adoptopenjdk-jre-hotspot-bin-13
  • adoptopenjdk-jre-hotspot-bin-14
  • agdaPackages.iowa-stdlib
  • aldor
  • alliance
  • ams-lv2
  • amule
  • ...
16218 packages skipped due to time constraints:
  • AusweisApp2
  • DisnixWebService
  • EBTKS
  • EmptyEpsilon
  • Fabric (python38Packages.Fabric)
  • MIDIVisualizer
  • MMA
  • OVMF
  • OVMF-secureBoot
  • R
  • ...
31 packages built successfully:
  • asciidoctor
  • atk (gnome2.atk ,gnome3.atk)
  • cairo (gnome2.cairo)
  • dejavu_fonts
  • desktop-file-utils
  • epoxy
  • fontconfig
  • fontforge (fontforge-fonttools ,python38Packages.fontforge)
  • gd
  • gdk-pixbuf
  • glib (gnome2.glib ,gnome3.glib)
  • libsoup (gnome2.libsoup)
  • pango (gnome2.pango)
  • gobject-introspection (gnome3.gobject-introspection)
  • vala (gnome3.vala ,vala_0_48)
  • gts
  • harfbuzz
  • json-glib
  • libnotify
  • libqrtr-glib
  • libva
  • libva-minimal
  • mesa
  • python38Packages.pycairo
  • python38Packages.pygobject3
  • shared-mime-info
  • spideroak
  • wayland
  • wayland-protocols
  • xlibsWrapper (xorg.xlibsWrapper)
  • xorg.libXft

Result of nixpkgs-review pr 118100 at 5fa00518 run on x86_64-linux 1

735 packages marked as broken and skipped:
  • adobe-reader
  • adoptopenjdk-hotspot-bin-13
  • adoptopenjdk-hotspot-bin-14
  • adoptopenjdk-jre-hotspot-bin-13
  • adoptopenjdk-jre-hotspot-bin-14
  • adoptopenjdk-jre-openj9-bin-13
  • adoptopenjdk-jre-openj9-bin-14
  • adoptopenjdk-openj9-bin-13
  • adoptopenjdk-openj9-bin-14
  • agdaPackages.iowa-stdlib
  • ...
18126 packages skipped due to time constraints:
  • AusweisApp2
  • DisnixWebService
  • EBTKS
  • EmptyEpsilon
  • Fabric (python38Packages.Fabric)
  • MIDIVisualizer
  • MMA
  • OSCAR
  • OVMF
  • OVMF-CSM
  • ...
34 packages built successfully:
  • asciidoctor
  • atk (gnome2.atk ,gnome3.atk)
  • cairo (gnome2.cairo)
  • dejavu_fonts
  • desktop-file-utils
  • epoxy
  • fontconfig
  • fontforge (fontforge-fonttools ,python38Packages.fontforge)
  • gd
  • gdk-pixbuf
  • glib (gnome2.glib ,gnome3.glib)
  • gnome2.libIDL
  • libsoup (gnome2.libsoup)
  • pango (gnome2.pango)
  • gobject-introspection (gnome3.gobject-introspection)
  • gsettings-desktop-schemas (gnome3.gsettings-desktop-schemas)
  • vala (gnome3.vala ,vala_0_48)
  • gnomeExtensions.dynamic-panel-transparency
  • gts
  • harfbuzz
  • json-glib
  • libGL
  • libqrtr-glib
  • libva
  • libva-minimal
  • mesa
  • perl532Packages.X11Protocol
  • python38Packages.pycairo
  • python38Packages.pygobject3
  • shared-mime-info
  • wayland
  • wayland-protocols
  • xlibsWrapper (xorg.xlibsWrapper)
  • xorg.libXft
8 suggestions:
  • warning: missing-patch-comment

    Please add a comment on the line above, explaining the purpose of this patch.
    Near pkgs/development/libraries/glib/default.nix:56:5:

       |
    56 |     ./darwin-compilation.patch
       |     ^
    
  • warning: build-tools-in-build-inputs

    gnum4 is a build tool so it likely goes to nativeBuildInputs, not buildInputs.

    Near pkgs/development/libraries/glib/default.nix:93:3:

       |
    93 |   buildInputs = [
       |   ^
    
  • warning: build-tools-in-build-inputs

    gtk-doc is a build tool so it likely goes to nativeBuildInputs, not buildInputs.

    Near pkgs/development/libraries/glib/default.nix:93:3:

       |
    93 |   buildInputs = [
       |   ^
    
  • warning: missing-patch-comment

    Please add a comment on the line above, explaining the purpose of this patch.
    Near pkgs/development/libraries/glib/default.nix:59:5:

       |
    59 |     ./gobject_init_on_demand.patch
       |     ^
    
  • warning: missing-patch-comment

    Please add a comment on the line above, explaining the purpose of this patch.
    Near pkgs/development/libraries/glib/default.nix:58:5:

       |
    58 |     ./quark_init_on_demand.patch
       |     ^
    
  • warning: unused-argument

    Unused argument: fetchpatch.
    Near pkgs/development/libraries/glib/default.nix:11:11:

       |
    11 | , darwin, fetchpatch
       |           ^
    
  • warning: missing-patch-comment

    Please add a comment on the line above, explaining the purpose of this patch.
    Near pkgs/development/libraries/glib/default.nix:62:5:

       |
    62 |     ./schema-override-variable.patch
       |     ^
    
  • warning: missing-patch-comment

    Please add a comment on the line above, explaining the purpose of this patch.
    Near pkgs/development/libraries/glib/default.nix:61:5:

       |
    61 |     ./glib-appinfo-watch.patch
       |     ^
    

@SuperSandro2000
Copy link
Member

/rebase staging

GNOME Shell monitors XDG_DATA_DIRS for changes using inotify for the
purpose of updating the list of applications displayed in the overview
as they are installed or removed. Because the relevant directories are
symlinks under NixOS and are swapped on change, Shell never notices it.
To remedy this, also monitor various profile directories to signal an
update whenever profiles are changed.

This uses a patch from Guix, slightly modified to also encompass user
environment profiles (/etc/profiles/per-user/$USER) in addition to the
system profile (/nix/var/nix/profiles/system) as well as regular user
profiles (/nix/var/nix/profiles/per-user/$USER/profile).
@github-actions github-actions bot changed the base branch from master to staging March 31, 2021 00:38
@github-actions github-actions bot force-pushed the fix/glib-appinfo-watch branch from 5fa0051 to 5b3f9e0 Compare March 31, 2021 00:38
@github-actions github-actions bot closed this Mar 31, 2021
@github-actions
Copy link
Contributor

Rebased, please reopen the pull request to restart CI

@stale
Copy link

stale bot commented Oct 1, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 1, 2021
@iam-cult
Copy link

Any updates on this? This is the only reason I do not use GNOME on NixOS, and would really like to see some action on this issue.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 26, 2021
@7c6f434c 7c6f434c merged commit ce6b36c into NixOS:staging Oct 27, 2021
@wmertens
Copy link
Contributor

wmertens commented Aug 3, 2022

Seems to me that the patch is a little limited? It doesn't work with home-manager, would it not be better to special-case all links to /nix instead of special-casing system and user profiles?

@wmertens
Copy link
Contributor

wmertens commented Aug 3, 2022

maybe the solution is to check here if the directory it wants to watch is a symlink to /nix, and if so, pass FALSE instead of TRUE?

https://github.com/frida/glib/blob/ceb3ada29104dc85dbb116e7dca32ba565aad368/gio/gdesktopappinfo.c#L1433

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/required-nix-gnome-tweaks-hacks/20711/3

@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
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.

Gnome Activities icons should appear on app install
8 participants