All checks were successful
buildbot/nix-build .#checks.aarch64-darwin.nixos-test_install_machine Build done.
buildbot/nix-build .#checks.aarch64-darwin.nixos-iso-installer Build done.
buildbot/nix-build .#checks.aarch64-darwin.nixos-flash-installer Build done.
buildbot/nix-build .#checks.aarch64-linux.nixos-test_install_machine Build done.
buildbot/nix-build .#checks.aarch64-linux.nixos-flash-installer Build done.
buildbot/nix-build .#checks.x86_64-linux.package-clan-ts-api Build done.
buildbot/nix-build .#checks.x86_64-linux.package-clan-cli-docs Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-app-no-breakpoints Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-age Build done.
buildbot/nix-build .#checks.aarch64-darwin.nixos-test-backup Build done.
buildbot/nix-build .#checks.x86_64-linux.package-gui-installer-apk Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-e2fsprogs Build done.
buildbot/nix-build .#checks.x86_64-linux.package-module-docs Build done.
buildbot/nix-build .#checks.aarch64-linux.nixos-test-backup Build done.
buildbot/nix-build .#checks.x86_64-linux.check-for-breakpoints Build done.
buildbot/nix-build .#checks.aarch64-linux.nixos-iso-installer Build done.
buildbot/nix-build .#checks.x86_64-linux.package-gui-installer-archlinux Build done.
buildbot/nix-build .#checks.x86_64-linux.devShell-docs Build done.
buildbot/nix-build .#checks.x86_64-linux.package-gui-installer-deb Build done.
buildbot/nix-build .#checks.x86_64-linux.package-gui-installer-rpm Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-bash Build done.
buildbot/nix-build .#checks.x86_64-linux.package-clan-cli Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-nix Build done.
buildbot/nix-build .#checks.x86_64-linux.package-default Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-sops Build done.
buildbot/nix-build .#checks.x86_64-linux.nixos-test-backup Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-sshpass Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-tor Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-fakeroot Build done.
buildbot/nix-build .#checks.x86_64-linux.devShell-webview-ui Build done.
buildbot/nix-build .#checks.x86_64-linux.renderClanOptions Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-git Build done.
buildbot/nix-build .#checks.x86_64-linux."clan-dep-python3.11-mypy" Build done.
buildbot/nix-build .#checks.x86_64-linux."clan-dep-python3.11-qemu" Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-rsync Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-zbar Build done.
buildbot/nix-build .#checks.x86_64-linux.devShell-inventory-schema Build done.
buildbot/nix-build .#checks.x86_64-linux.devShell-clan-cli Build done.
buildbot/nix-build .#checks.x86_64-linux.inventory-schema-checks Build done.
buildbot/nix-build .#checks.x86_64-linux.deltachat Build done.
buildbot/nix-build .#checks.x86_64-linux.treefmt Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-dep-openssh Build done.
buildbot/nix-build .#checks.x86_64-linux.devShell-default Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-app-pytest Build done.
buildbot/nix-build .#checks.x86_64-linux.lib-jsonschema-example-valid Build done.
buildbot/nix-build .#checks.x86_64-linux.container Build done.
buildbot/nix-build .#checks.x86_64-linux.borgbackup Build done.
buildbot/nix-build .#checks.x86_64-linux.matrix-synapse Build done.
buildbot/nix-build .#checks.x86_64-linux.package-deploy-docs Build done.
buildbot/nix-build .#checks.x86_64-linux.nixos-test_install_machine Build done.
buildbot/nix-build .#checks.x86_64-linux.lib-jsonschema-nix-unit-tests Build done.
buildbot/nix-build .#checks.x86_64-linux.package-editor Build done.
buildbot/nix-build .#checks.x86_64-linux.package-zerotierone Build done.
buildbot/nix-build .#checks.x86_64-linux.package-zt-tcp-relay Build done.
buildbot/nix-build .#checks.x86_64-linux.module-schema Build done.
buildbot/nix-build .#checks.x86_64-linux.nixos-flash-installer Build done.
buildbot/nix-build .#checks.x86_64-linux.postgresql Build done.
buildbot/nix-build .#checks.x86_64-linux.package-impure-checks Build done.
buildbot/nix-build .#checks.x86_64-linux.package-inventory-schema Build done.
buildbot/nix-build .#checks.x86_64-linux.package-merge-after-ci Build done.
buildbot/nix-build .#checks.x86_64-linux.package-moonlight-sunshine-accept Build done.
buildbot/nix-build .#checks.x86_64-linux.package-docs Build done.
buildbot/nix-build .#checks.x86_64-linux.package-pending-reviews Build done.
buildbot/nix-build .#checks.x86_64-linux.package-tea-create-pr Build done.
buildbot/nix-build .#checks.x86_64-linux.package-zerotier-members Build done.
buildbot/nix-build .#checks.x86_64-linux.package-function-schema Build done.
buildbot/nix-build .#checks.x86_64-linux.nixos-iso-installer Build done.
buildbot/nix-build .#checks.x86_64-linux.package-module-schema Build done.
buildbot/nix-build .#checks.x86_64-linux.secrets Build done.
buildbot/nix-build .#checks.x86_64-linux.template-minimal Build done.
buildbot/nix-build .#checks.x86_64-linux.zt-tcp-relay Build done.
buildbot/nix-build .#checks.x86_64-linux.package-iso-installer Build done.
buildbot/nix-build .#checks.x86_64-linux.wayland-proxy-virtwl Build done.
buildbot/nix-build .#checks.x86_64-linux.devShell-clan-app Build done.
buildbot/nix-build .#checks.x86_64-linux.syncthing Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-pytest-without-core Build done.
buildbot/nix-build .#checks.x86_64-linux.package-webview-ui Build done.
buildbot/nix-build .#checks.x86_64-linux.package-clan-app Build done.
buildbot/nix-build .#checks.x86_64-linux.package-gui-install-test-ubuntu-22-04 Build done.
buildbot/nix-build .#checks.x86_64-linux.clan-pytest-with-core Build done.
buildbot/nix-build .#checks.x86_64-linux.test-backups Build done.
checks / checks-impure (pull_request) Successful in 2m35s
buildbot/nix-build .#checks.x86_64-linux.flash Build done.
buildbot/nix-build .#checks.x86_64-linux.test-installation Build done.
buildbot/nix-eval Build done.
195 lines
6.0 KiB
Markdown
195 lines
6.0 KiB
Markdown
# Configuration - How to configure clan with your own machines
|
|
|
|
## Global configuration
|
|
|
|
In the `flake.nix` file:
|
|
|
|
- [x] set a unique `name`.
|
|
|
|
=== "**buildClan**"
|
|
|
|
```nix title="clan-core.lib.buildClan"
|
|
buildClan {
|
|
# Set a unique name
|
|
meta.name = "Lobsters";
|
|
# Should usually point to the directory of flake.nix
|
|
directory = ./.;
|
|
|
|
machines = {
|
|
jon = {
|
|
# ...
|
|
};
|
|
# ...
|
|
}
|
|
}
|
|
```
|
|
|
|
=== "**flakeParts**"
|
|
|
|
!!! info "See [Clan with flake-parts](./flake-parts.md) for help migrating to flake-parts."
|
|
|
|
```nix title="clan-core.flakeModules.default"
|
|
clan = {
|
|
# Set a unique name
|
|
meta.name = "Lobsters";
|
|
|
|
machines = {
|
|
jon = {
|
|
# ...
|
|
};
|
|
# ...
|
|
}
|
|
};
|
|
```
|
|
|
|
## Machine configuration
|
|
|
|
Adding or configuring a new machine requires two simple steps:
|
|
|
|
### Step 1. Identify Target Disk-ID
|
|
|
|
1. Find the remote disk id by executing:
|
|
|
|
```bash title="setup computer"
|
|
ssh root@flash-installer.local lsblk --output NAME,ID-LINK,FSTYPE,SIZE,MOUNTPOINT
|
|
```
|
|
|
|
!!! Note
|
|
Replace `flash-installer.local` with the IP address of the machine if you don't have the avahi service running which resolves mDNS local domains.
|
|
|
|
Which should show something like:
|
|
|
|
```{.shellSession hl_lines="6" .no-copy}
|
|
NAME ID-LINK FSTYPE SIZE MOUNTPOINT
|
|
sda usb-ST_16GB_AA6271026J1000000509-0:0 14.9G
|
|
├─sda1 usb-ST_16GB_AA6271026J1000000509-0:0-part1 1M
|
|
├─sda2 usb-ST_16GB_AA6271026J1000000509-0:0-part2 vfat 100M /boot
|
|
└─sda3 usb-ST_16GB_AA6271026J1000000509-0:0-part3 ext4 2.9G /
|
|
nvme0n1 nvme-eui.e8238fa6bf530001001b448b4aec2929 476.9G
|
|
├─nvme0n1p1 nvme-eui.e8238fa6bf530001001b448b4aec2929-part1 vfat 512M
|
|
├─nvme0n1p2 nvme-eui.e8238fa6bf530001001b448b4aec2929-part2 ext4 459.6G
|
|
└─nvme0n1p3 nvme-eui.e8238fa6bf530001001b448b4aec2929-part3 swap 16.8G
|
|
```
|
|
|
|
1. Edit the following fields inside the `flake.nix`
|
|
|
|
=== "**buildClan**"
|
|
|
|
```nix title="clan-core.lib.buildClan" hl_lines="18 23"
|
|
buildClan {
|
|
# ...
|
|
machines = {
|
|
"jon" = {
|
|
imports = [
|
|
# ...
|
|
./modules/disko.nix
|
|
./machines/jon/configuration.nix
|
|
];
|
|
# ...
|
|
|
|
# Change this to the correct ip-address or hostname
|
|
# The hostname is the machine name by default
|
|
clan.networking.targetHost = pkgs.lib.mkDefault "root@jon"
|
|
|
|
# Change this to the ID-LINK of the desired disk shown by 'lsblk'
|
|
disko.devices.disk.main = {
|
|
device = "/dev/disk/by-id/__CHANGE_ME__";
|
|
}
|
|
|
|
# e.g. > cat ~/.ssh/id_ed25519.pub
|
|
users.users.root.openssh.authorizedKeys.keys = [
|
|
"<YOUR SSH_KEY>"
|
|
];
|
|
# ...
|
|
};
|
|
};
|
|
}
|
|
```
|
|
|
|
=== "**flakeParts**"
|
|
|
|
```nix title="clan-core.flakeModules.default" hl_lines="18 23"
|
|
clan = {
|
|
# ...
|
|
machines = {
|
|
"jon" = {
|
|
imports = [
|
|
# ...
|
|
./modules/disko.nix
|
|
./machines/jon/configuration.nix
|
|
];
|
|
# ...
|
|
|
|
# Change this to the correct ip-address or hostname
|
|
# The hostname is the machine name by default
|
|
clan.networking.targetHost = pkgs.lib.mkDefault "root@jon"
|
|
|
|
# Change this to the ID-LINK of the desired disk shown by 'lsblk'
|
|
disko.devices.disk.main = {
|
|
device = "/dev/disk/by-id/__CHANGE_ME__";
|
|
}
|
|
|
|
# e.g. > cat ~/.ssh/id_ed25519.pub
|
|
users.users.root.openssh.authorizedKeys.keys = [
|
|
"__YOUR_SSH_KEY__"
|
|
];
|
|
# ...
|
|
};
|
|
};
|
|
};
|
|
```
|
|
|
|
|
|
!!! Info "Replace `__CHANGE_ME__` with the appropriate identifier, such as `nvme-eui.e8238fa6bf530001001b448b4aec2929`"
|
|
!!! Info "Replace `__YOUR_SSH_KEY__` with your personal key, like `ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILoMI0NC5eT9pHlQExrvR5ASV3iW9+BXwhfchq0smXUJ jon@jon-desktop`"
|
|
|
|
These steps will allow you to update your machine later.
|
|
|
|
### Step 2: Detect Drivers
|
|
|
|
Generate the `hardware-configuration.nix` file for your machine by executing the following command:
|
|
|
|
```bash
|
|
clan machines hw-generate [MACHINE_NAME] [HOSTNAME]
|
|
```
|
|
|
|
replace `[MACHINE_NAME]` with the name of the machine i.e. `jon` and `[HOSTNAME]` with the `ip_adress` or `hostname` of the machine within the network. i.e. `flash-installer.local`
|
|
|
|
!!! Example
|
|
```bash
|
|
clan machines hw-generate jon flash-installer.local
|
|
```
|
|
|
|
This command connects to `flash-installer.local` as `root`, runs `nixos-generate-config` to detect hardware configurations (excluding filesystems), and writes them to `machines/jon/hardware-configuration.nix`.
|
|
|
|
### Step 3: Custom Disk Formatting
|
|
|
|
In `./modules/disko.nix`, a simple `ext4` disk partitioning scheme is defined for the Disko module. For more complex disk partitioning setups, refer to the [Disko examples](https://github.com/nix-community/disko/tree/master/example).
|
|
|
|
### Step 4: Custom Configuration
|
|
|
|
Modify `./machines/jon/configuration.nix` to personalize the system settings according to your requirements.
|
|
|
|
### Step 5: Check Configuration
|
|
|
|
Validate your configuration by running:
|
|
|
|
```bash
|
|
nix flake check
|
|
```
|
|
|
|
This command helps ensure that your system configuration is correct and free from errors.
|
|
|
|
!!! Note
|
|
|
|
Integrate this step into your [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration) workflow to ensure that only valid Nix configurations are merged into your codebase. This practice helps maintain system stability and reduces integration issues.
|
|
|
|
|
|
---
|
|
|
|
## Whats next?
|
|
|
|
- [Secrets & Facts](secrets.md): Setting up secrets with nix-sops
|
|
|
|
---
|