Browse Source

Fixup example webserver system

Signed-off-by: Magic_RB <magic_rb@redalder.org>
master
Magic_RB 1 month ago
parent
commit
2570dcc47d
Signed by: Magic_RB GPG Key ID: 08D5287CC5DDCA0E
1 changed files with 73 additions and 47 deletions
  1. +73
    -47
      flake.nix

+ 73
- 47
flake.nix View File

@ -65,70 +65,96 @@
dockerTest = ((self.lib "x86_64-linux").makeSystem {
system = "x86_64-linux";
name = "nixng-docker";
config = ({ pkgs, ... }: {
runit.enable = true;
services.getty.tty = {
baudRate = 38400;
};
services.apache2 = {
enable = true;
premade.basic = {
config = ({ pkgs, options, ... }: {
config = {
runit = {
enable = true;
isContainer = 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";
init.services.apache2 = {
ensureSomething.link."documentRoot" = {
src = "${pkgs.apacheHttpd}/htdocs";
dst = "/var/www";
};
};
users.users."www-data" = {
uid = 1001;
group = "www-data";
};
users.groups."www-data" = {
gid = 1001;
};
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";
ServerRoot = "/var/www";
ServerName = "blowhole";
PidFile = "/httpd.pid";
ServerRoot = "/var/www";
ServerName = "blowhole";
PidFile = "/httpd.pid";
User = "www-data";
Group = "www-data";
User = "www-data";
Group = "www-data";
DocumentRoot = "/var/www";
DocumentRoot = "/var/www";
}
AddType = [
[ "image/svg+xml" "svg" "svgz" ]
];
AddEncoding = [ "gzip" "svgz" ];
{
ErrorLog = "/dev/stderr";
TransferLog = "/dev/stdout";
TypesConfig = "\${TYPES_CONFIG}";
LogLevel = "info";
}
Directory = {
"/" = {
Require = [ "all" "denied" ];
Options = "SymlinksIfOwnerMatch";
};
};
{
AddType = [
[ "image/svg+xml" "svg" "svgz" ]
];
AddEncoding = [ "gzip" "svgz" ];
VirtualHost = {
"*:80" = {
TypesConfig = "${pkgs.apacheHttpd}/conf/mime.types";
}
{
Directory = {
"/var/www" = {
Require = [ "all" "granted" ];
Options = [ "-Indexes" "+FollowSymlinks" ];
DirectoryIndex = "index.html";
"/" = {
Require = [ "all" "denied" ];
Options = "SymlinksIfOwnerMatch";
};
};
};
};
VirtualHost = {
"*:80" = {
Directory = {
"/var/www" = {
Require = [ "all" "granted" ];
Options = [ "-Indexes" "+FollowSymlinks" ];
DirectoryIndex = "index.html";
};
};
};
};
}
];
};
};
});
});
overlay = import ./overlay;
# packages = nixpkgs.lib.genAttrs
# supportedSystems
# (s: import nixpkgs { system = s; overlays = [ self.overlay ]; });
packages = nixpkgs.lib.genAttrs
supportedSystems
(s: import nixpkgs { system = s; overlays = [ self.overlay ]; });
};
}

Loading…
Cancel
Save