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

View File

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

View File

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