From 2b70cd3ae607d8c5d05b4266530be6011e94371b Mon Sep 17 00:00:00 2001 From: Pacman99 Date: Sun, 11 Apr 2021 22:25:37 -0700 Subject: [PATCH] fix some small bugs in mkFlake/evalArgs --- lib/default.nix | 5 ++++- lib/mkFlake/default.nix | 5 ++--- lib/mkFlake/evalArgs.nix | 10 +++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index ee06a3c..cf8d862 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -17,7 +17,10 @@ lib.makeExtensible (final: lists = callLibs ./lists.nix; strings = callLibs ./strings.nix; - mkFlake = callLibs ./mkFlake; + mkFlake = { + __functor = callLibs ./mkFlake; + evalArgs = callLibs ./mkFlake/evalArgs.nix; + }; pkgs-lib = callLibs ./pkgs-lib; diff --git a/lib/mkFlake/default.nix b/lib/mkFlake/default.nix index 700773f..31f019f 100644 --- a/lib/mkFlake/default.nix +++ b/lib/mkFlake/default.nix @@ -2,13 +2,12 @@ let inherit (dev) os; inherit (inputs) utils deploy; - evalFlakeArgs = dev.callLibs ./evalArgs.nix; in -{ self, ... } @ args: +_: { self, ... } @ args: let - cfg = (evalFlakeArgs { inherit args; }).config; + cfg = (dev.mkFlake.evalArgs { inherit args; }).config; multiPkgs = os.mkPkgs { inherit (cfg) extern overrides; }; diff --git a/lib/mkFlake/evalArgs.nix b/lib/mkFlake/evalArgs.nix index e6f055e..d368176 100644 --- a/lib/mkFlake/evalArgs.nix +++ b/lib/mkFlake/evalArgs.nix @@ -24,7 +24,7 @@ let check = builtins.isFunction; description = "valid Nixpkgs overlay"; }; - systemType = types.enum (builtins.attrValues config.supportedSystems); + systemType = types.enum config.supportedSystems; flakeType = with types; (addCheck attrs nixos.lib.isStorePath) // { description = "nix flake"; }; @@ -85,7 +85,7 @@ let }; }; - configModule = { name, ... }: { + configModule = { options = with types; { system = mkOption { type = systemType; @@ -95,7 +95,7 @@ let ''; }; channelName = mkOption { - type = types.enum (builtins.attrValues self.channels); + type = types.enum (builtins.attrValues config.channels); default = "nixpkgs"; description = '' Channel this config should follow @@ -108,7 +108,7 @@ let The configuration for this config ''; }; - externalmodules = mkOption { + externalModules = mkOption { type = pathTo moduleType; default = [ ]; description = '' @@ -121,7 +121,7 @@ let # Home-manager's configs get exported automatically from nixos.hosts # So there is no need for a config options in the home namespace # This is only needed for nixos - includeConfigsModule = { + includeConfigsModule = { name, ... }: { options = with types; { configDefaults = mkOption { type = submodule configModule;