Compare commits
2 Commits
3f070b6c52
...
42b35cb7ae
Author | SHA1 | Date | |
---|---|---|---|
42b35cb7ae | |||
2af4c735c9 |
39
README.md
39
README.md
@ -9,16 +9,47 @@ System and user configuration for NixOS-based systems.
|
|||||||
| **Theme:** | adwaita |
|
| **Theme:** | adwaita |
|
||||||
| **Terminal:** | Console |
|
| **Terminal:** | Console |
|
||||||
|
|
||||||
## Provisioning
|
## Provisioning a new host
|
||||||
> [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) is the module used for provisioning
|
> [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) is the module used
|
||||||
|
> for provisioning
|
||||||
|
|
||||||
Generate a new SSH host key in "$temp/etc/ssh" as per [this guide](https://nix-community.github.io/nixos-anywhere/howtos/secrets.html#example-decrypting-an-openssh-host-key-with-pass).
|
Generate a new SSH host key in "$temp/etc/ssh" as per [this guide](https://nix-community.github.io/nixos-anywhere/howtos/secrets.html#example-decrypting-an-openssh-host-key-with-pass).
|
||||||
|
```
|
||||||
|
ssh-keygen -t ed25519 -f /tmp/ssh_host_ed25519_key
|
||||||
|
```
|
||||||
|
|
||||||
Then run;
|
Update [nix-secrets](/jordan/nix-secrets) with the new host key to enable the system to decrypt
|
||||||
|
any relevant secrets.
|
||||||
|
|
||||||
|
In order to use the borgmatic module for backups, go to [borgbase.com](https://borgbase.com).
|
||||||
|
Add the generated SSH host key and create a new repository for the system.
|
||||||
|
|
||||||
|
Create a new directory under `hosts/` with a system configuration and disk layout.
|
||||||
|
|
||||||
|
Boot the NixOS installer (or any Linux distribution) on the target.
|
||||||
|
|
||||||
|
Then run:
|
||||||
```
|
```
|
||||||
nix run github:nix-community/nixos-anywhere -- \
|
nix run github:nix-community/nixos-anywhere -- \
|
||||||
--disk-encryption-keys /tmp/secret.key /tmp/secret.key \
|
--disk-encryption-keys /tmp/secret.key /tmp/secret.key \
|
||||||
--extra-files "$temp" \
|
--extra-files "$temp" \
|
||||||
--flake .#<hostname> \
|
--flake .#<hostname> \
|
||||||
root@<ip>
|
root@<target-ip>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Post install
|
||||||
|
|
||||||
|
If backups are configured, you'll need to run:
|
||||||
|
```
|
||||||
|
borgmatic init --encryption repokey-blake2
|
||||||
|
```
|
||||||
|
then restart `borgmatic`.
|
||||||
|
|
||||||
|
To join the Tailscale network, run:
|
||||||
|
```
|
||||||
|
tailscale up --login-server https://headscale.vimium.net
|
||||||
|
```
|
||||||
|
then visit the URL, SSH onto `vps1` and run `headscale --user mesh nodes register --key <key>`.
|
||||||
|
|
||||||
|
The new node can optionally be given a friendly name with `headscale node rename -i <index> <hostname>`.
|
||||||
|
|
||||||
|
12
flake.lock
generated
12
flake.lock
generated
@ -86,11 +86,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712798444,
|
"lastModified": 1712947906,
|
||||||
"narHash": "sha256-aAksVB7zMfBQTz0q2Lw3o78HM3Bg2FRziX2D6qnh+sk=",
|
"narHash": "sha256-T0eT2lMbcK7RLelkx0qx4SiFpOS/0dt0aSfLB+WsGV8=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "a297cb1cb0337ee10a7a0f9517954501d8f6f74d",
|
"rev": "8d4ae698eaac8bd717e23507da2ca8b345bec4b5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -309,11 +309,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712741485,
|
"lastModified": 1712867921,
|
||||||
"narHash": "sha256-bCs0+MSTra80oXAsnM6Oq62WsirOIaijQ/BbUY59tR4=",
|
"narHash": "sha256-edTFV4KldkCMdViC/rmpJa7oLIU8SE/S35lh/ukC7bg=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b2cf36f43f9ef2ded5711b30b1f393ac423d8f72",
|
"rev": "51651a540816273b67bc4dedea2d37d116c5f7fe",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user