utils(mkVhost): add error_page config

Changed files
+30 -11
global
systems
koumakan
+2 -2
flake.nix
···
home-manager,
...
} @ inputs: let
-
_utils = import ./global/utils.nix {};
+
utils = import ./global/utils.nix;
lib = nixpkgs.lib;
systems = [
···
forAllSystems = fn: lib.genAttrs systems (s: fn nixpkgs.legacyPackages.${s});
in {
nixosConfigurations = {
-
koumakan = import ./systems/koumakan {inherit _utils lib inputs;};
+
koumakan = import ./systems/koumakan {inherit utils lib inputs;};
};
devShells = forAllSystems (pkgs: {
+22 -7
global/utils.nix
···
# see /docs/utils.md for a usage guide
-
{...}:
-
# let
-
# lib = pkgs.lib;
-
# in
-
rec {
-
mkVhost = opts:
+
{
+
inputs,
+
system,
+
...
+
}: rec {
+
mkVhost = {extraConfig ? "", ...} @ opts:
{
# ideally mkOverride/mkDefault would be used, but i have 0 idea how it works.
forceSSL = true;
useACMEHost = "global.c.soopy.moe";
kTLS = true;
}
-
// opts;
+
// opts
+
// {
+
# we do some funny things here
+
locations =
+
opts.locations
+
// {
+
"/_cgi/error/" = {alias = "${inputs.mystia.packages.${system}.staticly}/nginx_error_pages/";};
+
};
+
extraConfig =
+
''
+
error_page 503 /_cgi/error/503.html;
+
error_page 502 /_cgi/error/502.html;
+
error_page 404 /_cgi/error/404.html;
+
''
+
+ extraConfig;
+
};
mkSimpleProxy = {
port,
+6 -2
systems/koumakan/default.nix
···
{
lib,
-
_utils,
+
utils,
inputs,
...
}:
···
# see docs/tips_n_tricks.md#extra_opts for syntax
# see docs/utils.md for functions
specialArgs = {
-
inherit inputs _utils;
+
inherit inputs;
+
_utils = utils {
+
inherit inputs;
+
system = "x86_64-linux";
+
};
};
modules = [