NixService
One services.<name> block: the technical-configuration half of the model.
|
Note
|
Mirrors the two NixOS conventions:
Option order is preserved so the emitted nix stays diff-stable between runs. |
public sealed class NixService
1. Constructors
1.1. NixService(string, bool)
Creates a service block.
public NixService(string name, bool enable = true)
| Name | Type | Description |
|---|---|---|
name |
string |
Option path under |
enable |
bool |
Value for |
2. Properties
2.1. Enable
Whether services.<name>.enable is set to true.
public bool Enable { get; }
2.2. Name
Option path under services..
public string Name { get; }
2.3. Options
Declared options besides enable, in declaration order.
public IReadOnlyList<KeyValuePair<string, NixValue>> Options { get; }
3. Methods
3.1. Render(int)
Renders the whole services.<name> block as nix lines.
public string Render(int indent = 1)
| Name | Type | Description |
|---|---|---|
indent |
int |
Indentation depth in two-space units. |
Returns: string — Nix source lines for this service.
3.2. WithOption(string, NixValue)
Sets one option below this service, e.g. settings or openFirewall.
public NixService WithOption(string option, NixValue value)
| Name | Type | Description |
|---|---|---|
option |
string |
Option name relative to |
value |
NixValue |
Option value. |
Returns: NixService — This service, for chaining.