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 # nix-build -A mypackage
{ pkgs ? import <nixpkgs> { } }: { pkgs ? import <nixpkgs> { } }:
let
import ./pkgs/top-level/all-packages.nix { inherit pkgs; } 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 # The `lib`, `modules`, and `overlay` names are special
lib = import ./lib { inherit pkgs; }; # functions lib = import ./lib { inherit pkgs; }; # functions
modules = import ./modules; # NixOS modules modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays overlays = import ./overlays; # nixpkgs overlays
} // import ./callUnitRoot.nix { inherit pkgs; } }

View File

@ -21,9 +21,10 @@
packages = packages =
let let
legacyPackages = import ./pkgs/top-level/all-packages.nix { inherit pkgs; }; 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 [ ])); onlyAvailable = lib.filterAttrs (_: drv: builtins.elem system (drv.meta.platforms or [ ]));
in in
onlyAvailable (legacyPackages // import ./callUnitRoot.nix { inherit pkgs; }); onlyAvailable (legacyPackages // unitPackages);
checks = { checks = {
nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" '' nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" ''