https://github.com/cmacrae/flakelight-darwin
A Darwin module for flakelight
https://github.com/cmacrae/flakelight-darwin
macos nix nix-darwin nix-flake
Last synced: 2 months ago
JSON representation
A Darwin module for flakelight
- Host: GitHub
- URL: https://github.com/cmacrae/flakelight-darwin
- Owner: cmacrae
- License: mit
- Created: 2024-02-28T18:02:23.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-30T12:05:26.000Z (about 2 years ago)
- Last Synced: 2024-05-01T13:45:55.995Z (about 2 years ago)
- Topics: macos, nix, nix-darwin, nix-flake
- Language: Nix
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# flakelight-darwin
A [nix-darwin][1] module for [flakelight][2].
[1]: https://github.com/LnL7/nix-darwin
[2]: https://github.com/nix-community/flakelight
## About
Provides integration for `darwinConfigurations` & `darwinModules` into your flakelight config, like so:
```nix
{
inputs = {
flakelight.url = "github:nix-community/flakelight";
flakelight-darwin.url = "github:cmacrae/flakelight-darwin";
};
outputs = { flakelight, flakelight-darwin, ... }: flakelight ./. {
imports = [ flakelight-darwin.flakelightModules.default ];
darwinConfigurations.example = {
system = "aarch64-darwin";
modules = [{ system.stateVersion = 4; }];
};
};
}
```
This mimics the expression of `nixosConfigurations` & `nixosModules` found in flakelight. Thus it benefits
from the same [directory][3] and [module(s)][4] conventions, such that:
- you can track your `darwinConfigurations` & `darwinModules` in directories, named `darwin` & `darwinModules`
- singular modules expressed directly (`darwinModule = { ... }`) yield the `default` attribute
- module declarations can point to paths
[3]: https://github.com/nix-community/flakelight/blob/master/API_GUIDE.md#nixdir
[4]: https://github.com/nix-community/flakelight/blob/master/API_GUIDE.md#nixosmodules-homemodules-and-flakelightmodules
For further guidance, consult [flakelight's excellent API guide][5] and note the documentation on `nixosConfigurations`
& `nixosModules`, wherein you can substitute `darwinConfigurations` & `darwinModules`
[5]: https://github.com/nix-community/flakelight/blob/master/API_GUIDE.md
## Getting Started
There are two [example templates](templates) provided
### [`basic`](templates/basic)
Provides a minimal example Darwin system declaration, directly in `flake.nix`.
Instantiate your own with:
```
nix flake init -t github:cmacrae/flakelight-darwin
```
### [`autoload`](templates/autoload)
Provides an example configuration comprised of multiple Darwin system declarations, importing an `example` module, represented in a directory structure:
```
.
├── flake.nix
└── nix
├── darwin
│ ├── host1
│ │ ├── configuration.nix
│ │ └── default.nix
│ └── host2
│ ├── configuration.nix
│ └── default.nix
└── darwinModules
└── example.nix
```
Instantiate your own with:
```
nix flake init -t github:cmacrae/flakelight-darwin#autoload
```