Skip to content
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

nixos/zsa: init at unstable-2020-12-16 #91203

Merged
merged 1 commit into from Dec 27, 2020
Merged

Conversation

davidak
Copy link
Member

@davidak davidak commented Jun 21, 2020

Motivation for this change

be able to configure ZSA keyboards

Related: https://github.com/zsa/wally/issues/19

cc @spacekookie might want to test?

Things done
  • tested flashing keyboard
  • tested live training

--

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/250

@sir4ur0n
Copy link

Hi @davidak

Thank you for this PR!
As a new owner of the ZSA Moonlander I am looking for a way to flash using Wally and use the Chrome connector. It doesn't work by default and I somehow found this PR.

  1. How am I supposed to test this PR please? I tried:
  • clone Nixpkgs repo (and checkout the same commit my NixOS is currently on)
  • add your repo and cherry pick your commit 8a894fe9d0015f24841644a4fa97498ff9f8dd82
  • add hardware.keyboard.zsa.enable = true; to my configuration.nix
  • run export NIX_PATH=nixpkgs=/path/to/my/clone/nixpkgs
  • run sudo nixos-rebuild switch
    But I get this error:
error: The option `hardware.keyboard' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
    {
      zsa = {
        enable = true;
      };
    }
(use '--show-trace' to show detailed location information)
building Nix...
error: The option `hardware.keyboard' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
    {
      zsa = {
        enable = true;
      };
    }
(use '--show-trace' to show detailed location information)
building the system configuration...
error: The option `hardware.keyboard' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
    {
      zsa = {
        enable = true;
      };
    }
(use '--show-trace' to show detailed location information)

I have checked and the cherry-pick worked well (all files and modifications are there)m I guess I have done something else wrong but can't figure out what.

  1. Would you mind updating the zsa/moonlander Git commit+hash please (and probably also the option description for improved discoverability for future users)? The one currently targeted doesn't support Moonlander udev rules.

Thank you!

@sir4ur0n
Copy link

sir4ur0n commented Dec 17, 2020

Update: I have managed to test, the problem is that export NIX_PATH=nixpkgs=/path/to/my/clone/nixpkgs is not well taken into account during the nixos-rebuild step.
Anyway, by switching to su and repeating those steps, I managed to test this.

I updated the Git commit and SHA as such (to support Moonlander):

-    rev = "39ada98c490156afc8dd14f7efe2bf9cbf200361";
-    sha256 = "1nxral952sfdsjrfj8p22873zs89lwswlip4i9xv4a32r368h627";
+    rev = "e5dde3c700beab39fb941c6941e55535bf9b2af6";
+    sha256 = "0pkybi32r1hrmpa1mc8qlzhv7xy5n5rr5ah25lbr0cipp1bda417";

Note that while flashing works, I still get some errors (warnings?) during flashing (but they don't seem to disturb the flashing):

$ wally-cli moonlander_moonlander-default-layout_xbJpL_wy5xo.bin
⠏ Press the reset button of your keyboard.2020/12/17 11:06:39 handle_events: error: libusb: interrupted [code -10]
⠏ Press the reset button of your keyboard.2020/12/17 11:06:40 handle_events: error: libusb: interrupted [code -10]
 0 / 58784 [---------------------------------------------------------------------------------------------------------]   0.00%2020/12/17 11:06:40 handle_events: error: libusb: interrupted [code -10]
 58784 / 58784 [=================================================================================================] 100.00% 14s
Your keyboard was successfully flashed and rebooted. Enjoy the new firmware!

That being said, the USB Chrome connection now works on https://configure.ergodox-ez.com/train 😍 So thank you very much @davidak 🙇

Once it's updated to the latest udev rules version from Wally, would someone mind reviewing/merging please? 🙇

@davidak
Copy link
Member Author

davidak commented Dec 17, 2020

the problem is that export NIX_PATH=nixpkgs=/path/to/my/clone/nixpkgs is not well taken into account during the nixos-rebuild step

you have to use nixos-rebuild switch -I nixpkgs=/path/to/my/clone/nixpkgs

thanks for testing and updating! i will check it out later. then you can review it again and we might find someone to merge. i think the issue was that no one had hardware to review...

@sir4ur0n
Copy link

@davidak Hey, I know this is open source (so motivation-, free-time- and best-effort-based) but would you mind updating this PR so it can be reviewed/merged and made available on the unstable branch? 😅

Let me know if there's anything I can do to help!

add support for ZSA keyboards

Co-authored-by: Julien Debon <julien.debon@pm.me>
@davidak davidak changed the title nixos/zsa: init at unstable-2020-06-20 nixos/zsa: init at unstable-2020-12-16 Dec 26, 2020
@davidak
Copy link
Member Author

davidak commented Dec 26, 2020

I have accepted your changes, squashed the commits, rebased on maser and tested it.

Please test again and submit a review here, so we can get this merged.

Copy link

@sir4ur0n sir4ur0n left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants