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
add plotinus and module #34919
add plotinus and module #34919
Conversation
Another option is setting nixpkgs/nixos/modules/programs/dconf.nix Lines 31 to 40 in b1ba405
|
ce99614
to
2fcb8c5
Compare
Thanks for the suggestion @jtojnar - I've changed to to use something like that and update the |
nixos/modules/programs/plotinus.nix
Outdated
|
||
config = mkIf cfg.enable { | ||
environment.variables.GSETTINGS_SCHEMA_DIR = "${pkgs.plotinus}/share/gsettings-schemas/plotinus-0.2.0/glib-2.0/schemas"; | ||
environment.variables.GTK3_MODULES = "${pkgs.plotinus}/lib/libplotinus.so"; |
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 think this should be in array brackets, in order to be merged correctly.
nixos/modules/programs/plotinus.nix
Outdated
###### implementation | ||
|
||
config = mkIf cfg.enable { | ||
environment.variables.GSETTINGS_SCHEMA_DIR = "${pkgs.plotinus}/share/gsettings-schemas/plotinus-0.2.0/glib-2.0/schemas"; |
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.
And here, XDG_DATA_DIRS
is probably better since GSETTINGS_SCHEMA_DIR
cannot be used more than once.
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 sounds like a good idea. But I don't know how to use XDG_DATA_DIRS in this context as it gives me an error that it is specified by another module.
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.
Oh, got ya - using a list fixes it.
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.
environment.variables.XDG_DATA_DIRS = [ "${pkgs.plotinus}/share/gsettings-schemas/plotinus-0.2.0" ];
should work. What module is that?
nixos/tests/plotinus.nix
Outdated
$machine->waitForX; | ||
$machine->execute("xterm -e 'gnome-calculator' &"); | ||
$machine->waitForWindow(qr/Calculator/); | ||
# $machine->sleep(40); # wait until Firefox has finished loading the page |
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 not needed?
2fcb8c5
to
04ea181
Compare
Thanks for the review @jtojnar - I've amended and pushed again. |
@GrahamcOfBorg test plotinus |
Success on x86_64-linux (full log) Partial log (click to expand)
|
nixos/modules/programs/plotinus.nix
Outdated
###### implementation | ||
|
||
config = mkIf cfg.enable { | ||
|
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 space bugs me :)
nixos/modules/programs/plotinus.nix
Outdated
|
||
config = mkIf cfg.enable { | ||
|
||
environment.variables.XDG_DATA_DIRS = [ "${pkgs.plotinus}/share/gsettings-schemas/plotinus-0.2.0" ]; |
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.
You can use ${pkgs.plotinus.name}
instead of plotinus-0.2.0
to be more forward compatible.
nixos/tests/plotinus.nix
Outdated
import ./make-test.nix ({ pkgs, ... }: { | ||
name = "plotinus"; | ||
meta = with pkgs.stdenv.lib.maintainers; { | ||
maintainers = [ samdroid-apps ]; |
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 use pkgs.plotinus.meta.maintainers
?
nixos/modules/programs/plotinus.nix
Outdated
|
||
environment.variables.XDG_DATA_DIRS = [ "${pkgs.plotinus}/share/gsettings-schemas/plotinus-0.2.0" ]; | ||
environment.variables.GTK3_MODULES = [ "${pkgs.plotinus}/lib/libplotinus.so" ]; | ||
}; |
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 module itself is missing meta.maintainers
. https://nixos.org/nixpkgs/manual/#idm140737316978672
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 link doesn't seem to take me to any specific section. I assume you meant the "14.4. New modules" section?
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.
Right, apparently the manual anchors are not stable.
Failure on aarch64-linux (full log) Partial log (click to expand)
|
04ea181
to
4d62673
Compare
Thanks @jtojnar - I've updated to add the "meta", fix other comments, and add the required documentation. |
4d62673
to
16fa6f5
Compare
Great work, thanks. |
Motivation for this change
Plotinus add a menu search feature to all Gtk+3 applications. Packaging the app is quite simple. However, users of plotinus usually want to enable it for all applications; and add it to the environment in some way.
This PR is marked as WIP because I'm not sure if this is the best/correct way to add something to the environment.
Currently, the approach is to add the required variables (eg.
GTK3_MODULES
) to the environment when starting session via the display manager. This was chosen as it would not affect other packages (eg. conditionally compiling it into GTK3 would cause mass rebuilds).Looking for an opinion on if this is the correct way to do it.
Testing
vm.nix
:Then run:
nixos-rebuild build-vm -I nixpkgs=$HOME/nixpkgs -I nixos-config=vm.nix ./result/bin/run-nixos-vm
Inside the VM, open gnome-calculator. Press
Ctrl-Shift-P
to open the menu searcher.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
) -- N/A