From cafdd8ef466f7e92d326b76215e2add5e1230727 Mon Sep 17 00:00:00 2001 From: xyven1 Date: Wed, 22 Nov 2023 22:36:13 -0500 Subject: [PATCH] irrigation flake --- irrigation-controller/.envrc | 1 + irrigation-controller/flake.lock | 60 ++++++++++++++++++++++++++++++++ irrigation-controller/flake.nix | 36 +++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 irrigation-controller/.envrc create mode 100644 irrigation-controller/flake.lock create mode 100644 irrigation-controller/flake.nix diff --git a/irrigation-controller/.envrc b/irrigation-controller/.envrc new file mode 100644 index 0000000..8392d15 --- /dev/null +++ b/irrigation-controller/.envrc @@ -0,0 +1 @@ +use flake \ No newline at end of file diff --git a/irrigation-controller/flake.lock b/irrigation-controller/flake.lock new file mode 100644 index 0000000..4c7150f --- /dev/null +++ b/irrigation-controller/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1692239266, + "narHash": "sha256-ktg117DuvHk5u8rl2GSHbLBbKJsgePxWFCGKtOID3nM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "698e5d9ceab1c673efc2b7eee06e3a375dce8477", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "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/irrigation-controller/flake.nix b/irrigation-controller/flake.nix new file mode 100644 index 0000000..d4fe739 --- /dev/null +++ b/irrigation-controller/flake.nix @@ -0,0 +1,36 @@ +{ + description = "PlatfomIO Develop Environment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem + (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + my-python = pkgs.python3; + python-with-my-packages = my-python.withPackages (p: with p; + [ + pip + ]); + in + { + devShells.default = pkgs.mkShell { + buildInputs = [ + python-with-my-packages + ] ++ (with pkgs; [ + platformio + esptool + ]); + + shellHook = '' + PYTHONPATH=${python-with-my-packages}/${python-with-my-packages.sitePackages} + ''; + }; + } + ); +} \ No newline at end of file