Servers named by service provided instead of by application.
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
| ---------------------------------------------------------| ---------------------------------------------------------------------------------| --------------------------------------------------------|
|
||||
| **No flakes** | Simplify onboarding and avoid a steep learning curve. | Configuration via `configuration.nix` + `callPackage`. |
|
||||
| **Modular structure** | Separate configurations by machine type and service. | Clear and maintainable directory tree. |
|
||||
| **Servers named by service, not by application** | Indicate what the machine does (git01 = Git forge) rather than the software (Gitea). Allows changing the underlying app without renaming. | Hosts under `hosts/servers/<service>01` (e.g. `git01`, `pass01`, `dns01`). |
|
||||
| **`callPackage` for modules** | Make modules autonomous, portable, and reusable. | Each module is an independent Nix package. |
|
||||
| **Separation of `user-profiles/` and `users/`** | Distinguish generic roles (e.g., `admin`) from concrete users (e.g., `xavier`). | Flexibility to apply profiles to multiple users. |
|
||||
| **`deploy.sh` script** | Automate deployment on existing machines. | Clone/update the repo + `nixos-rebuild switch`. |
|
||||
@@ -58,17 +59,17 @@ nixos-infra/
|
||||
│
|
||||
├── hosts/ # Machine configurations
|
||||
│ ├── servers/ # Servers (hypervisors, VMs, LXCs)
|
||||
│ │ ├── pve01/ # Hypervisor 1
|
||||
│ │ ├── hyper01/ # Hypervisor 1
|
||||
│ │ │ └── configuration.nix
|
||||
│ │ ├── pve02/ # Hypervisor 2
|
||||
│ │ ├── hyper02/ # Hypervisor 2
|
||||
│ │ │ └── configuration.nix
|
||||
│ │ ├── dns01/ # LXC container for DNS (master)
|
||||
│ │ │ └── configuration.nix
|
||||
│ │ ├── dns02/ # LXC container for DNS (slave)
|
||||
│ │ │ └── configuration.nix
|
||||
│ │ ├── gitea01/ # LXC container for Gitea
|
||||
│ │ ├── git01/ # LXC container for Git forge (e.g. Gitea)
|
||||
│ │ │ └── configuration.nix
|
||||
│ │ ├── vaultwarden/ # LXC container for Vaultwarden
|
||||
│ │ ├── pass01/ # LXC container for password manager (e.g. Vaultwarden)
|
||||
│ │ │ └── configuration.nix
|
||||
│ │ └── rp01/ # LXC container for reverse proxy
|
||||
│ │ └── configuration.nix
|
||||
@@ -158,11 +159,12 @@ nixos-infra/
|
||||
|
||||
| Name | Machine Type | Services | IPv4 | IPv6 Token |
|
||||
| ----------| --------------------| -------------| ------| ------------|
|
||||
| pve01 | Hypervisor | Proxmox | | |
|
||||
| pve02 | Hypervisor | Proxmox | | |
|
||||
| hyper01 | Hypervisor | Proxmox | | |
|
||||
| hyper02 | Hypervisor | Proxmox | | |
|
||||
| dns01 | LXC Container | DNS | | |
|
||||
| gitea01 | LXC Container | Gitea | | |
|
||||
| vault01 | LXC Container | Vaultwarden | | |
|
||||
| git01 | LXC Container | Git forge | | |
|
||||
| pass01 | LXC Container | Password mgr| | |
|
||||
| rp01 | LXC Container | Reverse proxy| | |
|
||||
| sting | Workstation | | | |
|
||||
| PC-FRIDA | Workstation | | | |
|
||||
|
||||
@@ -285,8 +287,9 @@ nixos-infra/
|
||||
## **💡 Notes and Best Practices**
|
||||
|
||||
- **Naming** :
|
||||
- Use explicit names for machines (e.g., `dns01`, `gitea01`).
|
||||
- For LXC containers, prefer short and descriptive names.
|
||||
- **Servers**: Name by service, not by application (e.g., `git01`, `pass01`, `dns01`).
|
||||
- **Workstations**: Use descriptive hostnames (e.g., `sting`, `gaia`).
|
||||
- **Hypervisors**: Prefix with `hyper` (e.g., `hyper01`, `hyper02`).
|
||||
- **Security** :
|
||||
- Disable root SSH access once deployment is complete.
|
||||
- Use SSH keys for authentication.
|
||||
|
||||
Reference in New Issue
Block a user