From 6e260b3bdc502219decfbe81159d51c9207beaaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=E2=80=9CNiols=E2=80=9D=20Jeannerod?= Date: Sat, 16 Nov 2024 18:40:47 +0000 Subject: [PATCH] Consolidate virtualisation options --- services/README.md | 2 +- services/vm/interactive-vm.nix | 27 +++------------------------ services/vm/mastodon-vm.nix | 9 --------- services/vm/pixelfed-vm.nix | 9 --------- 4 files changed, 4 insertions(+), 43 deletions(-) diff --git a/services/README.md b/services/README.md index 6ef0b93..7d1b7c0 100644 --- a/services/README.md +++ b/services/README.md @@ -40,7 +40,7 @@ NOTE: it sometimes takes a while for the services to start up, and in the meanti ``` - Creating other accounts has to be enabled via the admin interface. `Administration > Configuration > Basic > Enable Signup` or just add an account directly from `Administration > Create user`. But functionality can also be tested from the root account. -- Pixelfed: +- Pixelfed: through the reverse proxy at - Account creation via the web interface won't work until we figure out email - For now, they can be created on the VM command line ```bash diff --git a/services/vm/interactive-vm.nix b/services/vm/interactive-vm.nix index 449864a..738f580 100644 --- a/services/vm/interactive-vm.nix +++ b/services/vm/interactive-vm.nix @@ -32,29 +32,8 @@ extra-experimental-features = nix-command flakes ''; - # no graphics. see nixos-shell - virtualisation = { - graphics = false; - qemu.consoles = [ - "tty0" - "hvc0" - ]; - qemu.options = [ - "-serial null" - "-device virtio-serial" - "-chardev stdio,mux=on,id=char0,signal=off" - "-mon chardev=char0,mode=readline" - "-device virtconsole,chardev=char0,nr=0" - ]; - }; + virtualisation.memorySize = 2048; - # we can't forward port 80 or 443, so let's run nginx on a different port - networking.firewall.allowedTCPPorts = [ - 8443 - 8080 - ]; - services.nginx.defaultSSLListenPort = 8443; - services.nginx.defaultHTTPListenPort = 8080; virtualisation.forwardPorts = [ { from = "host"; @@ -64,12 +43,12 @@ { from = "host"; host.port = 8080; - guest.port = 8080; + guest.port = 80; } { from = "host"; host.port = 8443; - guest.port = 8443; + guest.port = 443; } ]; } diff --git a/services/vm/mastodon-vm.nix b/services/vm/mastodon-vm.nix index fdaf71e..907900e 100644 --- a/services/vm/mastodon-vm.nix +++ b/services/vm/mastodon-vm.nix @@ -33,15 +33,6 @@ email = "none"; }; }; - - virtualisation.memorySize = 2048; - virtualisation.forwardPorts = [ - { - from = "host"; - host.port = 44443; - guest.port = 443; - } - ]; } #### run mastodon as development environment diff --git a/services/vm/pixelfed-vm.nix b/services/vm/pixelfed-vm.nix index b5e820f..927d042 100644 --- a/services/vm/pixelfed-vm.nix +++ b/services/vm/pixelfed-vm.nix @@ -23,13 +23,4 @@ in enableACME = mkVMOverride false; }; }; - - virtualisation.memorySize = 2048; - virtualisation.forwardPorts = [ - { - from = "host"; - host.port = 8000; - guest.port = 80; - } - ]; }