Add instructions to README.md
This commit is contained in:
@@ -1,2 +1,25 @@
|
||||
# nix-helper-flake
|
||||
### nix-helper-flake
|
||||
|
||||
A simple flake that provides some basic helper functions as top-level outputs.
|
||||
|
||||
#### Usage:
|
||||
flake.nix
|
||||
```
|
||||
{
|
||||
inputs = {
|
||||
...
|
||||
|
||||
helpers = {
|
||||
url = "git+https://git.greyweather.dev/greyweather/nix-helper-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
Then in any module access functions with `inputs.helpers.<function-name>`, e.g.
|
||||
```
|
||||
{ inputs, config, ... }: {
|
||||
time.timeZone = inputs.helpers.mkIfElse (config.networking.hostName == "zohran") "America/New_York" "Europe/London";
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user