diff --git a/.envrc b/.envrc deleted file mode 100644 index 051d09d292a8..000000000000 --- a/.envrc +++ /dev/null @@ -1 +0,0 @@ -eval "$(lorri direnv)" diff --git a/.gitignore b/.gitignore index 5fdf770d31cb..8ea9e0edf818 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,6 @@ compile_commands.json # VIA(L) json files that don't belong in QMK repo via*.json + +# direnv +.direnv/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000000..2cd7295a3d1d --- /dev/null +++ b/flake.lock @@ -0,0 +1,130 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1616670887, + "narHash": "sha256-wn+l9qJfR5sj5Gq4DheJHAcBDfOs9K2p9seW2f35xzs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c0e881852006b132236cbf0301bd1939bb50867e", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c0e881852006b132236cbf0301bd1939bb50867e", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1681532870, + "narHash": "sha256-Jv5XE9n855/faDhBC+j7aE6Q6UgmrkLy9NgkxoX9pYo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4ab1021a1b9bbb4ef76042c5d4fc9379f200f689", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "poetry2nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1661088701, + "narHash": "sha256-4rVT5a0CTNSxXGLXu3MEVW5K+pr7Yn2AvMt0cMVdfEQ=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "11c0df8e348c0f169cd73a2e3d63f65c92baf666", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "11c0df8e348c0f169cd73a2e3d63f65c92baf666", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "poetry2nix": "poetry2nix" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000000..afd44ed37257 --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "qmk dev flake"; + + inputs.nixpkgs.url = "github:nixos/nixpkgs/c0e881852006b132236cbf0301bd1939bb50867e"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.poetry2nix.url = "github:nix-community/poetry2nix/11c0df8e348c0f169cd73a2e3d63f65c92baf666"; + + outputs = inputs @ { + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = import nixpkgs { + inherit system; + overlays = [ + (final: prev: { + python3 = prev.python3.override { + packageOverrides = self: super: { + tomlkit = super.tomlkit.overridePythonAttrs (old: rec { + version = "0.11.4"; + src = super.fetchPypi { + inherit (old) pname; + inherit version; + sha256 = "sha256-MjWpAQ+uVDI+cnw6wG+3IHUv5mNbNCbjedrsYPvUSoM="; + }; + }); + }; + }; + }) + ]; + }; + poetry2nix = import inputs.poetry2nix { + inherit pkgs; + }; + in { + devShell = import ./shell.nix { + inherit pkgs poetry2nix; + }; + } + ); +} diff --git a/shell.nix b/shell.nix index 2abdc14acceb..2bd7b073c9ab 100644 --- a/shell.nix +++ b/shell.nix @@ -73,7 +73,7 @@ in [clang-tools dfu-programmer dfu-util diffutils git pythonEnv niv] ++ lib.optional avr [ pkgsCross.avr.buildPackages.binutils - pkgsCross.avr.buildPackages.gcc + pkgsCross.avr.buildPackages.gcc8 avrlibc avrdude ]