Add 'old-conf/' from commit '62a64a79a8'
git-subtree-dir: old-conf git-subtree-mainline:4667974392git-subtree-split:62a64a79a8
This commit is contained in:
commit
83de52d5db
195 changed files with 13408 additions and 0 deletions
35
old-conf/lib/options.nix
Normal file
35
old-conf/lib/options.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
in
|
||||
rec {
|
||||
mkOpt = type: default:
|
||||
mkOption { inherit type default; };
|
||||
|
||||
mkOpt' = type: default: description:
|
||||
mkOption { inherit type default description; };
|
||||
|
||||
mkBoolOpt = default: mkOption {
|
||||
inherit default;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
findOutTlsConfig = domain: config:
|
||||
let
|
||||
spl = lib.splitString "." domain;
|
||||
len = builtins.length spl;
|
||||
outerDomain = lib.traceVal (lib.concatStringsSep "." (lib.sublist (len - 2) len spl));
|
||||
domains = config.ragon.services.nginx.domains;
|
||||
hasDomain = lib.any (d: d == outerDomain) domains;
|
||||
in
|
||||
if hasDomain then {
|
||||
forceSSL = true;
|
||||
useACMEHost = "${outerDomain}";
|
||||
} else
|
||||
{
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue