diff --git a/Firmware/flake.lock b/Firmware/flake.lock index ecdb710..3601be1 100644 --- a/Firmware/flake.lock +++ b/Firmware/flake.lock @@ -1,59 +1,25 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1611574965, - "narHash": "sha256-IYtGS077nJFIqSq6Cb8WEJwbqqd4K7S4vUuwPZKfLeo=", + "lastModified": 1734649271, + "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=", "owner": "nixos", - "repo": "nixpkgs-channels", - "rev": "4762fba469e2baa82f983b262e2c06ac2fdaae67", + "repo": "nixpkgs", + "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507", "type": "github" }, "original": { "owner": "nixos", "ref": "nixos-unstable", - "repo": "nixpkgs-channels", + "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", diff --git a/Firmware/flake.nix b/Firmware/flake.nix index 46c9da0..455d29b 100644 --- a/Firmware/flake.nix +++ b/Firmware/flake.nix @@ -1,29 +1,35 @@ { inputs = { - nixpkgs = { - url = "github:nixos/nixpkgs-channels/nixos-unstable"; - }; - flake-utils = { - url = "github:numtide/flake-utils"; - }; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; }; - outputs = { - nixpkgs, - flake-utils, - ... - }: - flake-utils.lib.eachDefaultSystem ( - system: let - pkgs = import nixpkgs { - inherit system; - }; - in rec { - devShell = pkgs.mkShell { - buildInputs = with pkgs; [ - platformio - gnumake - ]; - }; - } - ); + + 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.override + { + # Override stdenv in order to change compiler: + # stdenv = pkgs.clangStdenv; + } + { + packages = with pkgs; [ + gnumake + platformio + ]; + }; + }); + }; }