From b791b80e2a2e1cd07179b9f6f88dd9a0e4a4ec70 Mon Sep 17 00:00:00 2001 From: argonarch Date: Thu, 5 Sep 2024 18:12:24 -0300 Subject: [PATCH 1/2] add platformio framework --- platformio/.envrc | 1 + platformio/flake.lock | 25 +++++++++++++++++++++++ platformio/flake.nix | 46 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 platformio/.envrc create mode 100644 platformio/flake.lock create mode 100644 platformio/flake.nix diff --git a/platformio/.envrc b/platformio/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/platformio/.envrc @@ -0,0 +1 @@ +use flake diff --git a/platformio/flake.lock b/platformio/flake.lock new file mode 100644 index 0000000..7562321 --- /dev/null +++ b/platformio/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1721379653, + "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", + "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", + "revCount": 655136, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.655136%2Brev-1d9c2c9b3e71b9ee663d11c5d298727dace8d374/0190cd4f-c0eb-72cb-834b-ac854aa282dc/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} \ No newline at end of file diff --git a/platformio/flake.nix b/platformio/flake.nix new file mode 100644 index 0000000..f17f148 --- /dev/null +++ b/platformio/flake.nix @@ -0,0 +1,46 @@ +{ + description = "A Nix-flake-based C/C++ development environment"; + + inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; + + outputs = { + self, + nixpkgs, + }: let + supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; + forEachSupportedSystem = f: + nixpkgs.lib.genAttrs supportedSystems (system: + f { + pkgs = import nixpkgs {inherit system;}; + }); + in { + devShells = forEachSupportedSystem ({pkgs}: { + default = pkgs.mkShell { + shellHook = '' + export PLATFORMIO_CORE_DIR=$PWD/.platformio + ''; + buildInputs = with pkgs; [ + platformio + ]; + packages = with pkgs; + [ + clang-tools + cmake + codespell + conan + cppcheck + doxygen + gtest + lcov + vcpkg + vcpkg-tool + ] + ++ ( + if system == "aarch64-darwin" + then [] + else [gdb] + ); + }; + }); + }; +} From c5c491c3cec65cde55daaa4689c07f1b01a7f7f5 Mon Sep 17 00:00:00 2001 From: argonarch Date: Thu, 5 Sep 2024 20:09:00 -0300 Subject: [PATCH 2/2] add jupyter --- jupyter/.envrc | 1 + jupyter/flake.lock | 25 +++++++++++++++++++++++++ jupyter/flake.nix | 31 +++++++++++++++++++++++++++++++ jupyter/pyproject.toml | 14 ++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 jupyter/.envrc create mode 100644 jupyter/flake.lock create mode 100644 jupyter/flake.nix create mode 100644 jupyter/pyproject.toml diff --git a/jupyter/.envrc b/jupyter/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/jupyter/.envrc @@ -0,0 +1 @@ +use flake diff --git a/jupyter/flake.lock b/jupyter/flake.lock new file mode 100644 index 0000000..7562321 --- /dev/null +++ b/jupyter/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1721379653, + "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", + "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", + "revCount": 655136, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.655136%2Brev-1d9c2c9b3e71b9ee663d11c5d298727dace8d374/0190cd4f-c0eb-72cb-834b-ac854aa282dc/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} \ No newline at end of file diff --git a/jupyter/flake.nix b/jupyter/flake.nix new file mode 100644 index 0000000..9773532 --- /dev/null +++ b/jupyter/flake.nix @@ -0,0 +1,31 @@ +{ + description = "A Nix-flake-based Python development environment"; + + inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; + + outputs = { + self, + nixpkgs, + }: let + supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; + forEachSupportedSystem = f: + nixpkgs.lib.genAttrs supportedSystems (system: + f { + pkgs = import nixpkgs {inherit system;}; + }); + in { + devShells = forEachSupportedSystem ({pkgs}: { + default = pkgs.mkShell { + venvDir = ".venv"; + packages = with pkgs; + [python311] + ++ (with pkgs.python311Packages; [ + pip + venvShellHook + ipykernel + ]) + ++ (with pkgs; [poetry]); + }; + }); + }; +} diff --git a/jupyter/pyproject.toml b/jupyter/pyproject.toml new file mode 100644 index 0000000..4e54821 --- /dev/null +++ b/jupyter/pyproject.toml @@ -0,0 +1,14 @@ +[tool.poetry] +name = "sample-project" +version = "0.1.0" +description = "" +authors = ["user "] +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.11" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api"