difftreelog
feat make inputs' available in nixos config
in: trunk
3 files changed
lib/flakePart.nixdiffbeforeafterboth--- a/lib/flakePart.nix
+++ b/lib/flakePart.nix
@@ -74,6 +74,7 @@
fleetLib = import ../lib {
inherit (bootstrapNixpkgs) lib;
};
+ _fleetFlakeRootConfig = config;
};
};
in
modules/fleetLib.nixdiffbeforeafterboth--- a/modules/fleetLib.nix
+++ b/modules/fleetLib.nix
@@ -1,8 +1,4 @@
-{
- lib,
- config,
- ...
-}: {
+{lib, ...}: {
_module.args.fleetLib = import ../../lib {
inherit lib;
};
modules/nixos.nixdiffbeforeafterboth1{2 lib,3 fleetLib,4 inputs,5 config,6 ...7}: let8 inherit (lib.attrsets) mapAttrs;9 inherit (lib.options) mkOption;10 inherit (lib.types) deferredModule;11 inherit (lib.modules) mkRemovedOptionModule;12 inherit (fleetLib.options) mkHostsOption;1314 _file = ./nixos.nix;15in {16 options = {17 nixos = mkOption {18 description = ''19 Nixos configuration for all hosts.20 '';21 type = deferredModule;22 };23 hosts = mkHostsOption (hostArgs: {24 inherit _file;25 options = {26 nixos = mkOption {27 description = ''28 Nixos configuration for the current host.29 '';30 type = deferredModule;31 apply = module:32 config.nixpkgs.buildUsing.lib.nixosSystem {33 inherit (hostArgs.config) system;34 modules = [35 (module // {key = "attr<host.nixos>";})36 (config.nixos // {key = "attr<fleet.nixos>";})37 ];38 specialArgs = {39 inherit fleetLib inputs;40 };41 };42 };43 };44 config = {45 # imports = [46 # (mkRemovedOptionModule ["nixosModules"] "replaced with hosts.*.nixos.imports.")47 # ];48 nixos = {49 config._module.args = {50 nixosHosts = mapAttrs (_: value: value.nixos.config) config.hosts;51 hosts = config.hosts;52 host = hostArgs.config;53 };54 };55 };56 });57 };58 imports = [59 (mkRemovedOptionModule ["nixosModules"] "replaced with nixos.imports.")60 ];61 config.nixos.imports =62 import ./nixos/module-list.nix;63}