summaryrefslogtreecommitdiff
path: root/tests/configuration.nix
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2022-11-13 21:21:00 +0100
committerQuentin Aristote <quentin@aristote.fr>2022-11-13 21:21:00 +0100
commit2e8711a58820fa84b4a14c6b6e754a614f22bc0e (patch)
tree36fa01118d9a6db41dbbec3e80d70b8cb85e7740 /tests/configuration.nix
parent87b4abe94d627c3aac572259310250a4c8b865c9 (diff)
use flakes
Diffstat (limited to 'tests/configuration.nix')
-rw-r--r--tests/configuration.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/configuration.nix b/tests/configuration.nix
new file mode 100644
index 0000000..e878c12
--- /dev/null
+++ b/tests/configuration.nix
@@ -0,0 +1,41 @@
+{ config, lib, ... }:
+
+let
+ nginxPorts = lib.concatLists
+ (lib.mapAttrsToList (_: cfg: (builtins.map (x: x.port) cfg.listen))
+ config.services.nginx.virtualHosts);
+ nginxMakeLocal = port: {
+ listen = lib.mkForce [{
+ inherit port;
+ addr = "0.0.0.0";
+ }];
+ forceSSL = lib.mkForce false;
+ enableACME = lib.mkForce false;
+ };
+in {
+ imports = [ ../configuration.nix ];
+
+ networking = lib.mkForce {
+ domain = "aristote.vm";
+
+ interfaces = { };
+ defaultGateway = null;
+ nameservers = [ ];
+
+ firewall = { allowedTCPPorts = nginxPorts; };
+ };
+
+ services.filtron.rules = lib.mkForce [ ];
+
+ services.nginx.virtualHosts = {
+ quentin = nginxMakeLocal 8080;
+ searx = nginxMakeLocal 8081;
+ money = nginxMakeLocal 8082;
+ rss = nginxMakeLocal 8083;
+ webkeydirectory = nginxMakeLocal 8084;
+ };
+
+ environment.etc."searx/secrets".text = ''
+ SECRET_KEY=secret_key
+ '';
+}