aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2026-01-30 23:36:48 +0100
committerMax Audron <audron@cocaine.farm>2026-01-30 23:36:48 +0100
commitf99a9bc679492cccac8acf7727f606438ffd0fa9 (patch)
tree93a33aeaf50897d613be13ea434714ffd62493f2
parentgit: add touch for export ok file (diff)
add ac-cup-server
-rw-r--r--flake.lock366
-rw-r--r--flake.nix3
-rw-r--r--lib/nginx/default.nix18
-rw-r--r--modules/default.nix1
-rw-r--r--modules/web/default.nix22
5 files changed, 374 insertions, 36 deletions
diff --git a/flake.lock b/flake.lock
index c077451..8fc3f3d 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,15 +1,37 @@
{
"nodes": {
+ "ac-cup-server": {
+ "inputs": {
+ "flake-parts": "flake-parts",
+ "nci": "nci",
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1769796938,
+ "narHash": "sha256-JywM9QSf9sZ9U0+jV3ipd/eZWGHzgskwB2bv1FXZF3A=",
+ "owner": "maxaudron",
+ "repo": "ac-cup-server",
+ "rev": "b292b1bd0d55b20b9ca49dc02f2064995cae2255",
+ "type": "github"
+ },
+ "original": {
+ "owner": "maxaudron",
+ "repo": "ac-cup-server",
+ "type": "github"
+ }
+ },
"authentik-nix": {
"inputs": {
"authentik-src": "authentik-src",
- "flake-compat": "flake-compat",
- "flake-parts": "flake-parts",
+ "flake-compat": "flake-compat_2",
+ "flake-parts": "flake-parts_2",
"flake-utils": "flake-utils",
"napalm": "napalm",
"nixpkgs": "nixpkgs",
"pyproject-build-systems": "pyproject-build-systems",
- "pyproject-nix": "pyproject-nix",
+ "pyproject-nix": "pyproject-nix_2",
"systems": "systems",
"uv2nix": "uv2nix"
},
@@ -46,9 +68,9 @@
},
"catinator": {
"inputs": {
- "nci": "nci",
+ "nci": "nci_2",
"nixpkgs": "nixpkgs_2",
- "parts": "parts_2"
+ "parts": "parts_3"
},
"locked": {
"lastModified": 1766014490,
@@ -84,6 +106,23 @@
"crane_2": {
"flake": false,
"locked": {
+ "lastModified": 1758758545,
+ "narHash": "sha256-NU5WaEdfwF6i8faJ2Yh+jcK9vVFrofLcwlD/mP65JrI=",
+ "owner": "ipetkov",
+ "repo": "crane",
+ "rev": "95d528a5f54eaba0d12102249ce42f4d01f4e364",
+ "type": "github"
+ },
+ "original": {
+ "owner": "ipetkov",
+ "ref": "v0.21.1",
+ "repo": "crane",
+ "type": "github"
+ }
+ },
+ "crane_3": {
+ "flake": false,
+ "locked": {
"lastModified": 1699217310,
"narHash": "sha256-xpW3VFUG7yE6UE6Wl0dhqencuENSkV7qpnpe9I8VbPw=",
"owner": "ipetkov",
@@ -101,12 +140,36 @@
"dream2nix": {
"inputs": {
"nixpkgs": [
- "catinator",
+ "ac-cup-server",
"nci",
"nixpkgs"
],
"purescript-overlay": "purescript-overlay",
- "pyproject-nix": "pyproject-nix_2"
+ "pyproject-nix": "pyproject-nix"
+ },
+ "locked": {
+ "lastModified": 1765953015,
+ "narHash": "sha256-5FBZbbWR1Csp3Y2icfRkxMJw/a/5FGg8hCXej2//bbI=",
+ "owner": "nix-community",
+ "repo": "dream2nix",
+ "rev": "69eb01fa0995e1e90add49d8ca5bcba213b0416f",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "dream2nix",
+ "type": "github"
+ }
+ },
+ "dream2nix_2": {
+ "inputs": {
+ "nixpkgs": [
+ "catinator",
+ "nci",
+ "nixpkgs"
+ ],
+ "purescript-overlay": "purescript-overlay_2",
+ "pyproject-nix": "pyproject-nix_3"
},
"locked": {
"lastModified": 1765450682,
@@ -122,15 +185,15 @@
"type": "github"
}
},
- "dream2nix_2": {
+ "dream2nix_3": {
"inputs": {
"nixpkgs": [
"pastor",
"nci",
"nixpkgs"
],
- "purescript-overlay": "purescript-overlay_2",
- "pyproject-nix": "pyproject-nix_3"
+ "purescript-overlay": "purescript-overlay_3",
+ "pyproject-nix": "pyproject-nix_4"
},
"locked": {
"lastModified": 1722526955,
@@ -149,6 +212,22 @@
"flake-compat": {
"flake": false,
"locked": {
+ "lastModified": 1696426674,
+ "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
+ "type": "github"
+ },
+ "original": {
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "type": "github"
+ }
+ },
+ "flake-compat_2": {
+ "flake": false,
+ "locked": {
"lastModified": 1765121682,
"narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=",
"owner": "edolstra",
@@ -162,7 +241,7 @@
"type": "github"
}
},
- "flake-compat_2": {
+ "flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@@ -183,6 +262,24 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
+ "lastModified": 1768135262,
+ "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "type": "github"
+ }
+ },
+ "flake-parts_2": {
+ "inputs": {
+ "nixpkgs-lib": "nixpkgs-lib_2"
+ },
+ "locked": {
"lastModified": 1765835352,
"narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=",
"owner": "hercules-ci",
@@ -196,9 +293,9 @@
"type": "github"
}
},
- "flake-parts_2": {
+ "flake-parts_3": {
"inputs": {
- "nixpkgs-lib": "nixpkgs-lib_2"
+ "nixpkgs-lib": "nixpkgs-lib_3"
},
"locked": {
"lastModified": 1767609335,
@@ -214,9 +311,9 @@
"type": "github"
}
},
- "flake-parts_3": {
+ "flake-parts_4": {
"inputs": {
- "nixpkgs-lib": "nixpkgs-lib_3"
+ "nixpkgs-lib": "nixpkgs-lib_4"
},
"locked": {
"lastModified": 1690933134,
@@ -274,6 +371,22 @@
"locked": {
"lastModified": 1681286841,
"narHash": "sha256-3XlJrwlR0nBiREnuogoa5i1b4+w/XPe0z8bbrJASw0g=",
+ "owner": "90-008",
+ "repo": "mk-naked-shell",
+ "rev": "7612f828dd6f22b7fb332cc69440e839d7ffe6bd",
+ "type": "github"
+ },
+ "original": {
+ "owner": "90-008",
+ "repo": "mk-naked-shell",
+ "type": "github"
+ }
+ },
+ "mk-naked-shell_3": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1681286841,
+ "narHash": "sha256-3XlJrwlR0nBiREnuogoa5i1b4+w/XPe0z8bbrJASw0g=",
"owner": "yusdacra",
"repo": "mk-naked-shell",
"rev": "7612f828dd6f22b7fb332cc69440e839d7ffe6bd",
@@ -317,7 +430,7 @@
"dream2nix": "dream2nix",
"mk-naked-shell": "mk-naked-shell",
"nixpkgs": [
- "catinator",
+ "ac-cup-server",
"nixpkgs"
],
"parts": "parts",
@@ -325,11 +438,11 @@
"treefmt": "treefmt"
},
"locked": {
- "lastModified": 1765606778,
- "narHash": "sha256-Rngkpanmds2XYIpFav634N2EJnmCVGlT4j04rd/XCLE=",
+ "lastModified": 1769755038,
+ "narHash": "sha256-4LW7O06gafHpnd2QTU7S8AHcpH7smxX0Egb8bF5dZEc=",
"owner": "yusdacra",
"repo": "nix-cargo-integration",
- "rev": "f5b7a1543357cd2071cc847a9ae378328d7caa57",
+ "rev": "bbd754b60e2f803a4bdd2007387d921262ce6971",
"type": "github"
},
"original": {
@@ -344,14 +457,41 @@
"dream2nix": "dream2nix_2",
"mk-naked-shell": "mk-naked-shell_2",
"nixpkgs": [
- "pastor",
+ "catinator",
"nixpkgs"
],
- "parts": "parts_3",
+ "parts": "parts_2",
"rust-overlay": "rust-overlay_2",
"treefmt": "treefmt_2"
},
"locked": {
+ "lastModified": 1765606778,
+ "narHash": "sha256-Rngkpanmds2XYIpFav634N2EJnmCVGlT4j04rd/XCLE=",
+ "owner": "yusdacra",
+ "repo": "nix-cargo-integration",
+ "rev": "f5b7a1543357cd2071cc847a9ae378328d7caa57",
+ "type": "github"
+ },
+ "original": {
+ "owner": "yusdacra",
+ "repo": "nix-cargo-integration",
+ "type": "github"
+ }
+ },
+ "nci_3": {
+ "inputs": {
+ "crane": "crane_3",
+ "dream2nix": "dream2nix_3",
+ "mk-naked-shell": "mk-naked-shell_3",
+ "nixpkgs": [
+ "pastor",
+ "nixpkgs"
+ ],
+ "parts": "parts_4",
+ "rust-overlay": "rust-overlay_3",
+ "treefmt": "treefmt_3"
+ },
+ "locked": {
"lastModified": 1723443288,
"narHash": "sha256-bP60+yYZsDttnQINxWVJHH3+kS4MkLBbJzwIL61knTY=",
"owner": "yusdacra",
@@ -367,7 +507,7 @@
},
"nixinate": {
"inputs": {
- "flake-parts": "flake-parts_3",
+ "flake-parts": "flake-parts_4",
"nixpkgs": "nixpkgs_3"
},
"locked": {
@@ -432,6 +572,21 @@
},
"nixpkgs-lib_3": {
"locked": {
+ "lastModified": 1765674936,
+ "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
+ "owner": "nix-community",
+ "repo": "nixpkgs.lib",
+ "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "nixpkgs.lib",
+ "type": "github"
+ }
+ },
+ "nixpkgs-lib_4": {
+ "locked": {
"dir": "lib",
"lastModified": 1690881714,
"narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=",
@@ -547,6 +702,28 @@
"parts": {
"inputs": {
"nixpkgs-lib": [
+ "ac-cup-server",
+ "nci",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1768135262,
+ "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "type": "github"
+ }
+ },
+ "parts_2": {
+ "inputs": {
+ "nixpkgs-lib": [
"catinator",
"nci",
"nixpkgs"
@@ -566,7 +743,7 @@
"type": "github"
}
},
- "parts_2": {
+ "parts_3": {
"inputs": {
"nixpkgs-lib": [
"catinator",
@@ -587,7 +764,7 @@
"type": "github"
}
},
- "parts_3": {
+ "parts_4": {
"inputs": {
"nixpkgs-lib": [
"pastor",
@@ -609,7 +786,7 @@
"type": "github"
}
},
- "parts_4": {
+ "parts_5": {
"inputs": {
"nixpkgs-lib": [
"pastor",
@@ -632,9 +809,9 @@
},
"pastor": {
"inputs": {
- "nci": "nci_2",
+ "nci": "nci_3",
"nixpkgs": "nixpkgs_5",
- "parts": "parts_4"
+ "parts": "parts_5"
},
"locked": {
"lastModified": 1734483116,
@@ -653,9 +830,9 @@
},
"purescript-overlay": {
"inputs": {
- "flake-compat": "flake-compat_2",
+ "flake-compat": "flake-compat",
"nixpkgs": [
- "catinator",
+ "ac-cup-server",
"nci",
"dream2nix",
"nixpkgs"
@@ -678,8 +855,9 @@
},
"purescript-overlay_2": {
"inputs": {
+ "flake-compat": "flake-compat_3",
"nixpkgs": [
- "pastor",
+ "catinator",
"nci",
"dream2nix",
"nixpkgs"
@@ -687,6 +865,30 @@
"slimlock": "slimlock_2"
},
"locked": {
+ "lastModified": 1728546539,
+ "narHash": "sha256-Sws7w0tlnjD+Bjck1nv29NjC5DbL6nH5auL9Ex9Iz2A=",
+ "owner": "thomashoneyman",
+ "repo": "purescript-overlay",
+ "rev": "4ad4c15d07bd899d7346b331f377606631eb0ee4",
+ "type": "github"
+ },
+ "original": {
+ "owner": "thomashoneyman",
+ "repo": "purescript-overlay",
+ "type": "github"
+ }
+ },
+ "purescript-overlay_3": {
+ "inputs": {
+ "nixpkgs": [
+ "pastor",
+ "nci",
+ "dream2nix",
+ "nixpkgs"
+ ],
+ "slimlock": "slimlock_3"
+ },
+ "locked": {
"lastModified": 1696022621,
"narHash": "sha256-eMjFmsj2G1E0Q5XiibUNgFjTiSz0GxIeSSzzVdoN730=",
"owner": "thomashoneyman",
@@ -732,6 +934,29 @@
"pyproject-nix": {
"inputs": {
"nixpkgs": [
+ "ac-cup-server",
+ "nci",
+ "dream2nix",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1763017646,
+ "narHash": "sha256-Z+R2lveIp6Skn1VPH3taQIuMhABg1IizJd8oVdmdHsQ=",
+ "owner": "pyproject-nix",
+ "repo": "pyproject.nix",
+ "rev": "47bd6f296502842643078d66128f7b5e5370790c",
+ "type": "github"
+ },
+ "original": {
+ "owner": "pyproject-nix",
+ "repo": "pyproject.nix",
+ "type": "github"
+ }
+ },
+ "pyproject-nix_2": {
+ "inputs": {
+ "nixpkgs": [
"authentik-nix",
"nixpkgs"
]
@@ -750,7 +975,7 @@
"type": "github"
}
},
- "pyproject-nix_2": {
+ "pyproject-nix_3": {
"inputs": {
"nixpkgs": [
"catinator",
@@ -773,7 +998,7 @@
"type": "github"
}
},
- "pyproject-nix_3": {
+ "pyproject-nix_4": {
"flake": false,
"locked": {
"lastModified": 1702448246,
@@ -792,9 +1017,10 @@
},
"root": {
"inputs": {
+ "ac-cup-server": "ac-cup-server",
"authentik-nix": "authentik-nix",
"catinator": "catinator",
- "flake-parts": "flake-parts_2",
+ "flake-parts": "flake-parts_3",
"nixinate": "nixinate",
"nixpkgs": "nixpkgs_4",
"nixpkgs-master": "nixpkgs-master",
@@ -806,6 +1032,28 @@
"rust-overlay": {
"inputs": {
"nixpkgs": [
+ "ac-cup-server",
+ "nci",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1769742225,
+ "narHash": "sha256-roSD/OJ3x9nF+Dxr+/bLClX3U8FP9EkCQIFpzxKjSUM=",
+ "owner": "oxalica",
+ "repo": "rust-overlay",
+ "rev": "bcdd8d37594f0e201639f55889c01c827baf5c75",
+ "type": "github"
+ },
+ "original": {
+ "owner": "oxalica",
+ "repo": "rust-overlay",
+ "type": "github"
+ }
+ },
+ "rust-overlay_2": {
+ "inputs": {
+ "nixpkgs": [
"catinator",
"nci",
"nixpkgs"
@@ -825,7 +1073,7 @@
"type": "github"
}
},
- "rust-overlay_2": {
+ "rust-overlay_3": {
"flake": false,
"locked": {
"lastModified": 1723429325,
@@ -860,7 +1108,7 @@
"slimlock": {
"inputs": {
"nixpkgs": [
- "catinator",
+ "ac-cup-server",
"nci",
"dream2nix",
"purescript-overlay",
@@ -884,6 +1132,30 @@
"slimlock_2": {
"inputs": {
"nixpkgs": [
+ "catinator",
+ "nci",
+ "dream2nix",
+ "purescript-overlay",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1688756706,
+ "narHash": "sha256-xzkkMv3neJJJ89zo3o2ojp7nFeaZc2G0fYwNXNJRFlo=",
+ "owner": "thomashoneyman",
+ "repo": "slimlock",
+ "rev": "cf72723f59e2340d24881fd7bf61cb113b4c407c",
+ "type": "github"
+ },
+ "original": {
+ "owner": "thomashoneyman",
+ "repo": "slimlock",
+ "type": "github"
+ }
+ },
+ "slimlock_3": {
+ "inputs": {
+ "nixpkgs": [
"pastor",
"nci",
"dream2nix",
@@ -923,6 +1195,28 @@
"treefmt": {
"inputs": {
"nixpkgs": [
+ "ac-cup-server",
+ "nci",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1769691507,
+ "narHash": "sha256-8aAYwyVzSSwIhP2glDhw/G0i5+wOrren3v6WmxkVonM=",
+ "owner": "numtide",
+ "repo": "treefmt-nix",
+ "rev": "28b19c5844cc6e2257801d43f2772a4b4c050a1b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "treefmt-nix",
+ "type": "github"
+ }
+ },
+ "treefmt_2": {
+ "inputs": {
+ "nixpkgs": [
"catinator",
"nci",
"nixpkgs"
@@ -942,7 +1236,7 @@
"type": "github"
}
},
- "treefmt_2": {
+ "treefmt_3": {
"inputs": {
"nixpkgs": [
"pastor",
diff --git a/flake.nix b/flake.nix
index a4de5ad..f2625a7 100644
--- a/flake.nix
+++ b/flake.nix
@@ -12,6 +12,8 @@
};
catinator.url = "github:maxaudron/catinator";
+ ac-cup-server.url = "github:maxaudron/ac-cup-server";
+ ac-cup-server.inputs.nixpkgs.follows = "nixpkgs";
pastor.url = "gitlab:cocainefarm/pastor/feature/nix";
authentik-nix.url = "github:nix-community/authentik-nix";
@@ -107,6 +109,7 @@
monitoring
monitoring-node
homepage
+ web
{
services.nginx.virtualHosts."musicbrainz.vapor.systems" = (self.lib.nginx.proxyDomain "vapor.systems" "http://127.0.0.1:5000/");
}
diff --git a/lib/nginx/default.nix b/lib/nginx/default.nix
index c6b6da2..2ce04fd 100644
--- a/lib/nginx/default.nix
+++ b/lib/nginx/default.nix
@@ -17,6 +17,24 @@
'';
};
};
+
+ proxyDomainLocation = cert: proxyPass: location: {
+ forceSSL = true;
+ useACMEHost = cert;
+ locations."${location}" = {
+ inherit proxyPass;
+ proxyWebsockets = true;
+ extraConfig = ''
+ proxy_pass_header Authorization;
+
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $host;
+ proxy_set_header Upgrade $http_upgrade;
+ '';
+ };
+ };
+
proxyDomainAuth = cert: proxyPass: {
forceSSL = true;
diff --git a/modules/default.nix b/modules/default.nix
index 8deed27..8843f86 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -38,4 +38,5 @@
homepage = import ./homepage;
mailserver = import ./mailserver;
+ web = import ./web;
}
diff --git a/modules/web/default.nix b/modules/web/default.nix
new file mode 100644
index 0000000..ceaf3a3
--- /dev/null
+++ b/modules/web/default.nix
@@ -0,0 +1,22 @@
+{ self, config, ac-cup-server, ... }:
+
+with self.lib.nginx;
+{
+ imports = [ ac-cup-server.nixosModules.default ];
+
+ services.ac-cup-server = {
+ enable = true;
+ host = "10.10.0.1";
+ port = 8483;
+ storagePath = "/srv/assetto_corsa/cup.json";
+ logLevel = "info";
+ };
+
+
+ services.nginx = {
+ enable = true;
+ virtualHosts = {
+ "audron.dev" = proxyDomainLocation "audron.dev" "http://10.10.0.1:8483/" "/ac/cup/";
+ };
+ };
+}