-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
neolight: init at 1.4.0 #434361
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
neolight: init at 1.4.0 #434361
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| config, | ||
| pkgs, | ||
| lib, | ||
| ... | ||
| }: | ||
|
|
||
| let | ||
| cfg = config.services.xserver.xkb.neolight; | ||
| in | ||
| { | ||
| options.services.xserver.xkb.neolight = { | ||
| package = lib.mkPackageOption pkgs "neolight" { }; | ||
| enable = lib.mkEnableOption "neolight xkb layout, extra keyboard layers for programming based on Neo"; | ||
| }; | ||
|
|
||
| config = lib.mkIf cfg.enable { | ||
| environment.systemPackages = [ cfg.package ]; | ||
| environment.sessionVariables.XKB_CONFIG_ROOT = lib.mkForce "${cfg.package}/share/X11/xkb"; | ||
drafolin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| assertions = [ | ||
| { | ||
| assertion = config.services.xserver.xkb.extraLayouts == { }; | ||
| message = "Neolight conflicts with xkb.extraLayouts"; | ||
| } | ||
| ]; | ||
| }; | ||
drafolin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| meta.maintainers = with lib.maintainers; [ drafolin ]; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| { | ||
| xkeyboard_config, | ||
| ed, | ||
| fetchFromGitHub, | ||
| lib, | ||
| }: | ||
| xkeyboard_config.overrideAttrs (old: { | ||
| neolightSrc = fetchFromGitHub { | ||
| owner = "mihi314"; | ||
| repo = "neolight"; | ||
| tag = "v1.4.0"; | ||
| hash = "sha256-m1beegjPPiyQpmiqp5NvCCjBvpebH79A0R7PNjc0Xd8="; | ||
| }; | ||
|
|
||
| postInstall = '' | ||
| cd $out/share/X11/xkb | ||
| cp $neolightSrc/linux/neolight_symbols symbols/neolight | ||
| cp $neolightSrc/linux/neolight_types types/neolight | ||
|
|
||
| ${ed}/bin/ed -v rules/evdev.xml <<EOF | ||
|
||
| /<layoutList>/ | ||
| a | ||
| <!-- BEGIN neolight --> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| <layout> | ||
| <configItem> | ||
| <name>neolight</name> | ||
| <shortDescription>de</shortDescription> | ||
| <description>German (Neolight)</description> | ||
| <countryList> | ||
| <iso3166Id>DE</iso3166Id> | ||
| </countryList> | ||
| <languageList> | ||
| <iso639Id>deu</iso639Id> | ||
| </languageList> | ||
| </configItem> | ||
| <variantList> | ||
| <variant> | ||
| <configItem> | ||
| <name>de_escape_keys</name> | ||
| <description>German (Neolight + escape keys)</description> | ||
| </configItem> | ||
| </variant> | ||
| </variantList> | ||
| </layout> | ||
| <!-- END neolight --> | ||
| . | ||
| /<optionList>/ | ||
| a | ||
| <!-- BEGIN neolight --> | ||
| <group allowMultipleSelection="false"> | ||
| <configItem> | ||
| <name>neolight</name> | ||
| <description>Neolight</description> | ||
| </configItem> | ||
| <option> | ||
| <configItem> | ||
| <name>neolight</name> | ||
| <description>Add the neolight layers to the first layout</description> | ||
| </configItem> | ||
| </option> | ||
| <option> | ||
| <configItem> | ||
| <name>neolight:escape_keys</name> | ||
| <description>Add the neolight layers and additional escape keys to the first layout</description> | ||
| </configItem> | ||
| </option> | ||
| </group> | ||
| <!-- END neolight --> | ||
| . | ||
| w | ||
| EOF | ||
|
|
||
| ${ed}/bin/ed -v types/complete <<EOF | ||
| /};/ | ||
| i | ||
| include "neolight" | ||
| . | ||
| w | ||
| EOF | ||
|
|
||
| ${ed}/bin/ed -v rules/evdev <<EOF | ||
| a | ||
| // BEGIN NEOLIGHT | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| ! option = symbols | ||
| neolight = +neolight(layers) | ||
| neolight:escape_keys = +neolight(layers)+neolight(escape_keys) | ||
| neolight:jp = +neolight(jp) | ||
| // END NEOLIGHT | ||
| . | ||
| w | ||
| EOF | ||
| ''; | ||
|
|
||
| meta = { | ||
| maintainers = with lib.maintainers; [ drafolin ]; | ||
| homepage = "https://github.com/mihi314/neolight"; | ||
| description = "Neolight is a fork of the XKB layout for programming based on Neo"; | ||
| license = lib.licenses.gpl3Plus; | ||
| }; | ||
| }) | ||
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.
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.