aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..d88e5a1
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,46 @@
+{
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs =
+ {
+ self,
+ nixpkgs,
+ flake-utils,
+ ...
+ }:
+ let
+ shell =
+ { pkgs }:
+ pkgs.mkShell rec {
+ buildInputs = with pkgs; [
+ pkgs.pkgsCross.avr.buildPackages.gcc
+ pkgs.pkgsCross.avr.avrlibc
+ arduino-core
+ avrdude
+
+ # dev
+ openocd
+ clang-tools
+ unixtools.xxd
+ just
+ pkg-config
+ ];
+
+ AVR_LIBC = "${pkgs.pkgsCross.avr.avrlibc}";
+ ARDUINO_LIB = "${pkgs.arduino}";
+ LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}";
+ };
+ in
+ flake-utils.lib.eachDefaultSystem (
+ system:
+ let
+ pkgs = import nixpkgs { inherit system; };
+ in
+ {
+ devShells.default = shell { inherit pkgs; };
+ }
+ );
+}