Skip to content

Commit

Permalink
evalFlakeArgs: cleanup descriptions and regenerate doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Pacman99 committed Mar 30, 2021
1 parent 09362b1 commit cde5eeb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 23 deletions.
50 changes: 31 additions & 19 deletions doc/mkFlakeOptions.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
## extern
Function with argument 'inputs' with all devos and this flake's inputs.
Function with argument 'inputs' that contains all devos and ${self}'s inputs.
The function should return an attribute set with modules, overlays, and
specialArgs to be included across devos
specialArgs to be included across nixos and home manager configurations.
Only attributes that are used should be returned.


*_Type_*:
function that evaluates to a(n) attrs

*_Default_*
```
"${self}/extern"
"{ modules = []; overlays = []; specialArgs = []; userModules = []; userSpecialArgs = []; }\n"
```


## hosts
Path to directory containing host configurations
Path to directory containing host configurations that will be exported
to the 'nixosConfigurations' output.


*_Type_*:
path
Expand All @@ -26,19 +29,22 @@ path


## modules
list of modules to include in confgurations
list of modules to include in confgurations and export in 'nixosModules' output


*_Type_*:
list of anythings
list of valid modules

*_Default_*
```
"${self}/modules/module-list.nix"
[]
```


## overlays
path to folder containing overlays which will be applied to pkgs
path to folder containing overlays which will be applied to pkgs and exported in
the 'overlays' output


*_Type_*:
path
Expand All @@ -57,27 +63,28 @@ attribute set

*_Default_*
```
"${self}/overrides"
"{ modules = []; disabledModules = []; packages = {}; }"
```


## packages
Overlay for custom packages that will be included in treewide 'pkgs'.
This should follow the standard nixpkgs overlay format - two argument function
that returns an attrset.
These packages will be exported to the 'packages' and 'legacyPackages' outputs.


*_Type_*:
Nixpkgs overlay

*_Default_*
```
"${self}/pkgs"
"(final: prev: {})"
```


## profiles
path to profiles folder
path to profiles folder that can be collected into suites

*_Type_*:
path
Expand All @@ -97,33 +104,37 @@ attribute set


## suites
function with inputs 'users' and 'profiles' that returns attribute 'system'
which defines suites passed to configurations as the suites specialArg
Function with inputs 'users' and 'profiles' that returns attribute set
with user and system suites. The former for Home Manager and the latter
for nixos configurations.
These can be accessed through the 'suites' specialArg in each config system.


*_Type_*:
function that evaluates to a(n) attrs

*_Default_*
```
"${self}/suites"
"{ user = {}; system = {}; }"
```


## userModules
list of modules to include in home-manager configurations
list of modules to include in home-manager configurations and export in
'homeModules' output


*_Type_*:
list of anythings
list of valid modules

*_Default_*
```
"${self}/users/modules/module-list.nix"
[]
```


## userProfiles
path to user profiles folder
path to user profiles folder that can be collected into userSuites

*_Type_*:
path
Expand All @@ -135,7 +146,8 @@ path


## users
path to folder containing user profiles
path to folder containing profiles that define system users


*_Type_*:
path
Expand Down
5 changes: 1 addition & 4 deletions lib/mkFlake/evalArgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ let
type = inputAttrs;
default = { ... }: defaults;
defaultText = ''
{ inputs }: {
modules = []; overlays = []; specialArgs = [];
userModules = []; userSpecialArgs = [];
}
{ modules = []; overlays = []; specialArgs = []; userModules = []; userSpecialArgs = []; }
'';
# So unneeded extern attributes can safely be deleted
apply = x: defaults // (x { inputs = inputs // self.inputs; });
Expand Down

0 comments on commit cde5eeb

Please sign in to comment.