-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
486 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
## extern | ||
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 nixos and home manager configurations. | ||
Only attributes that are used should be returned. | ||
|
||
|
||
*_Type_*: | ||
function that evaluates to a(n) attrs | ||
|
||
*_Default_* | ||
``` | ||
"{ modules = []; overlays = []; specialArgs = []; userModules = []; userSpecialArgs = []; }\n" | ||
``` | ||
|
||
|
||
## hosts | ||
Path to directory containing host configurations that will be exported | ||
to the 'nixosConfigurations' output. | ||
|
||
|
||
*_Type_*: | ||
path | ||
|
||
*_Default_* | ||
``` | ||
"${self}/hosts" | ||
``` | ||
|
||
|
||
## modules | ||
list of modules to include in confgurations and export in 'nixosModules' output | ||
|
||
|
||
*_Type_*: | ||
list of valid modules | ||
|
||
*_Default_* | ||
``` | ||
[] | ||
``` | ||
|
||
|
||
## overlays | ||
path to folder containing overlays which will be applied to pkgs and exported in | ||
the 'overlays' output | ||
|
||
|
||
*_Type_*: | ||
path | ||
|
||
*_Default_* | ||
``` | ||
"${self}/overlays" | ||
``` | ||
|
||
|
||
## overrides | ||
attrset of packages and modules that will be pulled from nixpkgs master | ||
|
||
*_Type_*: | ||
attribute set | ||
|
||
*_Default_* | ||
``` | ||
"{ 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_* | ||
``` | ||
"(final: prev: {})" | ||
``` | ||
|
||
|
||
## profiles | ||
path to profiles folder that can be collected into suites | ||
|
||
*_Type_*: | ||
path | ||
|
||
*_Default_* | ||
``` | ||
"${self}/profiles" | ||
``` | ||
|
||
|
||
## self | ||
The flake to create the devos outputs for | ||
|
||
*_Type_*: | ||
attribute set | ||
|
||
|
||
|
||
## suites | ||
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_* | ||
``` | ||
"{ user = {}; system = {}; }" | ||
``` | ||
|
||
|
||
## userModules | ||
list of modules to include in home-manager configurations and export in | ||
'homeModules' output | ||
|
||
|
||
*_Type_*: | ||
list of valid modules | ||
|
||
*_Default_* | ||
``` | ||
[] | ||
``` | ||
|
||
|
||
## userProfiles | ||
path to user profiles folder that can be collected into userSuites | ||
|
||
*_Type_*: | ||
path | ||
|
||
*_Default_* | ||
``` | ||
"${self}/users/profiles" | ||
``` | ||
|
||
|
||
## users | ||
path to folder containing profiles that define system users | ||
|
||
|
||
*_Type_*: | ||
path | ||
|
||
*_Default_* | ||
``` | ||
"${self}/users" | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Use Devos as a library! | ||
You can also add devos as a flake input and use its library function, `mkFlake` to | ||
create your flake. This gives you the advantage of using nix flakes to sync with | ||
upstream changes in devos. | ||
|
||
You can either use the default template or use the 'mkflake' template which only | ||
includes the necessary folders for `mkFlake` usage. It can be pulled with: | ||
```sh | ||
nix flake init -t github:divnix/devos#mkflake | ||
``` | ||
|
||
Once you have a template, you need to add devos as a flake input, which would look | ||
like this: | ||
```nix | ||
inputs = { | ||
... | ||
devos.url = "github:divnix/devos"; | ||
}; | ||
``` | ||
> ##### Note: | ||
> - All devos inputs must still be included in your flake, due to a nix | ||
> [issue](https://github.com/NixOS/nix/pull/4641) with the `follows` attribute. | ||
> - You can append `/community` to access community modules [extern](../../extern). | ||
You can then call `mkFlake` to create your outputs. Here is a simple example: | ||
```nix | ||
outputs = { self, devos, ... }: devos.lib.mkFlake { | ||
inherit self; | ||
hosts = ./hosts; | ||
}; | ||
``` | ||
`mkFlake` has various arguments to include more devos concepts like suites and profiles. | ||
These options are documented in [mkFlakeOptions](../mkFlakeOptions.md). | ||
|
||
The devos template itself uses mkFlake to export its own outputs, so you can take | ||
a look at this repository's [flake.nix](../../flake.nix) for a more realistic use | ||
of `mkFlake`. | ||
|
||
You can now sync with upstream devos changes just like any other flake input. But | ||
you will no longer be able to edit devos's internals, since you are directly following | ||
upstream devos changes. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.