added manual secrets
This commit is contained in:
1 parent
672657c111
commit
d9cacefa0f
34 files changed
+1428
-10
No files matched your search
@@ -0,0 +1,51 @@
|
||||
# modules/nixos/common/
|
||||
|
||||
Baseline settings every Linux host receives. `default.nix` imports each file/subfolder and
|
||||
sets a few always-on defaults (`EDITOR=vi`, `NIXPKGS_ALLOW_UNFREE`, local bin in PATH).
|
||||
Most leaf modules expose a `skyg.nixos.common.*` enable flag and stay inert until switched on.
|
||||
|
||||
## Files
|
||||
|
||||
```
|
||||
common/
|
||||
├── default.nix # Imports everything below + always-on env defaults
|
||||
├── core.nix # System packages, nh, nix-ld, timezone (Toronto), locale, GC cron
|
||||
├── networking.nix # skyg.core.hostName, NetworkManager, NFS server
|
||||
├── user.nix # skyg.user.createSystemUser — creates the system user/groups + zsh shell
|
||||
├── fonts.nix # System font packages + fontconfig defaults (Fira Code, Noto, …)
|
||||
├── ssh-server.nix # skyg.nixos.common.ssh-server — hardened sshd + master pubkey
|
||||
├── qemu.nix # skyg.core.qemu — QEMU/quickemu + SPICE guest tooling
|
||||
├── containers/ # Docker vs Podman runtime selection
|
||||
├── hardware/ # GPU, fan control, audio, laptop power, Coral TPU udev
|
||||
└── pritunl/ # Pritunl VPN client service
|
||||
```
|
||||
|
||||
## Notable details
|
||||
|
||||
- **`core.nix`** sets `time.timeZone = "America/Toronto"`, `i18n` to `en_CA.UTF-8`, enables
|
||||
`programs.nh` with auto-clean, and adds a daily `nix-collect-garbage --delete-older-than 7d`
|
||||
cron job for both root and the user.
|
||||
- **`networking.nix`** defines `skyg.core.hostName`, enables NetworkManager + the NFS server,
|
||||
and disables the flaky `NetworkManager-wait-online` unit.
|
||||
- **`user.nix`** creates the actual system user (in `wheel` + `networkmanager`) with zsh as
|
||||
the login shell; gated by `skyg.user.createSystemUser` (default `true`).
|
||||
- **`ssh-server.nix`** ships the master public key and a hardened sshd config
|
||||
(key-only auth, long keepalives). Disabled by default.
|
||||
|
||||
## Option Namespace
|
||||
|
||||
```
|
||||
skyg.core.hostName → networking.nix
|
||||
skyg.user.createSystemUser → user.nix
|
||||
skyg.core.qemu.* → qemu.nix
|
||||
skyg.nixos.common.ssh-server.* → ssh-server.nix
|
||||
skyg.nixos.common.containers.* → containers/
|
||||
skyg.nixos.common.hardware.* → hardware/
|
||||
skyg.nixos.common.pritunl.* → pritunl/
|
||||
```
|
||||
|
||||
## Conventions
|
||||
|
||||
- This tree is for behaviour that is reasonable on *any* Linux host. Anything role-specific
|
||||
belongs in `server/` or `desktop/`.
|
||||
- Hostname-independent defaults can be set directly; anything optional gets an `enable` gate.
|
||||
@@ -0,0 +1,41 @@
|
||||
# modules/nixos/common/containers/
|
||||
|
||||
Container runtime configuration. Picks **one** of Docker or Podman based on
|
||||
`skyg.nixos.common.containers.runtime` and configures it consistently (compose tooling,
|
||||
user group membership, OCI backend, metrics).
|
||||
|
||||
## Files
|
||||
|
||||
```
|
||||
containers/
|
||||
├── default.nix # Shared options: runtime, enableOnBoot, registries, metrics port
|
||||
├── docker.nix # Applied when runtime == "docker"
|
||||
└── podman.nix # Applied when runtime == "podman" (dockerCompat + socket)
|
||||
```
|
||||
|
||||
## Behaviour
|
||||
|
||||
- `runtime` defaults to `"docker"`. Each backend file gates on `cfg.runtime == "<name>"`,
|
||||
so exactly one applies.
|
||||
- **Docker** enables autoprune, sets `insecure-registries` from `localDockerRegistries`
|
||||
(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`.
|
||||
- `openMetricsPort` opens the metrics port in the firewall (Docker only).
|
||||
|
||||
## Option Namespace
|
||||
|
||||
```
|
||||
skyg.nixos.common.containers.runtime → "docker" | "podman"
|
||||
skyg.nixos.common.containers.enableOnBoot
|
||||
skyg.nixos.common.containers.localDockerRegistries
|
||||
skyg.nixos.common.containers.metricsPort
|
||||
skyg.nixos.common.containers.openMetricsPort
|
||||
```
|
||||
|
||||
## Conventions
|
||||
|
||||
- Always select the runtime via the `runtime` option; do not enable both backends manually.
|
||||
- `virtualisation.oci-containers.backend` is set by whichever runtime is active, so server
|
||||
service modules can declare containers backend-agnostically.
|
||||
@@ -0,0 +1,42 @@
|
||||
# modules/nixos/common/hardware/
|
||||
|
||||
Per-device hardware modules. `default.nix` imports them all and turns on a couple of
|
||||
always-safe defaults (`services.fwupd`, `hardware.enableAllFirmware`); each specific module
|
||||
is gated by its own `skyg.nixos.common.hardware.*` enable flag so a host only pulls in what
|
||||
its physical hardware needs.
|
||||
|
||||
## Files
|
||||
|
||||
```
|
||||
hardware/
|
||||
├── default.nix # imports + fwupd + enableAllFirmware
|
||||
├── amdgpu.nix # skyg.nixos.common.hardware.amdgpu — amdgpu driver + ROCm ICD
|
||||
├── nvidia.nix # skyg.nixos.common.hardware.nvidia — driver + container toolkit
|
||||
├── sound.nix # skyg.nixos.common.hardware.sound — PipeWire ALSA/JACK + rtkit
|
||||
├── pipewire.nix # skyg.nixos.common.hardware.pipewire — full PipeWire stack
|
||||
├── fan2go.nix # skyg.nixos.common.hardware.fan2go — fan2go curve-based fan control
|
||||
├── fancontrol.nix # skyg.nixos.common.hardware.fancontrol — lm_sensors fancontrol
|
||||
├── laptop-power.nix # skyg.nixos.common.hardware.laptop-power-mgr — lid events + power mgmt
|
||||
└── coral-tpu-udev.nix # skyg.nixos.common.hardware.udevrules.coraltpu — Coral TPU udev rules
|
||||
```
|
||||
|
||||
## Option Namespace
|
||||
|
||||
```
|
||||
skyg.nixos.common.hardware.amdgpu.enable
|
||||
skyg.nixos.common.hardware.nvidia.enable
|
||||
skyg.nixos.common.hardware.sound.enable
|
||||
skyg.nixos.common.hardware.pipewire.enable
|
||||
skyg.nixos.common.hardware.fan2go.{enable,dbPath}
|
||||
skyg.nixos.common.hardware.fancontrol.{enable,configName}
|
||||
skyg.nixos.common.hardware.laptop-power-mgr.enable
|
||||
skyg.nixos.common.hardware.udevrules.coraltpu.{enable,symlinkName}
|
||||
```
|
||||
|
||||
## Conventions
|
||||
|
||||
- One module per hardware concern; each defaults to `false` and is enabled per-host based on
|
||||
the machine's actual hardware.
|
||||
- `fan2go` and `fancontrol` are alternatives — pick one per host depending on the board.
|
||||
- Keep these orthogonal to `*.hardware-configuration.nix` (that file is generated and must
|
||||
never be hand-edited).
|
||||
@@ -0,0 +1,22 @@
|
||||
# modules/nixos/common/pritunl/
|
||||
|
||||
Pritunl VPN **client**. Installs `pritunl-client` and runs the
|
||||
`pritunl-client-service` systemd unit so VPN profiles can be managed on the host.
|
||||
|
||||
## Files
|
||||
|
||||
```
|
||||
pritunl/
|
||||
└── default.nix # skyg.nixos.common.pritunl.enable
|
||||
```
|
||||
|
||||
## Option Namespace
|
||||
|
||||
```
|
||||
skyg.nixos.common.pritunl.enable # default false
|
||||
```
|
||||
|
||||
## Conventions
|
||||
|
||||
- This only provisions the client daemon; VPN profiles/credentials are imported at runtime,
|
||||
not declared here.
|
||||
Reference in new issue
Block a user