From b1457155b4430a8b295b41101bf55b5e75042244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Bon=C3=A9?= Date: Mon, 23 Jun 2025 11:14:57 +0200 Subject: [PATCH] Expose our packages in flake packages output --- flake.nix | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 73e3697..a34baa6 100644 --- a/flake.nix +++ b/flake.nix @@ -3,15 +3,33 @@ outputs = { self, nixpkgs, ...}: let + system = "x86_64-linux"; pkgs = import nixpkgs { + inherit system; # For now we only support x86 - system = "x86_64-linux"; overlays = [ self.overlays.default ]; }; in { bscOverlay = import ./overlay.nix; overlays.default = self.bscOverlay; - legacyPackages.x86_64-linux = pkgs; + + # full nixpkgs with our overlay applied + legacyPackages.${system} = pkgs; + + # packages added by our overlay + packages.${system} = + let + inherit (builtins) attrNames removeAttrs; + inherit (nixpkgs.lib) flip filterAttrs getAttrs pipe isDerivation; + in + # extract the names of the packages from the overlay, then get the + # actual packages from the full package set with the overlay applied + pipe (self.overlays.default null null) [ + attrNames + (flip getAttrs pkgs) + (flip removeAttrs [ "bsc" ]) + (filterAttrs (_: isDerivation)) + ]; }; }