add flake.nix

This commit is contained in:
arne 2025-10-04 09:58:24 +02:00
commit 42f633e12f
4 changed files with 147 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

111
flake.lock generated Normal file
View file

@ -0,0 +1,111 @@
{
"nodes": {
"esp-idf": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1746690306,
"narHash": "sha256-bMp4BCrTOX7VDLVU8TzMSQj1hviBrARz9iiqNq6Vbnk=",
"owner": "mirrexagon",
"repo": "nixpkgs-esp-dev",
"rev": "6c34f2436015eb6c107970d9b88f3d5d4600c6fa",
"type": "github"
},
"original": {
"owner": "mirrexagon",
"repo": "nixpkgs-esp-dev",
"rev": "6c34f2436015eb6c107970d9b88f3d5d4600c6fa",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1729501122,
"narHash": "sha256-tScdcYQ37kMqlyqb5yizNDTKXZASLB4zHitlHwOg+/o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "56c7c4a3f5fdbef5bf81c7d9c28fbb45dc626611",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixpkgs-unstable",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1759558742,
"narHash": "sha256-0IQRQijNKweSTrGXNOHWhKpZWUPrWdyaO31IziPU7wY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7c0ae904a7533f1496cdac2115bb3ed95658a0ef",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"esp-idf": "esp-idf",
"nixpkgs": "nixpkgs_2",
"systems": "systems_2"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

35
flake.nix Normal file
View file

@ -0,0 +1,35 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
systems.url = "github:nix-systems/default-linux";
esp-idf.url = "github:mirrexagon/nixpkgs-esp-dev?rev=6c34f2436015eb6c107970d9b88f3d5d4600c6fa";
};
outputs = { nixpkgs, systems, esp-idf, ... }: let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system:
import nixpkgs {
inherit system;
});
in {
devShells = eachSystem(system: let
inherit (esp-idf.packages.${system}) esp-idf-esp32;
pkgs = pkgsFor.${system};
in {
default = pkgs.mkShell {
inputsFrom = [
# for building and flashing the sketch
esp-idf-esp32
];
packages = [
esp-idf-esp32
# for the `fontconvert.py` script of epdiy
(pkgs.python3.withPackages(ps: [ps.freetype-py]))
];
};
});
};
}