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

[WIP] nixos: add environment.gnome3.enableExtensions #46433

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bjornfor
Copy link
Contributor

@bjornfor bjornfor commented Sep 9, 2018

Motivation for this change

I'd like to enable/disable GNOME3 extensions from configuration.nix. However, when testing this I learned that services.xserver.desktopManager.gnome3.extraGSettingsOverrides, which this is built upon, only provides default values for the system. Users are still able to change settings. And once they have made a change, any change to the system default will be ignored. This is marked WIP since I'd like for this setting to be truly declarative. The first 4 commits would be nice to merge anyway, so one can play with this locally at least.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@bjornfor bjornfor added 6.topic: nixos 6.topic: GNOME GNOME desktop environment and its underlying platform labels Sep 9, 2018
@hedning
Copy link
Contributor

hedning commented Sep 10, 2018

dconf settings are stored per user (under ~/.config/dconf), so it would be hard to enforce fully I think.

But something like running dconf reset /org/gnome/shell/enabled-extensions as the user on startup might work OK though?

@bjornfor
Copy link
Contributor Author

dconf settings are stored per user (under ~/.config/dconf), so it would be hard to enforce fully I think.

According to this, one should be able to create lock files that prevent users from doing modifications. In my last fixup commit you can see I try to use it, but it didn't work for me.

Your "dconf reset ..." command sounds good. What setting in NixOS is best for running commands at user login time? (I'd like something shell agnostic.)

@bjornfor
Copy link
Contributor Author

Well, the commit that tries to create dconf lock files does not do the "dconf update" step. I did that manually.

@jtojnar
Copy link
Contributor

jtojnar commented Apr 5, 2019

See also #54150

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/recommended-way-to-add-gnome-extensions/5589/3

This option takes a list of packages / GNOME extensions that will be
(declaratively) enabled. The default value is null, meaning the
extensions are managed imperatively (backwards compatible).
Try to add add a lock file, to prevent users from modifying / overriding
the system (default) settings. However, it doesn't work.
@bbigras
Copy link
Contributor

bbigras commented Jul 16, 2020

Any progress on this?

@bjornfor
Copy link
Contributor Author

Not from my side.

@bbigras
Copy link
Contributor

bbigras commented Jul 16, 2020

What is needed to move this PR forward?

Does #54150 needs to be done first?

@bjornfor
Copy link
Contributor Author

Does #54150 needs to be done first?

Yep, that's what I'm thinking.

@stale
Copy link

stale bot commented Jul 21, 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 Jul 21, 2021
@Alizter
Copy link
Contributor

Alizter commented Mar 12, 2023

Any news on this?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 12, 2023
@bjornfor
Copy link
Contributor Author

Any news on this?

No, #54150 still needs to land first.

@linsui
Copy link
Contributor

linsui commented Sep 1, 2023

You can use the dconf module now.

@bjornfor
Copy link
Contributor Author

bjornfor commented Sep 1, 2023

You can use the dconf module now.

Right, there was another PR (not linked here) that fixed it! Cool!

I'll put this back on my TODO list.

@ulysses4ever
Copy link
Contributor

#54150 has ben merged. Anything else left before this one can land?

@bjornfor
Copy link
Contributor Author

#54150 has ben merged. Anything else left before this one can land?

This PR needs a rewrite. It's not high priority for me, as I'm using home-manager for my gnome extensions. Someone please make new PR on top of #54150.

@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 19, 2024
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.

None yet