From 3cf06758748d787b4a50a327c48ea7883fcd2d5c Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee <107522312+lavafroth@users.noreply.github.com> Date: Fri, 25 Jul 2025 20:34:03 +0530 Subject: [PATCH] ci: nix flake --- .envrc | 1 + flake.lock | 25 +++++++++++++++++++++++++ flake.nix | 24 ++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8077958 --- /dev/null +++ b/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1753399495, + "narHash": "sha256-7XG/QBqhrYOyA2houjRTL2NMa7IKZZ/somBqr+Q/6Wo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0d00f23f023b7215b3f1035adb5247c8ec180dbc", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c78027a --- /dev/null +++ b/flake.nix @@ -0,0 +1,24 @@ +{ + description = "devshell"; + + outputs = + { nixpkgs, ... }: + let + forAllSystems = + f: nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (s: f nixpkgs.legacyPackages.${s}); + in + { + devShells = forAllSystems (pkgs: { + default = pkgs.mkShell { + packages = with pkgs; [ + stdenv.cc.cc + arduino-cli + platformio + ]; + + LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib"; + ARDUINO_CONFIG_FILE = "./arduino-cli.yaml"; + }; + }); + }; +}