Additional documentation of how to add and test deployed systems.
This commit is contained in:
parent
6a5e8a2dc5
commit
b66ab168d6
1 changed files with 40 additions and 0 deletions
|
|
@ -171,6 +171,46 @@ Synchronizes local system changes back to the repository. This script:
|
||||||
5. Syncs changes from `/etc/nixos/modules` back to the repository
|
5. Syncs changes from `/etc/nixos/modules` back to the repository
|
||||||
6. Stages, commits, and pushes changes to the remote git repository with a timestamped commit message
|
6. Stages, commits, and pushes changes to the remote git repository with a timestamped commit message
|
||||||
|
|
||||||
|
## Adding New Systems
|
||||||
|
|
||||||
|
To add a new system configuration to the infrastructure:
|
||||||
|
|
||||||
|
1. **Create the configuration file** in `nix-system-configs/modules/system/`:
|
||||||
|
```bash
|
||||||
|
cp nix-system-configs/modules/system/blank_system_USE_THIS_AS_COPY.nix \
|
||||||
|
nix-system-configs/modules/system/your-new-system.nix
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Edit the configuration** to set your system's unique properties:
|
||||||
|
```nix
|
||||||
|
config = {
|
||||||
|
local.hostname = "nixos-your-system";
|
||||||
|
local.username = "yourusername";
|
||||||
|
local.userDescription = "Your System Description";
|
||||||
|
local.address = "10.XXX.XXX.XXX"; # Choose an available IP
|
||||||
|
|
||||||
|
system.stateVersion = "25.11";
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Register in `flake.nix`** to make it available for builds:
|
||||||
|
```nix
|
||||||
|
nixosConfigurations = {
|
||||||
|
# ...existing configurations...
|
||||||
|
|
||||||
|
"nixos-your-system" = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [ ./nix-system-configs/modules/system/your-new-system.nix ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
||||||
|
4. ***IF YOU WANT TO CHECK IT MANUALLY*** - **Test the configuration** before deploying, change the `nixos-your-system` accordingly:
|
||||||
|
```bash
|
||||||
|
nix build .#nixosConfigurations.nixos-your-system.config.system.build.toplevel
|
||||||
|
```
|
||||||
|
|
||||||
|
Once the build succeeds, the configuration is ready for deployment using the `pull.zsh` script on the target machine.
|
||||||
|
|
||||||
## How to maintain the local machines
|
## How to maintain the local machines
|
||||||
|
|
||||||
> [!NOTE] The following maintenance scripts should be made less unwieldy to use, so they will be changed in the next
|
> [!NOTE] The following maintenance scripts should be made less unwieldy to use, so they will be changed in the next
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue