Skip to content

Commit

Permalink
fix some small bugs in mkFlake/evalArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pacman99 committed Apr 12, 2021
1 parent 8d0c036 commit 2b70cd3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
5 changes: 4 additions & 1 deletion lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 2 additions & 3 deletions lib/mkFlake/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; };

Expand Down
10 changes: 5 additions & 5 deletions lib/mkFlake/evalArgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
Expand Down Expand Up @@ -85,7 +85,7 @@ let
};
};

configModule = { name, ... }: {
configModule = {
options = with types; {
system = mkOption {
type = systemType;
Expand All @@ -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
Expand All @@ -108,7 +108,7 @@ let
The configuration for this config
'';
};
externalmodules = mkOption {
externalModules = mkOption {
type = pathTo moduleType;
default = [ ];
description = ''
Expand All @@ -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;
Expand Down

0 comments on commit 2b70cd3

Please sign in to comment.