From bec05bafb1ac8b6daa2dcdc7de0ca24e038c6d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Mon, 17 Oct 2022 14:29:56 +0100 Subject: [PATCH] README.md: Update to new and improved flake mechanisms --- README.md | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index d5f2ed4..3962a65 100644 --- a/README.md +++ b/README.md @@ -4,21 +4,16 @@ This is the NixOS configuration for [tlater.net](https://tlater.net/). ## Testing -### Building - -Build the VM with: +Run a test VM with: ``` -nixos-rebuild build-vm --flake '.#vm' +nix run ``` ### Running *Note: M-2 will bring up a console for poweroff and such* -Running should *mostly* be as simple as running the command the build -script echos. - One caveat: create a larger disk image first. This can be done by running the following in the repository root: @@ -26,31 +21,18 @@ running the following in the repository root: qemu-img create -f qcow2 ./tlaternet.qcow2 20G ``` -Everything else should be handled by the devShell. - ### New services -Whenever a new service is added, append an appropriate -`,hostfwd=::3:` to the `QEMU_NET_OPTS` specified in -`flake.nix` to bind the service to a host port. +Whenever a new service is added, add an appropriate port binding to +`qemuNetOpts` in the default app. There is no way to test this without binding to the host port, sadly. ## Deploying -Currently the deployment process is fully manual because there is no -CI system. +Deployment is handled using +[deploy-rs](https://github.com/serokell/deploy-rs): -Nix makes this fairly painless, though, it's simply: - -```bash -nixos-rebuild switch --use-remote-sudo --target-host tlater.net --build-host localhost --flake .#tlaternet ``` - -This has the added benefit of running the build on the dev machine, -which is 99% of the time much faster at building than the target -(though artifact upload may take some time on slow connections). - -Note that this also requires the current local user to also be present -on the target host, as well as for this user to be in the target -host's wheel group. See `nix.trustedUsers`. +deploy .#tlaternet +``` -- 2.44.1