2024-03-02 22:05:30 +01:00
|
|
|
{inputs, ...}: {
|
2023-06-13 23:05:08 +02:00
|
|
|
flake.nixngConfigurations.website = inputs.nixng.nglib.makeSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
name = "nixng-website";
|
2024-07-03 17:39:49 +02:00
|
|
|
nixpkgs = inputs.nixpkgs-stable;
|
2024-03-02 22:05:30 +01:00
|
|
|
config = {
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(lib)
|
|
|
|
singleton
|
|
|
|
;
|
|
|
|
in {
|
|
|
|
dumb-init = {
|
|
|
|
enable = true;
|
|
|
|
type.services = {};
|
|
|
|
};
|
|
|
|
init.services.apache2 = {
|
|
|
|
ensureSomething.link."documentRoot" = {
|
|
|
|
src = "${inputs.website.packages."x86_64-linux".website}/redalder";
|
|
|
|
dst = "/var/www";
|
2023-06-13 23:05:08 +02:00
|
|
|
};
|
2024-03-02 22:05:30 +01:00
|
|
|
shutdownOnExit = true;
|
|
|
|
};
|
|
|
|
services.apache2 = {
|
|
|
|
enable = true;
|
|
|
|
configuration = [
|
|
|
|
{
|
|
|
|
LoadModule = [
|
|
|
|
["mpm_event_module" "modules/mod_mpm_event.so"]
|
|
|
|
["log_config_module" "modules/mod_log_config.so"]
|
|
|
|
["unixd_module" "modules/mod_unixd.so"]
|
|
|
|
["authz_core_module" "modules/mod_authz_core.so"]
|
|
|
|
["dir_module" "modules/mod_dir.so"]
|
|
|
|
["mime_module" "modules/mod_mime.so"]
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
Listen = "0.0.0.0:80";
|
2023-06-13 23:05:08 +02:00
|
|
|
|
2024-03-02 22:05:30 +01:00
|
|
|
ServerRoot = "/var/www";
|
|
|
|
ServerName = "blowhole";
|
|
|
|
PidFile = "/httpd.pid";
|
2023-06-13 23:05:08 +02:00
|
|
|
|
2024-03-02 22:05:30 +01:00
|
|
|
User = "www-data";
|
|
|
|
Group = "www-data";
|
2023-06-13 23:05:08 +02:00
|
|
|
|
2024-03-02 22:05:30 +01:00
|
|
|
DocumentRoot = "/var/www";
|
|
|
|
}
|
2023-06-13 23:05:08 +02:00
|
|
|
|
2024-03-02 22:05:30 +01:00
|
|
|
{
|
|
|
|
ErrorLog = "/dev/stderr";
|
|
|
|
TransferLog = "/dev/stdout";
|
2023-06-13 23:05:08 +02:00
|
|
|
|
2024-03-02 22:05:30 +01:00
|
|
|
LogLevel = "info";
|
|
|
|
}
|
2023-06-13 23:05:08 +02:00
|
|
|
|
2024-03-02 22:05:30 +01:00
|
|
|
{
|
|
|
|
AddType = singleton [
|
|
|
|
"image/svg+xml"
|
|
|
|
"svg"
|
|
|
|
"svgz"
|
|
|
|
];
|
|
|
|
AddEncoding = [
|
|
|
|
"gzip"
|
|
|
|
"svgz"
|
|
|
|
];
|
2023-06-13 23:05:08 +02:00
|
|
|
|
2024-03-02 22:05:30 +01:00
|
|
|
TypesConfig = "${pkgs.apacheHttpd}/conf/mime.types";
|
|
|
|
}
|
2023-06-13 23:05:08 +02:00
|
|
|
|
2024-03-02 22:05:30 +01:00
|
|
|
{
|
|
|
|
Directory."/" = {
|
|
|
|
Require = ["all" "denied"];
|
|
|
|
Options = "SymlinksIfOwnerMatch";
|
|
|
|
};
|
2023-06-13 23:05:08 +02:00
|
|
|
|
2024-03-02 22:05:30 +01:00
|
|
|
VirtualHost."*:80".Directory."/var/www" = {
|
|
|
|
Require = ["all" "granted"];
|
|
|
|
Options = ["-Indexes" "+FollowSymlinks"];
|
|
|
|
DirectoryIndex = "index.html";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2023-06-13 23:05:08 +02:00
|
|
|
};
|
2024-03-02 22:05:30 +01:00
|
|
|
};
|
2023-06-13 23:05:08 +02:00
|
|
|
};
|
|
|
|
}
|