fix(access): mistakes

This commit is contained in:
arcnmx 2024-04-15 12:01:22 -07:00
parent ed3fff4c4f
commit 62a01d2c03
2 changed files with 6 additions and 4 deletions

View file

@ -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 [

View file

@ -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;