mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
fix(access): mistakes
This commit is contained in:
parent
ed3fff4c4f
commit
62a01d2c03
2 changed files with 6 additions and 4 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
inputs,
|
inputs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (inputs.self.lib.lib) mkAlmostOptionDefault;
|
inherit (inputs.self.lib.lib) mkAlmostOptionDefault mkAlmostDefault;
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.modules) mkIf mkMerge mkDefault mkOptionDefault;
|
inherit (lib.modules) mkIf mkMerge mkDefault mkOptionDefault;
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
|
|
@ -131,8 +131,8 @@
|
||||||
ssl.cert = let
|
ssl.cert = let
|
||||||
cert = nixosConfig.security.acme.certs.${cfg.cert.name};
|
cert = nixosConfig.security.acme.certs.${cfg.cert.name};
|
||||||
in {
|
in {
|
||||||
path = mkIf (cfg.cert.name != null) (mkAlmostOptionDefault "${cert.directory}/fullchain.pem");
|
path = mkIf (cfg.cert.name != null) (mkAlmostDefault "${cert.directory}/fullchain.pem");
|
||||||
keyPath = mkIf (cfg.cert.name != null) (mkAlmostOptionDefault "${cert.directory}/key.pem");
|
keyPath = mkIf (cfg.cert.name != null) (mkAlmostDefault "${cert.directory}/key.pem");
|
||||||
};
|
};
|
||||||
#listen.ssl = mkIf cfg.enable { ssl = true; };
|
#listen.ssl = mkIf cfg.enable { ssl = true; };
|
||||||
extraConfig = mkMerge [
|
extraConfig = mkMerge [
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,11 @@
|
||||||
config,
|
config,
|
||||||
meta,
|
meta,
|
||||||
lib,
|
lib,
|
||||||
|
gensokyo-zone,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
inherit (gensokyo-zone.lib) mkAddress6;
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.modules) mkIf mkMerge mkBefore mkDefault mkOptionDefault;
|
inherit (lib.modules) mkIf mkMerge mkBefore mkDefault mkOptionDefault;
|
||||||
inherit (lib.strings) optionalString concatStringsSep;
|
inherit (lib.strings) optionalString concatStringsSep;
|
||||||
|
|
@ -99,7 +101,7 @@ in {
|
||||||
type = str;
|
type = str;
|
||||||
default = let
|
default = let
|
||||||
scheme = if access.port == 443 then "https" else "http";
|
scheme = if access.port == 443 then "https" else "http";
|
||||||
in "${scheme}://${access.host}:${toString access.port}";
|
in "${scheme}://${mkAddress6 access.host}:${toString access.port}";
|
||||||
};
|
};
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = port;
|
type = port;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue