-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
qmk: init at 0.0.45 #118340
qmk: init at 0.0.45 #118340
Conversation
We are actually working on this in #109639. It is still draft as there is a blocking issue about compiling custom keyboards. |
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.
I'm not sure the ability to compile custom keyboards is a hard blocker for this PR, since it's relatively straightforward to change src
to your qmk fork in a NUR overlay [1], and easier to maintain if the base qmk
itself is in the nixpkgs tree for overriding.
Of course if you can think of a more simple/efficient/clear way to do this that's even better.
[1] Something like
qmk = super.qmk.overrideAttrs(_: { src = /home/bhipple/src/qmk_cli; });
or a deterministic fetchFromGitHub
on your qmk fork if you'd like something more stable.
Is this cli tool only for the clueboard? |
@dotlambda it doesn't work.
I do not have python installed, nor pip - so those modules should be added as dependencies. |
@legendofmiracles You are importing stuff from |
Firmwares are not meant to be packaged as if they were libraries. |
@AndersonTorres @legendofmiracles As stated above, I don't use this software. So if some dependency needs to be added, please go ahead and make a pull request. Don't forget to add yourself as a maintainer. |
@legendofmiracles @dotlambda it seems the QMK |
An updated shell.nix{ avr ? true, arm ? true, teensy ? true }:
let
pkgs = import <nixos-unstable> { };
hjson = with pkgs.python3Packages; buildPythonPackage rec {
pname = "hjson";
version = "3.0.1";
src = fetchPypi {
inherit pname version;
sha256 = "1yaimcgz8w0ps1wk28wk9g9zdidp79d14xqqj9rjkvxalvx2f5qx";
};
doCheck = false;
};
milc = with pkgs.python3Packages; buildPythonPackage rec {
pname = "milc";
version = "1.0.10";
src = fetchPypi {
inherit pname version;
sha256 = "1q1p7qrqk78mw67nhv04zgxaq8himmdxmy2vp4fmi7chwgcbpi32";
};
propagatedBuildInputs = [
appdirs
argcomplete
colorama
];
doCheck = false;
};
pythonEnv = pkgs.python3.withPackages (p: with p; [
# requirements.txt
appdirs
argcomplete
colorama
dotty-dict
hjson
jsonschema
milc
pygments
# requirements-dev.txt
nose2
flake8
pep8-naming
yapf
]);
in
with pkgs;
let
avrlibc = pkgsCross.avr.libcCross;
avr_incflags = [
"-isystem ${avrlibc}/avr/include"
"-B${avrlibc}/avr/lib/avr5"
"-L${avrlibc}/avr/lib/avr5"
"-B${avrlibc}/avr/lib/avr35"
"-L${avrlibc}/avr/lib/avr35"
"-B${avrlibc}/avr/lib/avr51"
"-L${avrlibc}/avr/lib/avr51"
];
in
mkShell {
name = "qmk-firmware";
buildInputs = [ clang-tools dfu-programmer dfu-util diffutils git pythonEnv ]
++ lib.optional avr [
pkgsCross.avr.buildPackages.binutils
pkgsCross.avr.buildPackages.gcc8
avrlibc
avrdude
]
++ lib.optional arm [ gcc-arm-embedded ]
++ lib.optional teensy [ teensy-loader-cli ];
AVR_CFLAGS = lib.optional avr avr_incflags;
AVR_ASFLAGS = lib.optional avr avr_incflags;
shellHook = ''
# Prevent the avr-gcc wrapper from picking up host GCC flags
# like -iframework, which is problematic on Darwin
unset NIX_CFLAGS_COMPILE_FOR_TARGET
export PATH="<path to qmk_firmware>/bin:$PATH"
'';
} |
You don't need the extra |
@afontaine if hjson and milc were packaged for Nixpkgs, it would be useful? |
I was able to look into things a bit more. At some point, a kind soul refactored the However, it looks like that script has been deprecated and that we will need the Fortunately, all this poetry updating almost got the |
QMK is a different thing. The workflow of a QMK hacker (?) is
QMK CLI is a tool that implements this workflow. Packaging Maybe an exaggerated analogy can be useful. Think on As an aside, the state of Python packaging is confusing at least, but I would say Dantesque. |
I understand that. I am saying that there may be no point in packaging |
When I requested the package, I was still extremely new to nix in general. I didn't realize that they had a packaged shell.nix and my first instinct was to request the package. Currently, I'm also using the |
is that the one available under the |
But there are other distros packaging it, and they are not in a different situation. QMK is useless outside the repo for all these distros, because QMK is over specialized. On the other hand, the |
yeah that is a good point @AndersonTorres. OK, in that case, we should look at bumping it to |
Well, the qmk_cli github page says it can Interact with your qmk_firmware tree from any location (including forks). Therefore it is already documented. Anyway I will bump the version. |
@afontaine ping |
Motivation for this change
closes #118016
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)@legendofmiracles I have no way of testing whether this works and hence don't feel comfortable being the maintainer of this package. Would you like to do that?