buz support
This commit is contained in:
1 parent
5d727c26cd
commit
beb83f21b3
13 files changed
+397
-42
No files matched your search
@@ -8,7 +8,8 @@ Container runtime configuration and compose-style service groups.
|
||||
containers/
|
||||
├── default.nix # Shared runtime options (runtime, enableOnBoot, registries, metrics)
|
||||
├── docker.nix # Applied when runtime == "docker"
|
||||
├── podman.nix # Applied when runtime == "podman" (dockerCompat + socket)
|
||||
├── podman.nix # Applied when runtime == "podman" (dockerCompat + socket + registries)
|
||||
├── networks.nix # Host-created container networks (skyg.nixos.common.containers.networks)
|
||||
├── container-services/ # Compose-style service groups (modular implementation)
|
||||
│ ├── default.nix
|
||||
│ ├── options.nix
|
||||
@@ -31,7 +32,8 @@ consistently (compose tooling, user group membership, OCI backend, metrics).
|
||||
(default `minipc1.lab.internal:5001`), exposes metrics on `metricsPort` (9323), adds the
|
||||
user to the `docker` group, and installs `docker-compose`.
|
||||
- **Podman** enables `dockerCompat` + docker socket so `docker`/`oci-containers` keep working,
|
||||
and installs `podman-compose` + `podman-tui`.
|
||||
allows plain-HTTP pulls from `localDockerRegistries` via
|
||||
`virtualisation.containers.registries.settings`, and installs `podman-compose` + `podman-tui`.
|
||||
- `openMetricsPort` opens the metrics port in the firewall (Docker only).
|
||||
|
||||
### Option namespace
|
||||
@@ -43,8 +45,39 @@ skyg.nixos.common.containers.enableOnBoot
|
||||
skyg.nixos.common.containers.localDockerRegistries
|
||||
skyg.nixos.common.containers.metricsPort
|
||||
skyg.nixos.common.containers.openMetricsPort
|
||||
skyg.nixos.common.containers.networks.<name>.* → networks.nix (host-created networks)
|
||||
```
|
||||
|
||||
## Host-created networks (`skyg.nixos.common.containers.networks`)
|
||||
|
||||
Creates container networks once on the host (one systemd oneshot each, ordered before
|
||||
`container-networks.target`), independent of any compose project. This is how a _single_
|
||||
network — e.g. one macvlan network — is shared by several `container-services` groups
|
||||
instead of being re-declared (and re-created) per stack.
|
||||
|
||||
```nix
|
||||
skyg.nixos.common.containers.networks.lab = {
|
||||
driver = "macvlan";
|
||||
driverOpts.parent = "eno1";
|
||||
subnet = "10.0.0.0/16";
|
||||
gateway = "10.0.0.1";
|
||||
ipRange = "10.0.101.16/28";
|
||||
};
|
||||
```
|
||||
|
||||
Each network exposes a computed `compose` attribute (an `external: true` entry) for use in a
|
||||
group's `networks` option:
|
||||
|
||||
```nix
|
||||
skyg.nixos.common.container-services.my-stack = {
|
||||
networks.lan = config.skyg.nixos.common.containers.networks.lab.compose;
|
||||
services.app.networks.lan = { ipv4_address = "10.0.101.3"; };
|
||||
};
|
||||
```
|
||||
|
||||
Fields: `enable`, `name` (default = attr name), `driver`, `driverOpts`, `subnet`, `gateway`,
|
||||
`ipRange`, `internal`. Works with both docker and podman.
|
||||
|
||||
## Container service groups (`skyg.nixos.common.container-services`)
|
||||
|
||||
A compose-like abstraction that:
|
||||
|
||||
Reference in new issue
Block a user