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
nixos/doc/gnome: Document how python nautilus extensions work #240780
base: master
Are you sure you want to change the base?
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nautilus-extension-not-working/12072/14 |
8b8f55a
to
9c966ff
Compare
Some of these extensions, also include `gsettings` schemas, and adding them to `systemPackages` won't make them visible in `dconf-editor` or when you run `gsettings set`. An example of such an extension is yet again `nautilus-open-any-terminal`. Hence for this example, you have to add it in two places: | ||
|
||
```nix | ||
environment.systemPackages = with pkgs; [ | ||
gnome.nautilus-python | ||
nautilus-open-any-terminal | ||
]; | ||
services.xserver.desktopManager.gnome.extraGSettingsOverridePackages = with pkgs; [ | ||
nautilus-open-any-terminal | ||
]; | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably go to a separate section, as it is not specific to GNOME extensions. Though we will hopefully remove the option soon in favour of dconf module so perhaps it is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably go to a separate section, as it is not specific to GNOME extensions.
Agree. I added that to the examples subsection.
Though we will hopefully remove the option soon in favour of dconf module so perhaps it is not needed.
Ideally :) But until then, let's document what is the current behavior...
@@ -116,6 +116,37 @@ Unfortunately, we lack a way for these to be managed in a completely declarative | |||
So you have to enable them manually with an Extensions application. | |||
It is possible to use a [GSettings override](#sec-gnome-gsettings-overrides) for this on `org.gnome.shell.enabled-extensions`, but that will only influence the default value. | |||
|
|||
## Nautilus Extensions {#sec-gnome-nautilus-extensions} | |||
|
|||
Nautilus extensions can add additional functionality to Nautilus, usually via the right-click menu. Some of these extensions are dynamically loaded from `$NAUTILUS_4_EXTENSIONS_DIR` environment variable, which is automatically set if [](#opt-services.gnome.core-utilities.enable) is true (enabled by default if gnome is enabled). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variable is an implementation detail so I am not sure we should expose it. Ideally, we would drop it in favour of Nautilus wrapper package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should have a Nautilus module in the meanwhile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variable is an implementation detail so I am not sure we should expose it.
I won't mind if it won't be exposed, but I think it's nice to have this mentioned as this way users can ls -l $NAUTILUS_4_EXTENSIONS_DIR
and see what extensions they have installed... Also, they can override that value with something else if they wish to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should have a Nautilus module in the meanwhile.
Again, until then...
]; | ||
``` | ||
|
||
In fact, any package that includes a python script at `/share/nautilus-python/extensions`, will provide a nautilus Python extension. Other examples include: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should also have a nautilus-python
module that adds this to pathsToLink
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That addition to pathsToLink
is already made if services.gnome.core-utilities
is enabled. Perhaps this behavior should be documented as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @jtojnar. Regarding many of your comments that prospect about improving the module - I really think they are good ideas, but in the meantime the current behavior is not documented so maybe we can postpone them to a later time? Perhaps after this PR, users will read the current state of things and will consider improving the situation via a nautilus
wrapper and a module, and dconf
module.
]; | ||
``` | ||
|
||
In fact, any package that includes a python script at `/share/nautilus-python/extensions`, will provide a nautilus Python extension. Other examples include: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That addition to pathsToLink
is already made if services.gnome.core-utilities
is enabled. Perhaps this behavior should be documented as well?
Some of these extensions, also include `gsettings` schemas, and adding them to `systemPackages` won't make them visible in `dconf-editor` or when you run `gsettings set`. An example of such an extension is yet again `nautilus-open-any-terminal`. Hence for this example, you have to add it in two places: | ||
|
||
```nix | ||
environment.systemPackages = with pkgs; [ | ||
gnome.nautilus-python | ||
nautilus-open-any-terminal | ||
]; | ||
services.xserver.desktopManager.gnome.extraGSettingsOverridePackages = with pkgs; [ | ||
nautilus-open-any-terminal | ||
]; | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably go to a separate section, as it is not specific to GNOME extensions.
Agree. I added that to the examples subsection.
Though we will hopefully remove the option soon in favour of dconf module so perhaps it is not needed.
Ideally :) But until then, let's document what is the current behavior...
@@ -116,6 +116,37 @@ Unfortunately, we lack a way for these to be managed in a completely declarative | |||
So you have to enable them manually with an Extensions application. | |||
It is possible to use a [GSettings override](#sec-gnome-gsettings-overrides) for this on `org.gnome.shell.enabled-extensions`, but that will only influence the default value. | |||
|
|||
## Nautilus Extensions {#sec-gnome-nautilus-extensions} | |||
|
|||
Nautilus extensions can add additional functionality to Nautilus, usually via the right-click menu. Some of these extensions are dynamically loaded from `$NAUTILUS_4_EXTENSIONS_DIR` environment variable, which is automatically set if [](#opt-services.gnome.core-utilities.enable) is true (enabled by default if gnome is enabled). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variable is an implementation detail so I am not sure we should expose it.
I won't mind if it won't be exposed, but I think it's nice to have this mentioned as this way users can ls -l $NAUTILUS_4_EXTENSIONS_DIR
and see what extensions they have installed... Also, they can override that value with something else if they wish to.
@@ -116,6 +116,37 @@ Unfortunately, we lack a way for these to be managed in a completely declarative | |||
So you have to enable them manually with an Extensions application. | |||
It is possible to use a [GSettings override](#sec-gnome-gsettings-overrides) for this on `org.gnome.shell.enabled-extensions`, but that will only influence the default value. | |||
|
|||
## Nautilus Extensions {#sec-gnome-nautilus-extensions} | |||
|
|||
Nautilus extensions can add additional functionality to Nautilus, usually via the right-click menu. Some of these extensions are dynamically loaded from `$NAUTILUS_4_EXTENSIONS_DIR` environment variable, which is automatically set if [](#opt-services.gnome.core-utilities.enable) is true (enabled by default if gnome is enabled). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should have a Nautilus module in the meanwhile.
Again, until then...
9c966ff
to
bd9f6e6
Compare
bd9f6e6
to
2ba46e2
Compare
Just fixed the phrasing of the commit title... |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
2ba46e2
to
25905f2
Compare
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)