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