nixos/plotinus: add module to enable plotinus

authored by

Sam Parkinson and committed by
Jan Tojnar
16fa6f59 8f316ff3

+90
+1
nixos/modules/module-list.nix
··· 92 92 ./programs/nano.nix 93 93 ./programs/npm.nix 94 94 ./programs/oblogout.nix 95 + ./programs/plotinus.nix 95 96 ./programs/qt5ct.nix 96 97 ./programs/rootston.nix 97 98 ./programs/screen.nix
+36
nixos/modules/programs/plotinus.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.programs.plotinus; 7 + in 8 + { 9 + meta = { 10 + maintainers = pkgs.plotinus.meta.maintainers; 11 + doc = ./plotinus.xml; 12 + }; 13 + 14 + ###### interface 15 + 16 + options = { 17 + programs.plotinus = { 18 + enable = mkOption { 19 + default = false; 20 + description = '' 21 + Whether to enable the Plotinus GTK+3 plugin. Plotinus provides a 22 + popup (triggered by Ctrl-Shift-P) to search the menus of a 23 + compatible application. 24 + ''; 25 + type = types.bool; 26 + }; 27 + }; 28 + }; 29 + 30 + ###### implementation 31 + 32 + config = mkIf cfg.enable { 33 + environment.variables.XDG_DATA_DIRS = [ "${pkgs.plotinus}/share/gsettings-schemas/${pkgs.plotinus.name}" ]; 34 + environment.variables.GTK3_MODULES = [ "${pkgs.plotinus}/lib/libplotinus.so" ]; 35 + }; 36 + }
+25
nixos/modules/programs/plotinus.xml
··· 1 + <chapter xmlns="http://docbook.org/ns/docbook" 2 + xmlns:xlink="http://www.w3.org/1999/xlink" 3 + xmlns:xi="http://www.w3.org/2001/XInclude" 4 + version="5.0" 5 + xml:id="module-program-plotinus"> 6 + 7 + <title>Plotinus</title> 8 + 9 + <para><emphasis>Source:</emphasis> <filename>modules/programs/plotinus.nix</filename></para> 10 + 11 + <para><emphasis>Upstream documentation:</emphasis> <link xlink:href="https://github.com/p-e-w/plotinus"/></para> 12 + 13 + <para>Plotinus is a searchable command palette in every modern GTK+ application.</para> 14 + 15 + <para>When in a GTK+3 application and Plotinus is enabled, you can press <literal>Ctrl+Shift+P</literal> to open the command palette. The command palette provides a searchable list of of all menu items in the application.</para> 16 + 17 + <para>To enable Plotinus, add the following to your <filename>configuration.nix</filename>: 18 + 19 + <programlisting> 20 + programs.plotinus.enable = true; 21 + </programlisting> 22 + 23 + </para> 24 + 25 + </chapter>
+1
nixos/release.nix
··· 277 277 tests.ipv6 = callTest tests/ipv6.nix {}; 278 278 tests.jenkins = callTest tests/jenkins.nix {}; 279 279 tests.plasma5 = callTest tests/plasma5.nix {}; 280 + tests.plotinus = callTest tests/plotinus.nix {}; 280 281 tests.keymap = callSubTests tests/keymap.nix {}; 281 282 tests.initrdNetwork = callTest tests/initrd-network.nix {}; 282 283 tests.kafka_0_9 = callTest tests/kafka_0_9.nix {};
+27
nixos/tests/plotinus.nix
··· 1 + import ./make-test.nix ({ pkgs, ... }: { 2 + name = "plotinus"; 3 + meta = { 4 + maintainers = pkgs.plotinus.meta.maintainers; 5 + }; 6 + 7 + machine = 8 + { config, pkgs, ... }: 9 + 10 + { imports = [ ./common/x11.nix ]; 11 + programs.plotinus.enable = true; 12 + environment.systemPackages = [ pkgs.gnome3.gnome-calculator pkgs.xdotool ]; 13 + }; 14 + 15 + testScript = 16 + '' 17 + $machine->waitForX; 18 + $machine->execute("xterm -e 'gnome-calculator' &"); 19 + $machine->waitForWindow(qr/Calculator/); 20 + $machine->execute("xdotool key ctrl+shift+p"); 21 + $machine->sleep(1); # wait for the popup 22 + $machine->execute("xdotool key p r e f e r e n c e s Return"); 23 + $machine->waitForWindow(qr/Preferences/); 24 + $machine->screenshot("screen"); 25 + ''; 26 + 27 + })