Skip to content

Commit

Permalink
Merge #112
Browse files Browse the repository at this point in the history
112: Fix broken overlays on nixos-unstable, close #110 r=blaggacao a=linyinfeng

After <NixOS/nixpkgs#140284>, attrset outputs of functions of type `anything` are now processed as modules.
    
This is not the expected behavior for overlays, devshell modules, and nixos tests. Use new option types instead of `anything`, fixing this issue.

Co-authored-by: Lin Yinfeng <[email protected]>
  • Loading branch information
bors[bot] and linyinfeng authored Oct 13, 2021
2 parents 6549cf4 + c9e2b3d commit dfe68a1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions doc/api-reference-devshell.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ list of valid module or path convertible to its or anything convertible to it


## devshell.externalModules
ERROR: The `externalModules` option has been removed.
The `externalModules` option has been removed.
Any modules that should be exported should be defined with the `exportedModules`
option and all other modules should just go into the `modules` option.


*_Type_*:
list of valid modules or anything convertible to it or path convertible to it
list of valid modules or anything convertible to it


*_Default_*
Expand All @@ -59,7 +59,7 @@ meant importing modules from external flakes


*_Type_*:
list of valid modules or anything convertible to it
list of valid modules or anything convertible to it or path convertible to it


*_Default_*
Expand Down
6 changes: 3 additions & 3 deletions doc/api-reference-home.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ modules to include in all hosts and export to homeModules output


*_Type_*:
list of valid modules or anything convertible to it
list of valid modules or anything convertible to it or path convertible to it


*_Default_*
Expand All @@ -35,13 +35,13 @@ list of valid modules or anything convertible to it


## home.externalModules
ERROR: The `externalModules` option has been removed.
The `externalModules` option has been removed.
Any modules that should be exported should be defined with the `exportedModules`
option and all other modules should just go into the `modules` option.


*_Type_*:
list of valid modules or anything convertible to it or path convertible to it
list of valid modules or anything convertible to it


*_Default_*
Expand Down
6 changes: 3 additions & 3 deletions doc/api-reference-nixos.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ modules to include in all hosts and export to nixosModules output


*_Type_*:
list of valid modules or anything convertible to it
list of valid modules or anything convertible to it or path convertible to it


*_Default_*
Expand All @@ -66,13 +66,13 @@ list of valid modules or anything convertible to it


## nixos.hostDefaults.externalModules
ERROR: The `externalModules` option has been removed.
The `externalModules` option has been removed.
Any modules that should be exported should be defined with the `exportedModules`
option and all other modules should just go into the `modules` option.


*_Type_*:
list of valid modules or anything convertible to it or path convertible to it
list of valid modules or anything convertible to it


*_Default_*
Expand Down
18 changes: 9 additions & 9 deletions src/mkFlake/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,22 @@ let
# Custom Types
# #############

nixosTestType = pathToOr (types.anything // {
nixosTestType = pathToOr (mkOptionType {
name = "test";
check = x: builtins.isFunction x || builtins.isAttrs x;
description = "valid NixOS test";
});

moduleType = with types; (anything // {
inherit (submodule { }) check;
moduleType = mkOptionType {
name = "module";
inherit (types.submodule { }) check;
description = "valid module";
});
};

devshellModuleType = with types; coercedTo path maybeImportDevshellToml (anything // {
inherit (submodule { }) check;
description = "valid module";
});
devshellModuleType = with types; coercedTo path maybeImportDevshellToml moduleType;

overlayType = pathToOr (types.anything // {
overlayType = pathToOr (mkOptionType {
name = "overlay";
check = builtins.isFunction;
description = "valid Nixpkgs overlay";
});
Expand Down

0 comments on commit dfe68a1

Please sign in to comment.