From 561afaf18c2c6c25fe7c8e263d4508521e6723e1 Mon Sep 17 00:00:00 2001 From: xeals Date: Mon, 6 Mar 2023 10:30:13 +1100 Subject: [PATCH] default: refactor --- default.nix | 10 ++++++---- flake.nix | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/default.nix b/default.nix index 42a0f68..df1b27a 100644 --- a/default.nix +++ b/default.nix @@ -7,11 +7,13 @@ # nix-build -A mypackage { pkgs ? import { } }: - -import ./pkgs/top-level/all-packages.nix { inherit pkgs; } -// { +let + legacy = import ./pkgs/top-level/all-packages.nix { inherit pkgs; }; + units = import ./callUnitRoot.nix { inherit pkgs; root = ./pkgs/unit; }; +in +legacy // units // { # The `lib`, `modules`, and `overlay` names are special lib = import ./lib { inherit pkgs; }; # functions modules = import ./modules; # NixOS modules overlays = import ./overlays; # nixpkgs overlays -} // import ./callUnitRoot.nix { inherit pkgs; } +} diff --git a/flake.nix b/flake.nix index 001e3ef..c9bdadb 100644 --- a/flake.nix +++ b/flake.nix @@ -21,9 +21,10 @@ packages = let legacyPackages = import ./pkgs/top-level/all-packages.nix { inherit pkgs; }; + unitPackages = import ./callUnitRoot.nix { inherit pkgs; }; onlyAvailable = lib.filterAttrs (_: drv: builtins.elem system (drv.meta.platforms or [ ])); in - onlyAvailable (legacyPackages // import ./callUnitRoot.nix { inherit pkgs; }); + onlyAvailable (legacyPackages // unitPackages); checks = { nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" ''