diff options
| -rw-r--r-- | flake.lock | 58 | ||||
| -rw-r--r-- | flake.nix | 20 | ||||
| -rw-r--r-- | nix/pico1541.nix | 16 |
3 files changed, 94 insertions, 0 deletions
diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..df01ff7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,58 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1791914995, + "narHash": "sha256-Zf/xfQEAasnwnmEfHqW/4hjDE/s44yn2hD4RuVIZRjA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b7a79d3fea1e214f6d668d521cecec0c01e26544", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1792782095, + "narHash": "sha256-8fmbCL1FhpRvN6iEB9TejL5+uA5TP+rD90hLuYqi9Ss=", + "rev": "901c54c08bdc20e00c2b3c73716b97497b1b3c74", + "type": "tarball", + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1100332.901c54c08bdc/nixexprs.tar.zst" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.zst" + } + }, + "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/flake.nix b/flake.nix new file mode 100644 index 0000000..941a950 --- /dev/null +++ b/flake.nix @@ -0,0 +1,20 @@ +{ + inputs = { + nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.zst"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = nixpkgs.legacyPackages.${system}; + pico1541 = pkgs.callPackage (import ./nix/pico1541.nix) {}; + in { + packages.pico1541 = pico1541; + packages.default = pico1541; + + devShells.default = pico1541.overrideAttrs (o: { + nativeBuildInputs = o.nativeBuildInputs + ++ (with pkgs; [ clang-tools openocd ]); + }); + }); +} diff --git a/nix/pico1541.nix b/nix/pico1541.nix new file mode 100644 index 0000000..d1f71a5 --- /dev/null +++ b/nix/pico1541.nix @@ -0,0 +1,16 @@ +{ stdenvNoCC +, cmake +, ninja +, python3 +, gcc-arm-embedded +, pico-sdk +, picotool +} : stdenvNoCC.mkDerivation { + pname = "pico1541"; + version = "0.0.0"; + src = ../.; + + nativeBuildInputs = [ ninja cmake python3 picotool ]; + buildInputs = [ gcc-arm-embedded ]; + PICO_SDK_PATH = "${pico-sdk.override { withSubmodules = true; }}/lib/pico-sdk"; +} |
