howto:specific:nix_hosts
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
howto:specific:nix_hosts [2023/07/29 11:14] – created tcmal | howto:specific:nix_hosts [2024/11/13 12:52] (current) – merlin | ||
---|---|---|---|
Line 24: | Line 24: | ||
==== Installing Nix ==== | ==== Installing Nix ==== | ||
- | |||
You'll need something running *nix - either a VM or WSL. MacOS (Darwin) should work, but we haven' | You'll need something running *nix - either a VM or WSL. MacOS (Darwin) should work, but we haven' | ||
Line 38: | Line 37: | ||
If you do use the official Nix installer, add '' | If you do use the official Nix installer, add '' | ||
- | ==== Extra Setup ==== | + | For this to work, we need to have passwordless ssh to whatever host you are deploying to. This involves proxying through our SSH bastion. You can find more details [[howto: |
- | + | ||
- | Remote building works like this: | + | |
- | + | ||
- | - Upload your sources to our build server | + | |
- | - Have it build it | + | |
- | - When you deploy, everything gets downloaded from the build server | + | |
- | + | ||
- | For packages we're not building (most packages that we haven' | + | |
- | To fix this, add '' | + | |
- | + | ||
- | Lastly, we need // | + | |
< | < | ||
Line 57: | Line 45: | ||
HostName tardisproject.uk | HostName tardisproject.uk | ||
- | Host nixbuild.internal.tardisproject.uk | + | Host web.tardisproject.uk |
User root | User root | ||
- | HostName | + | HostName |
ProxyJump tardis | ProxyJump tardis | ||
IdentityFile / | IdentityFile / | ||
</ | </ | ||
- | [[hosts: | ||
- | |||
- | Finally, for deployment, you'll need to be able to ssh (from your user) into '' | ||
- | |||
- | If you've gotten this far, test everything with these commands: | ||
- | |||
- | < | ||
- | # Test using the remote build server | ||
- | nix store ping --store ssh:// | ||
- | # Test passwordless SSH to root@ wherever youre deploying | ||
- | ssh web.tardisproject.uk | ||
- | </ | ||
- | |||
- | ==== Doing the thing ==== | ||
Now that you're all setup, you can use the 3 scripts in our repo for most tasks: | Now that you're all setup, you can use the 3 scripts in our repo for most tasks: | ||
Line 89: | Line 63: | ||
- '' | - '' | ||
- '' | - '' | ||
+ | |||
+ | ==== Secret Encryption & agenix ==== | ||
+ | |||
+ | [[https:// | ||
+ | [[https:// | ||
+ | |||
+ | === Example usage (editing a secret file): === | ||
+ | |||
+ | |||
+ | |||
+ | < | ||
+ | nix develop # Downloads & installs tools we use for our nix configs, including agenix | ||
+ | cd secrets | ||
+ | export EDITOR vi # Or your editor of choice | ||
+ | agenix -e [secret file].age -i [Path to the tardis root SSH key] | ||
+ | </ | ||
+ |
howto/specific/nix_hosts.1690629260.txt.gz · Last modified: 2023/07/29 11:14 by tcmal