2024-12-20 10:55:06 +00:00
|
|
|
# Nixin web site
|
2024-12-27 08:45:04 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2024-12-20 10:55:06 +00:00
|
|
|
|
2024-12-20 09:45:32 +00:00
|
|
|
let
|
2024-12-20 10:55:06 +00:00
|
|
|
inherit (lib) mkOption mkDefault;
|
|
|
|
|
2024-12-20 09:45:32 +00:00
|
|
|
nixin-web = pkgs.stdenv.mkDerivation {
|
|
|
|
pname = "nixin-web";
|
|
|
|
version = "0.1-alpha";
|
|
|
|
src = pkgs.fetchzip {
|
|
|
|
url = "https://git.distrilab.fr/NixiN/nixin-web/actions/runs/85/artifacts/nixin-website.zip";
|
|
|
|
hash = "sha256-+cgWvbmjV9xckRCeRaj1dWqowBRbe/5497FcoZW+5ec=";
|
|
|
|
stripRoot = false;
|
|
|
|
};
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -a -T $src $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
2024-12-20 10:55:06 +00:00
|
|
|
options = {
|
|
|
|
nixin.web = {
|
|
|
|
http-port = mkOption { type = lib.types.int; };
|
|
|
|
domain = mkOption { type = lib.types.str; };
|
|
|
|
};
|
2024-12-20 09:45:32 +00:00
|
|
|
};
|
|
|
|
|
2024-12-20 10:55:06 +00:00
|
|
|
config = {
|
|
|
|
services.nginx.virtualHosts."${config.nixin.web.domain}" = {
|
|
|
|
listen = [
|
2024-12-27 08:52:27 +00:00
|
|
|
{
|
|
|
|
addr = "127.0.0.1";
|
|
|
|
port = config.nixin.web.http-port;
|
|
|
|
ssl = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
addr = "[::1]";
|
|
|
|
port = config.nixin.web.http-port;
|
|
|
|
ssl = false;
|
|
|
|
}
|
2024-12-20 10:55:06 +00:00
|
|
|
{
|
2024-12-27 08:45:04 +00:00
|
|
|
addr = config.nixin.wg.client.ipv4;
|
2024-12-20 10:55:06 +00:00
|
|
|
port = config.nixin.web.http-port;
|
|
|
|
ssl = false;
|
|
|
|
}
|
|
|
|
{
|
2024-12-27 08:45:04 +00:00
|
|
|
addr = "[${config.nixin.wg.client.ipv6}]";
|
2024-12-20 10:55:06 +00:00
|
|
|
port = config.nixin.web.http-port;
|
|
|
|
ssl = false;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
forceSSL = false;
|
|
|
|
enableACME = false;
|
|
|
|
locations."/".root = ''${nixin-web}'';
|
|
|
|
locations."/".index = "index.html";
|
|
|
|
};
|
|
|
|
|
2024-12-20 09:45:32 +00:00
|
|
|
};
|
|
|
|
}
|