lkjlkjdsalkj

This commit is contained in:
2025-06-15 08:30:33 +02:00
parent 491e6f1199
commit 252794b75d
3 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
{ lib, ... }:
let
cfg = config.networking;
in
{
options = {
# from https://github.com/NixOS/nixpkgs/blob/799ba5bffed04ced7067a91798353d360788b30d/nixos/modules/tasks/network-interfaces.nix
networking.hostName = mkOption {
default = config.system.nixos.distroId;
defaultText = literalExpression "config.system.nixos.distroId";
type = types.strMatching
"^$|^[[:alnum:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$";
};
networking.fqdn = mkOption {
readOnly = true;
type = types.str;
default = if (cfg.hostName != "" && cfg.domain != null)
then "${cfg.hostName}.${cfg.domain}"
else throw ''
The FQDN is required but cannot be determined. Please make sure that
both networking.hostName and networking.domain are set properly.
'';
defaultText = literalExpression ''"''${networking.hostName}.''${networking.domain}"'';
description = ''
The fully qualified domain name (FQDN) of this host. It is the result
of combining `networking.hostName` and `networking.domain.` Using this
option will result in an evaluation error if the hostname is empty or
no domain is specified.
Modules that accept a mere `networking.hostName` but prefer a fully qualified
domain name may use `networking.fqdnOrHostName` instead.
'';
};
};
}

View File

@@ -0,0 +1 @@
# TODO