From b78b8efaac4eebc5f9d33dfac3b4a9a4d326b7c5 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Sat, 2 Dec 2023 00:57:07 +0000 Subject: [PATCH] Add overlay with packages --- flake.nix | 15 ++++++++------- shells/zephyr/default.nix | 10 +++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index a964406..ed9bdd8 100644 --- a/flake.nix +++ b/flake.nix @@ -11,17 +11,18 @@ let pkgs = import nixpkgs { inherit system; - overlays = [ (final: prev: self.packages."${system}") ]; + overlays = [ self.overlays.default ]; }; in { - packages = { - jlink = pkgs.callPackage ./packages/jlink { }; - zephyr = pkgs.callPackage ./packages/zephyr { }; - }; - devShells = { zephyr = pkgs.callPackage ./shells/zephyr { }; }; formatter = pkgs.nixfmt; - }); + packages = self.overlays.default pkgs pkgs; + }) // { + overlays.default = final: prev: { + jlink = final.callPackage ./packages/jlink { }; + zephyrPackages = final.callPackage ./packages/zephyr { }; + }; + }; } diff --git a/shells/zephyr/default.nix b/shells/zephyr/default.nix index 9f6aac4..4106220 100644 --- a/shells/zephyr/default.nix +++ b/shells/zephyr/default.nix @@ -1,8 +1,8 @@ -{ lib, mkShell, zephyr, cmake, ninja, gnumake, python3 -, toolchains ? with zephyr.toolchains; [ arm-zephyr-eabi ], enableWest ? false -, zephyrSrc ? zephyr.src, modules ? [ ], extraPackages ? [ ], extraAttrs ? { } -}: -let zephyr-sdk = zephyr.sdk.override { inherit toolchains; }; +{ lib, mkShell, zephyrPackages, cmake, ninja, gnumake, python3 +, toolchains ? with zephyrPackages.toolchains; [ arm-zephyr-eabi ] +, enableWest ? false, zephyrSrc ? zephyrPackages.src, modules ? [ ] +, extraPackages ? [ ], extraAttrs ? { } }: +let zephyr-sdk = zephyrPackages.sdk.override { inherit toolchains; }; in mkShell ({ packages = [ cmake ninja gnumake python3 ] ++ (with python3.pkgs; [