Conversation
|
there is MUCH LIKELY a better solution; but this one at the very least works :D am open to any suggestion towards improvement |
pkgs/by-name/ne/neolight/package.nix
Outdated
There was a problem hiding this comment.
Sorry but... what does this do? 😅
There was a problem hiding this comment.
the two cp lines copy the symbols and types from neolight;
NeoLight adds two layers on top of your regular keyboard, therefore this is necessary, although a bit of a hack. Really here, I'm just adapting the install.sh script from mihi314/neolight.
There was a problem hiding this comment.
The question is about the ed command
There was a problem hiding this comment.
sorry! thought the three lines were selected.
the ed command is the one i saw was used in the implementation of services.xserver.xkb.extraLayouts. It allows to edit a file in-place.
As for the file itself, it's used to be displayed, for example, in gnome tweaks, as a checkbox you can simply tick to enable neolight.
There was a problem hiding this comment.
I mean what does it do to that file, does it creates it? Does it append to it?
There was a problem hiding this comment.
it appends to it, right after the first match of <layoutList>
/<layoutList>/ looks for the match
a starts the append operation
[...] is the content
. finishes the append operation
w writes to the file
057bd8e to
79fe800
Compare
acid-bong
left a comment
There was a problem hiding this comment.
Moin and welcome to Nixpkgs. Here's a couple general notes to consider
|
79fe800 to
6ad05f4
Compare
|
|
Can you extend |
probably; would require more time than i currently have available tho |
30cdd14 to
c712e0b
Compare
|
removed the maintainer commit since it got merged with #435232 |
Modification to the XKB_CONFIG_ROOT environment variable required for functionnality of the package
c712e0b to
f414de7
Compare
rnhmjoj
left a comment
There was a problem hiding this comment.
Apparently it's not passing the xkb-validate test:
xkb-validated>
xkb-validated> The value `neolight' for keyboard layout is invalid.
xkb-validated>
xkb-validated> Please check the definition in `services.xserver.xkb.layout'.
xkb-validated>
xkb-validated> Detailed XKB compiler errors:
xkb-validated>
xkb-validated> [XKB-338] Couldn't find file "symbols/neolight" in include paths
xkb-validated> [XKB-338] 1 include paths searched:
xkb-validated> [XKB-338] /nix/store/24j9amj85jw3mwb7551nx3b4bnxcl81z-xkeyboard-config-2.45/etc/X11/xkb
xkb-validated> [XKB-338] 3 include paths could not be added:
xkb-validated> [XKB-338] /homeless-shelter/.config/xkb
xkb-validated> [XKB-338] /homeless-shelter/.xkb
xkb-validated> [XKB-338] /etc/xkb
xkb-validated> [XKB-769] Abandoning symbols file "(unnamed map)"
xkb-validated> Failed to compile xkb_symbols
xkb-validated> [XKB-822] Failed to compile keymap
xkb-validated>
I tested with:
services.xserver.xkb.layout = "neolight";
services.xserver.xkb.neolight.enable = true;
and
services.xserver.xkb.layout = "us";
services.xserver.xkb.options = "neolight";
services.xserver.xkb.neolight.enable = true;
Neither is working.
The path /nix/store/24j9amj85jw3mwb7551nx3b4bnxcl81z-xkeyboard-config-2.45 seems to be the original xkeyboardconfig package, the custom package is not being installed correctly.
| { | ||
| options.services.xserver.xkb.neolight = { | ||
| package = lib.mkPackageOption pkgs "neolight" { }; | ||
| enable = lib.mkEnableOption "neolight xkb layout, extra keyboard layers for programming based on Neo"; |
There was a problem hiding this comment.
We really need to provide more information on what this actually does and how to use the layout, either here or in the NixOS manual.
Also, you should add a test case to nixosTests.keymap (see nixos/tests/keymap.nix). There is one already for neo and one for extraLayout that you can adapt.
| ${ed}/bin/ed -v rules/evdev.xml <<EOF | ||
| /<layoutList>/ | ||
| a | ||
| <!-- BEGIN neolight --> |
There was a problem hiding this comment.
I think you can remove these comments, in the upstream script they were used to splice out the layout in case you uninstall it, but in NixOS this is unnecessary.
|
|
||
| ${ed}/bin/ed -v rules/evdev <<EOF | ||
| a | ||
| // BEGIN NEOLIGHT |
Not sure what you tried running, I gave a look at the xkbvalidate cli but can't get to this output. Have you tried with "neolight:neolight" option? It's called like this in this version (to better match the upstream package) |
It's a
Yes, I tested with both the layout and the option applied on top of another layout. |
Packaged neolight for nixos, depending on xkeyboard_config
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.