Go to file
Tristan Daniël Maat 367579f5cd
Use Gitea over GitLab
Gitea simply offers better performance. I wasn't using all of GitLab's
features anyway, and while the missing CI is annoying, I hadn't
previously managed to set this up anyway, and it can be easily
replaced by something a bit more dedicated than GitLab's
implementation.

This should hopefully allow me to host git repositories without
compromising on memory/CPU time available to other services.
2020-07-13 21:45:44 +01:00
etc/nixos Use Gitea over GitLab 2020-07-13 21:45:44 +01:00
.gitignore Add Makefile for simpler testing 2020-02-08 21:31:49 +09:00
LICENSE Add LICENSE 2019-11-26 23:26:10 +00:00
Makefile Change the hostname to "tlaternet" 2020-07-08 19:00:47 +01:00
README.md Change README location 2019-11-26 23:20:35 +00:00

tlater.net server configuration

This is the NixOS configuration for tlater.net.

Testing

Building

To test locally in a VM, nix is required. Using a properly-configured nix, a qemu-based VM running the server can be created by first applying the following patch to disable hardware-specific configuration:

diff --git a/etc/nixos/configuration.nix b/etc/nixos/configuration.nix
index 387113d..aabee88 100644
--- a/etc/nixos/configuration.nix
+++ b/etc/nixos/configuration.nix
@@ -2,8 +2,8 @@

 {
   imports = [
-    ./hardware-configuration.nix
-    ./linode.nix
+    # ./hardware-configuration.nix
+    # ./linode.nix
   ];

   networking = {

Then building the VM with:

nix-build '<nixpkgs/nixos>' -A vm -k -I nixos-config=./configuration.nix

Running

To invoke the VM, use:

QEMU_NET_OPTS="hostfwd=tcp::2222-:2222,hostfwd=tcp::8000-:80" ./result/bin/run-tlater.net-vm

This will set up a qemu VM with ports 2222 linked to the ssh port, and 8000 to the http port. If other ports are required, adjust the environment variable (notably, ssl is provided by the image, although it should not work since it is unlikely that letsencrypt will supply any certificates).

Note that other environment variables are available (such as one for disabling the qt GUI, probably handy for eventual CI). They are listed under "Building a service as a VM (for testing)" here (not linked since the page isn't set up very nicely).