Skip to content

neolight: init at 1.4.0#434361

Closed
drafolin wants to merge 2 commits intoNixOS:masterfrom
drafolin:neolight/init
Closed

neolight: init at 1.4.0#434361
drafolin wants to merge 2 commits intoNixOS:masterfrom
drafolin:neolight/init

Conversation

@drafolin
Copy link
Copy Markdown
Contributor

@drafolin drafolin commented Aug 17, 2025

Packaged neolight for nixos, depending on xkeyboard_config

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@drafolin
Copy link
Copy Markdown
Contributor Author

there is MUCH LIKELY a better solution; but this one at the very least works :D

am open to any suggestion towards improvement

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 12.first-time contribution This PR is the author's first one; please be gentle! 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Aug 17, 2025
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but... what does this do? 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

@Sigmanificient Sigmanificient Aug 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question is about the ed command

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean what does it do to that file, does it creates it? Does it append to it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

@acid-bong acid-bong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moin and welcome to Nixpkgs. Here's a couple general notes to consider

@nilathedragon
Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 434361
Commit: 79fe800f3462d49543b0dd488a8d8245ee9aaea3


x86_64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 1 package built:
  • neolight

@nixpkgs-ci nixpkgs-ci bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Aug 17, 2025
@acid-bong
Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 434361

Logs: https://github.com/acid-bong/nixpkgs-review-gha/actions/runs/17022303559


x86_64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 1 package built:
  • neolight

aarch64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 1 package built:
  • neolight

@rnhmjoj
Copy link
Copy Markdown
Contributor

rnhmjoj commented Aug 19, 2025

Can you extend xkb.extraLayouts (i.e. xkeyboardconfig_custom) and use that, instead of implementing this ad-hoc for neolight?

@drafolin
Copy link
Copy Markdown
Contributor Author

Can you extend xkb.extraLayouts (i.e. xkeyboardconfig_custom) and use that, instead of implementing this ad-hoc for neolight?

probably; would require more time than i currently have available tho

@drafolin
Copy link
Copy Markdown
Contributor Author

removed the maintainer commit since it got merged with #435232

@nixpkgs-ci nixpkgs-ci bot removed 12.first-time contribution This PR is the author's first one; please be gentle! 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` labels Aug 20, 2025
Modification to the XKB_CONFIG_ROOT environment variable required for functionnality of the package
Copy link
Copy Markdown
Contributor

@rnhmjoj rnhmjoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@drafolin
Copy link
Copy Markdown
Contributor Author

Apparently it's not passing the xkb-validate test:
...

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)

@rnhmjoj
Copy link
Copy Markdown
Contributor

rnhmjoj commented Aug 28, 2025

Not sure what you tried running, I gave a look at the xkbvalidate cli but can't get to this output.

It's a system.check (a built-time test) that runs if you enable the X server, see nixos/modules/services/x11/xserver.nix.

Have you tried with "neolight:neolight" option? It's called like this in this version (to better match the upstream package)

Yes, I tested with both the layout and the option applied on top of another layout.

@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Sep 10, 2025
@drafolin drafolin closed this Feb 2, 2026
@drafolin drafolin deleted the neolight/init branch March 4, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants