default: refactor

This commit is contained in:
xeals 2023-03-06 10:30:13 +11:00
parent f0dc2d521d
commit 561afaf18c
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C
2 changed files with 8 additions and 5 deletions

View File

@ -7,11 +7,13 @@
# nix-build -A mypackage
{ pkgs ? import <nixpkgs> { } }:
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; }
}

View File

@ -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" ''