ref: cave out instances of userFLake dependencies and intject them as

if functions where contructors
This commit is contained in:
David Arnold 2021-04-18 22:00:49 -05:00
parent 40acfd13e3
commit 6f0392b55e
3 changed files with 26 additions and 11 deletions

View File

@ -1,6 +1,8 @@
{ lib }:
{ dir, extern, suites, overrides, multiPkgs, userFlakeNixOS, userFlakeInputs, userFlakeSelf }:
{ userFlakeNixOS, userFlakeInputs, userFlakeSelf }:
{ dir, extern, suites, overrides, multiPkgs }:
let
defaultSystem = "x86_64-linux";
@ -91,6 +93,8 @@ let
};
in
lib.os.devosSystem {
inherit userFlakeNixOS userFlakeInputs userFlakeSelf;
} {
inherit specialArgs;
system = defaultSystem;
modules = modules // { inherit local lib; };

View File

@ -1,6 +1,8 @@
{ lib, utils }:
{ extern, overrides, userFlakeNixOS, userFlakeSelf, userFlakeInputs }:
{ userFlakeNixOS, userFlakeSelf, userFlakeInputs }:
{ extern, overrides }:
(utils.lib.eachDefaultSystem
(system:
let

View File

@ -3,23 +3,30 @@ let
inherit (dev) os;
in
_: { self, ... } @ args:
_: { self, inputs, nixos, ... } @ args:
let
userFlakeSelf = self;
userFlakeInputs = inputs;
userFlakeNixOS = nixos;
cfg = (lib.mkFlake.evalOldArgs { inherit args; }).config;
multiPkgs = os.mkPkgs { inherit (cfg) extern overrides; };
multiPkgs = os.mkPkgs
{ inherit userFlakeSelf userFlakeInputs userFlakeNixOS; }
{ inherit (cfg) extern overrides; };
outputs = {
nixosConfigurations = os.mkHosts {
inherit userFlakeSelf multiPkgs;
nixosConfigurations = os.mkHosts
{ inherit userFlakeSelf userFlakeInputs userFlakeNixOS; }
{
inherit multiPkgs;
inherit (cfg) extern suites overrides;
dir = cfg.hosts;
};
homeConfigurations = os.mkHomeConfigurations;
homeConfigurations = os.mkHomeConfigurations
{ inherit userFlakeSelf; };
nixosModules = cfg.modules;
@ -36,7 +43,9 @@ let
pkgs = multiPkgs.${system};
pkgs-lib = lib.pkgs-lib.${system};
# all packages that are defined in ./pkgs
legacyPackages = os.mkPackages { inherit pkgs; };
legacyPackages = os.mkPackages
{ inherit userFlakeSelf; }
{ inherit pkgs; };
in
{
checks = pkgs-lib.tests.mkChecks {