From 42b24b3e1410b0b9bbba7672df541f179508df7a Mon Sep 17 00:00:00 2001 From: efim Date: Sun, 26 Nov 2023 09:31:15 +0000 Subject: [PATCH] feat: testing vm recipe what i'm still figuring out is port forward (and how to target dns resolution?), otherwise i'd need to add graphical session and a browser into vm --- .gitignore | 1 + flake.nix | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/.gitignore b/.gitignore index 4b047a4..0dc6529 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /dump.rdb /result /routes/static/out.css +/nixos.qcow2 diff --git a/flake.nix b/flake.nix index c7b8b9c..662caec 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,40 @@ ${pkgs.nodePackages.tailwindcss}/bin/tailwindcss -i routes/in.css -o routes/static/out.css ''; }; + default = some-automoderation; + + # for testing whole deployment locally + # nixos-rebuild build-vm --flake .#test-container + nixosConfigurations.test-container = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + nixosModules.some-automoderation-module + ({ ... }: { + nix = { + extraOptions = '' + experimental-features = nix-command flakes + ''; + }; + networking.firewall.enable = false; + users.groups.test = {}; + users.mutableUsers = false; + users.users.test = { + isNormalUser = true; + password = "test"; + extraGroups = [ "wheel" "networkmanager" ]; + group = "test"; + }; + services.some-automoderation = { + enable = true; + host = "some-automoderation.sunshine.industries"; + useNginx = false; + port = 9090; + redisPort = 9999; + }; + }) + ]; + }; }; nixosModules.some-automoderation-module = { lib, pkgs, config, ... }: let