From e10c558425681068f774d5229aef42710d89d2c2 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Mon, 3 Mar 2025 00:47:51 -0500 Subject: [PATCH] expose packages output, add it to global nixpkgs Signed-off-by: ahuston-0 --- flake.nix | 6 ++---- lib/systems.nix | 4 ++-- modules/nix.nix | 14 +++++++++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 51e55b0..67a2ecd 100644 --- a/flake.nix +++ b/flake.nix @@ -145,6 +145,7 @@ ); inherit (lib.rad-dev.systems) genSystems getImages; inherit (self) outputs; # for hydra + in rec { inherit lib; # for allowing use of custom functions in nix repl @@ -159,10 +160,7 @@ qcow = getImages nixosConfigurations "qcow"; }; - packages.x86_64-linux.lego-latest = - nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/lego-latest/default.nix - { }; - + packages = import ./packages { pkgs = nixpkgs.legacyPackages.x86_64-linux; }; checks = import ./checks.nix { inherit inputs forEachSystem formatter; }; devShells = import ./shell.nix { inherit inputs forEachSystem checks; }; diff --git a/lib/systems.nix b/lib/systems.nix index a3188f2..b911e5a 100644 --- a/lib/systems.nix +++ b/lib/systems.nix @@ -149,7 +149,7 @@ rec { configPath, hostname, inputs, - outputs, + outputs ? { }, src, users, home ? true, @@ -219,7 +219,7 @@ rec { ; hostname = name; } - // import configPath { inherit inputs; } + // import configPath { inherit inputs outputs; } ); } ) (lib.rad-dev.lsdir path) diff --git a/modules/nix.nix b/modules/nix.nix index aaee247..457fef8 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, ... }: +{ + lib, + pkgs, + outputs, + ... +}: { nix = { package = pkgs.nixVersions.latest; @@ -46,4 +51,11 @@ dates = [ "01:00" ]; }; }; + + nixpkgs.overlays = [ + (_: _: { + # bring all packages into a namespace called rad-pkgs + rad-pkgs = lib.genAttrs (lib.attrNames outputs.packages) (pkg: outputs.packages.${pkg}); + }) + ]; }