1
0
Fork 0

[nix] Use niv and poetry2nix to more easily manage dependencies (#11181)

* [nix] Update nixpkgs to avoid issues with Big Sur

The older nixpkgs snapshot did not contain nix changes to the
compiler/linker hooks that are necessary for compatibility with MacOS
Big Sur. The fix is simply to update to a newer snapshot.

* [nix] Add a poetry manifest and use poetry to build the Python env

* [nix] Use niv to manage upstream sources like nixpkgs

* [nix] Update to newer nixpkgs snapshot

* [nix] Bump python package versions
This commit is contained in:
Steve Purcell 2021-04-04 03:05:46 +12:00 committed by GitHub
parent a3cd1290be
commit d91938c19d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 611 additions and 24 deletions

View file

@ -1,29 +1,16 @@
{ avr ? true, arm ? true, teensy ? true }:
let
nixpkgs = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/1f77a4c8c74bbe896053994836790aa9bf6dc5ba.tar.gz";
sha256 = "1j62nmzz3w33dplzf1xz1pg1pfkxii7lwdqmsxmc71cs9cm3s7n1";
# We specify sources via Niv: use "niv update nixpkgs" to update nixpkgs, for example.
sources = import ./nix/sources.nix {};
pkgs = import sources.nixpkgs {};
# Builds the python env based on nix/pyproject.toml and
# nix/poetry.lock Use the "poetry update --lock", "poetry add
# --lock" etc. in the nix folder to adjust the contents of those
# files if the requirements*.txt files change
pythonEnv = pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./nix;
};
pkgs = import nixpkgs { };
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;
@ -43,7 +30,7 @@ in
mkShell {
name = "qmk-firmware";
buildInputs = [ clang-tools dfu-programmer dfu-util diffutils git pythonEnv ]
buildInputs = [ clang-tools dfu-programmer dfu-util diffutils git pythonEnv poetry niv ]
++ lib.optional avr [
pkgsCross.avr.buildPackages.binutils
pkgsCross.avr.buildPackages.gcc8