mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-10 23:00:39 +02:00
chore: remove uses of mdDoc
This commit is contained in:
parent
d5304bbe2b
commit
cb1565c713
8 changed files with 33 additions and 41 deletions
|
@ -10,7 +10,6 @@
|
||||||
genAttrs
|
genAttrs
|
||||||
hasInfix
|
hasInfix
|
||||||
head
|
head
|
||||||
mdDoc
|
|
||||||
mkIf
|
mkIf
|
||||||
mkOption
|
mkOption
|
||||||
removeSuffix
|
removeSuffix
|
||||||
|
@ -21,7 +20,7 @@ in {
|
||||||
default = [];
|
default = [];
|
||||||
example = ["example.org"];
|
example = ["example.org"];
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
All domains for which a wildcard certificate will be generated.
|
All domains for which a wildcard certificate will be generated.
|
||||||
This will define the given `security.acme.certs` and set `extraDomainNames` correctly,
|
This will define the given `security.acme.certs` and set `extraDomainNames` correctly,
|
||||||
but does not fill any options such as credentials or dnsProvider. These have to be set
|
but does not fill any options such as credentials or dnsProvider. These have to be set
|
||||||
|
@ -34,7 +33,7 @@ in {
|
||||||
options.useACMEWildcardHost = mkOption {
|
options.useACMEWildcardHost = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = mdDoc ''Automatically set useACMEHost with the correct wildcard domain for the virtualHosts's main domain.'';
|
description = ''Automatically set useACMEHost with the correct wildcard domain for the virtualHosts's main domain.'';
|
||||||
};
|
};
|
||||||
config = let
|
config = let
|
||||||
# This retrieves all matching wildcard certs that would include
|
# This retrieves all matching wildcard certs that would include
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
flip
|
flip
|
||||||
mapAttrsToList
|
mapAttrsToList
|
||||||
mkDefault
|
mkDefault
|
||||||
mdDoc
|
|
||||||
mkIf
|
mkIf
|
||||||
mkOption
|
mkOption
|
||||||
types
|
types
|
||||||
|
@ -20,7 +19,7 @@ in {
|
||||||
options = {
|
options = {
|
||||||
users.deterministicIds = mkOption {
|
users.deterministicIds = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
Maps a user or group name to its expected uid/gid values. If a user/group is
|
Maps a user or group name to its expected uid/gid values. If a user/group is
|
||||||
used on the system without specifying a uid/gid, this module will assign the
|
used on the system without specifying a uid/gid, this module will assign the
|
||||||
corresponding ids defined here, or show an error if the definition is missing.
|
corresponding ids defined here, or show an error if the definition is missing.
|
||||||
|
@ -30,12 +29,12 @@ in {
|
||||||
uid = mkOption {
|
uid = mkOption {
|
||||||
type = types.nullOr types.int;
|
type = types.nullOr types.int;
|
||||||
default = null;
|
default = null;
|
||||||
description = mdDoc "The uid to assign if it is missing in `users.users.<name>`.";
|
description = "The uid to assign if it is missing in `users.users.<name>`.";
|
||||||
};
|
};
|
||||||
gid = mkOption {
|
gid = mkOption {
|
||||||
type = types.nullOr types.int;
|
type = types.nullOr types.int;
|
||||||
default = null;
|
default = null;
|
||||||
description = mdDoc "The gid to assign if it is missing in `users.groups.<name>`.";
|
description = "The gid to assign if it is missing in `users.groups.<name>`.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
attrNames
|
attrNames
|
||||||
concatMap
|
concatMap
|
||||||
getAttrFromPath
|
getAttrFromPath
|
||||||
mdDoc
|
|
||||||
mkOption
|
mkOption
|
||||||
mkOptionType
|
mkOptionType
|
||||||
mkMerge
|
mkMerge
|
||||||
|
@ -22,7 +21,7 @@ in {
|
||||||
# TODO expose exactly what we can configure! not everything
|
# TODO expose exactly what we can configure! not everything
|
||||||
options.nodes = mkOption {
|
options.nodes = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
description = mdDoc "Allows extending the configuration of other machines.";
|
description = "Allows extending the configuration of other machines.";
|
||||||
type = types.attrsOf (mkOptionType {
|
type = types.attrsOf (mkOptionType {
|
||||||
name = "Toplevel NixOS config";
|
name = "Toplevel NixOS config";
|
||||||
merge = _loc: map (x: x.value);
|
merge = _loc: map (x: x.value);
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
inherit
|
inherit
|
||||||
(lib)
|
(lib)
|
||||||
concatStringsSep
|
concatStringsSep
|
||||||
mdDoc
|
|
||||||
mkDefault
|
mkDefault
|
||||||
mkEnableOption
|
mkEnableOption
|
||||||
mkIf
|
mkIf
|
||||||
|
@ -18,27 +17,27 @@
|
||||||
cfg = config.meta.oauth2_proxy;
|
cfg = config.meta.oauth2_proxy;
|
||||||
in {
|
in {
|
||||||
options.meta.oauth2_proxy = {
|
options.meta.oauth2_proxy = {
|
||||||
enable = mkEnableOption (mdDoc "oauth2 proxy");
|
enable = mkEnableOption "oauth2 proxy";
|
||||||
|
|
||||||
cookieDomain = mkOption {
|
cookieDomain = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = mdDoc "The domain under which to store the credential cookie, and to which redirects will be allowed.";
|
description = "The domain under which to store the credential cookie, and to which redirects will be allowed.";
|
||||||
};
|
};
|
||||||
|
|
||||||
portalDomain = mkOption {
|
portalDomain = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = mdDoc "A domain on which to setup the oauth2 callback.";
|
description = "A domain on which to setup the oauth2 callback.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
options.services.nginx.virtualHosts = mkOption {
|
options.services.nginx.virtualHosts = mkOption {
|
||||||
type = types.attrsOf (types.submodule ({config, ...}: {
|
type = types.attrsOf (types.submodule ({config, ...}: {
|
||||||
options.oauth2 = {
|
options.oauth2 = {
|
||||||
enable = mkEnableOption (mdDoc "access protection of this resource using oauth2_proxy.");
|
enable = mkEnableOption "access protection of this resource using oauth2_proxy.";
|
||||||
allowedGroups = mkOption {
|
allowedGroups = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [];
|
default = [];
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
A list of groups that are allowed to access this resource, or the
|
A list of groups that are allowed to access this resource, or the
|
||||||
empty list to allow any authenticated client.
|
empty list to allow any authenticated client.
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
}: let
|
}: let
|
||||||
inherit
|
inherit
|
||||||
(lib)
|
(lib)
|
||||||
mdDoc
|
|
||||||
mkEnableOption
|
mkEnableOption
|
||||||
mkIf
|
mkIf
|
||||||
mkOption
|
mkOption
|
||||||
|
@ -17,10 +16,10 @@
|
||||||
cfg = config.meta.promtail;
|
cfg = config.meta.promtail;
|
||||||
in {
|
in {
|
||||||
options.meta.promtail = {
|
options.meta.promtail = {
|
||||||
enable = mkEnableOption (mdDoc "promtail to push logs to a loki instance.");
|
enable = mkEnableOption "promtail to push logs to a loki instance.";
|
||||||
proxy = mkOption {
|
proxy = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = mdDoc "The node name of the proxy server which provides the https loki api endpoint.";
|
description = "The node name of the proxy server which provides the https loki api endpoint.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
assertMsg
|
assertMsg
|
||||||
literalExpression
|
literalExpression
|
||||||
mapAttrs
|
mapAttrs
|
||||||
mdDoc
|
|
||||||
mkOption
|
mkOption
|
||||||
types
|
types
|
||||||
;
|
;
|
||||||
|
@ -42,7 +41,7 @@ in {
|
||||||
default = {};
|
default = {};
|
||||||
type = types.attrsOf types.path;
|
type = types.attrsOf types.path;
|
||||||
example = literalExpression "{ local = ./secrets.nix.age; }";
|
example = literalExpression "{ local = ./secrets.nix.age; }";
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
This file manages the origin for this machine's repository-secrets. Anything that is
|
This file manages the origin for this machine's repository-secrets. Anything that is
|
||||||
technically not a secret in the classical sense (i.e. that it has to be protected
|
technically not a secret in the classical sense (i.e. that it has to be protected
|
||||||
after it has been deployed), but something you want to keep secret from the public;
|
after it has been deployed), but something you want to keep secret from the public;
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
(lib)
|
(lib)
|
||||||
attrNames
|
attrNames
|
||||||
flip
|
flip
|
||||||
mdDoc
|
|
||||||
mkIf
|
mkIf
|
||||||
mkMerge
|
mkMerge
|
||||||
mkOption
|
mkOption
|
||||||
|
@ -19,7 +18,7 @@
|
||||||
in {
|
in {
|
||||||
options.meta.wireguard-proxy = mkOption {
|
options.meta.wireguard-proxy = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
Each entry here will setup a wireguard network that connects via the
|
Each entry here will setup a wireguard network that connects via the
|
||||||
given node and adds appropriate firewall zones. There will be a zone for
|
given node and adds appropriate firewall zones. There will be a zone for
|
||||||
the interface and one for the proxy server specifically. A corresponding
|
the interface and one for the proxy server specifically. A corresponding
|
||||||
|
@ -30,17 +29,17 @@ in {
|
||||||
nicName = mkOption {
|
nicName = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "proxy-${name}";
|
default = "proxy-${name}";
|
||||||
description = mdDoc "The name for the created wireguard network and its interface";
|
description = "The name for the created wireguard network and its interface";
|
||||||
};
|
};
|
||||||
allowedTCPPorts = mkOption {
|
allowedTCPPorts = mkOption {
|
||||||
type = types.listOf types.int;
|
type = types.listOf types.int;
|
||||||
default = [];
|
default = [];
|
||||||
description = mdDoc "Convenience option to allow incoming TCP connections from the proxy server (just the server, not the entire network).";
|
description = "Convenience option to allow incoming TCP connections from the proxy server (just the server, not the entire network).";
|
||||||
};
|
};
|
||||||
allowedUDPPorts = mkOption {
|
allowedUDPPorts = mkOption {
|
||||||
type = types.listOf types.int;
|
type = types.listOf types.int;
|
||||||
default = [];
|
default = [];
|
||||||
description = mdDoc "Convenience option to allow incoming UDP connections from the proxy server (just the server, not the entire network).";
|
description = "Convenience option to allow incoming UDP connections from the proxy server (just the server, not the entire network).";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
genAttrs
|
genAttrs
|
||||||
head
|
head
|
||||||
mapAttrsToList
|
mapAttrsToList
|
||||||
mdDoc
|
|
||||||
mergeToplevelConfigs
|
mergeToplevelConfigs
|
||||||
mkIf
|
mkIf
|
||||||
mkOption
|
mkOption
|
||||||
|
@ -256,32 +255,32 @@ in {
|
||||||
host = mkOption {
|
host = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
description = mdDoc "The hostname or ip address which other peers can use to reach this host. No server funnctionality will be activated if set to null.";
|
description = "The hostname or ip address which other peers can use to reach this host. No server funnctionality will be activated if set to null.";
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
default = 51820;
|
default = 51820;
|
||||||
type = types.port;
|
type = types.port;
|
||||||
description = mdDoc "The port to listen on.";
|
description = "The port to listen on.";
|
||||||
};
|
};
|
||||||
|
|
||||||
openFirewall = mkOption {
|
openFirewall = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
description = mdDoc "Whether to open the firewall for the specified {option}`port`.";
|
description = "Whether to open the firewall for the specified {option}`port`.";
|
||||||
};
|
};
|
||||||
|
|
||||||
openFirewallRules = mkOption {
|
openFirewallRules = mkOption {
|
||||||
default = [];
|
default = [];
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
description = mdDoc "The {option}`port` will be opened for all of the given rules in the nftable-firewall.";
|
description = "The {option}`port` will be opened for all of the given rules in the nftable-firewall.";
|
||||||
};
|
};
|
||||||
|
|
||||||
externalPeers = mkOption {
|
externalPeers = mkOption {
|
||||||
type = types.attrsOf (types.listOf (types.net.ip-in config.addresses));
|
type = types.attrsOf (types.listOf (types.net.ip-in config.addresses));
|
||||||
default = {};
|
default = {};
|
||||||
example = {my-android-phone = ["10.0.0.97"];};
|
example = {my-android-phone = ["10.0.0.97"];};
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
Allows defining an extra set of peers that should be added to this wireguard network,
|
Allows defining an extra set of peers that should be added to this wireguard network,
|
||||||
but will not be managed by this flake. (e.g. phones)
|
but will not be managed by this flake. (e.g. phones)
|
||||||
|
|
||||||
|
@ -295,7 +294,7 @@ in {
|
||||||
type = types.listOf types.net.cidr;
|
type = types.listOf types.net.cidr;
|
||||||
default = [];
|
default = [];
|
||||||
example = ["10.0.0.1/24" "fd00:cafe::/64"];
|
example = ["10.0.0.1/24" "fd00:cafe::/64"];
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
Allows defining extra cidr network ranges that shall be reserved for this network.
|
Allows defining extra cidr network ranges that shall be reserved for this network.
|
||||||
Reservation means that those address spaces will be guaranteed to be included in
|
Reservation means that those address spaces will be guaranteed to be included in
|
||||||
the spanned network, but no rules will be enforced as to who in the network may use them.
|
the spanned network, but no rules will be enforced as to who in the network may use them.
|
||||||
|
@ -312,7 +311,7 @@ in {
|
||||||
via = mkOption {
|
via = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
The server node via which to connect to the network.
|
The server node via which to connect to the network.
|
||||||
No client functionality will be activated if set to null.
|
No client functionality will be activated if set to null.
|
||||||
'';
|
'';
|
||||||
|
@ -321,27 +320,27 @@ in {
|
||||||
keepalive = mkOption {
|
keepalive = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
description = mdDoc "Whether to keep this connection alive using PersistentKeepalive. Set to false only for networks where client and server IPs are stable.";
|
description = "Whether to keep this connection alive using PersistentKeepalive. Set to false only for networks where client and server IPs are stable.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
priority = mkOption {
|
priority = mkOption {
|
||||||
default = 40;
|
default = 40;
|
||||||
type = types.int;
|
type = types.int;
|
||||||
description = mdDoc "The order priority used when creating systemd netdev and network files.";
|
description = "The order priority used when creating systemd netdev and network files.";
|
||||||
};
|
};
|
||||||
|
|
||||||
linkName = mkOption {
|
linkName = mkOption {
|
||||||
default = name;
|
default = name;
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = mdDoc "The name for the created network interface.";
|
description = "The name for the created network interface.";
|
||||||
};
|
};
|
||||||
|
|
||||||
unitConfName = mkOption {
|
unitConfName = mkOption {
|
||||||
default = "${toString config.priority}-${config.linkName}";
|
default = "${toString config.priority}-${config.linkName}";
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
The name used for unit configuration files. This is a read-only option.
|
The name used for unit configuration files. This is a read-only option.
|
||||||
Access this if you want to add additional settings to the generated systemd units.
|
Access this if you want to add additional settings to the generated systemd units.
|
||||||
'';
|
'';
|
||||||
|
@ -350,7 +349,7 @@ in {
|
||||||
ipv4 = mkOption {
|
ipv4 = mkOption {
|
||||||
type = types.lazyOf types.net.ipv4;
|
type = types.lazyOf types.net.ipv4;
|
||||||
default = types.lazyValue (wireguard name).assignedIpv4Addresses.${nodeName};
|
default = types.lazyValue (wireguard name).assignedIpv4Addresses.${nodeName};
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
The ipv4 address for this machine. If you do not set this explicitly,
|
The ipv4 address for this machine. If you do not set this explicitly,
|
||||||
a semi-stable ipv4 address will be derived automatically based on the
|
a semi-stable ipv4 address will be derived automatically based on the
|
||||||
hostname of this machine. At least one participating server must reserve
|
hostname of this machine. At least one participating server must reserve
|
||||||
|
@ -362,7 +361,7 @@ in {
|
||||||
ipv6 = mkOption {
|
ipv6 = mkOption {
|
||||||
type = types.lazyOf types.net.ipv6;
|
type = types.lazyOf types.net.ipv6;
|
||||||
default = types.lazyValue (wireguard name).assignedIpv6Addresses.${nodeName};
|
default = types.lazyValue (wireguard name).assignedIpv6Addresses.${nodeName};
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
The ipv6 address for this machine. If you do not set this explicitly,
|
The ipv6 address for this machine. If you do not set this explicitly,
|
||||||
a semi-stable ipv6 address will be derived automatically based on the
|
a semi-stable ipv6 address will be derived automatically based on the
|
||||||
hostname of this machine. At least one participating server must reserve
|
hostname of this machine. At least one participating server must reserve
|
||||||
|
@ -377,7 +376,7 @@ in {
|
||||||
(head options.ipv4.definitions)
|
(head options.ipv4.definitions)
|
||||||
(head options.ipv6.definitions)
|
(head options.ipv6.definitions)
|
||||||
];
|
];
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
The ip addresses (v4 and/or v6) to use for this machine.
|
The ip addresses (v4 and/or v6) to use for this machine.
|
||||||
The actual network cidr will automatically be derived from all network participants.
|
The actual network cidr will automatically be derived from all network participants.
|
||||||
By default this will just include {option}`ipv4` and {option}`ipv6` as configured.
|
By default this will just include {option}`ipv4` and {option}`ipv6` as configured.
|
||||||
|
@ -394,7 +393,7 @@ in {
|
||||||
type = types.listOf types.net.cidr;
|
type = types.listOf types.net.cidr;
|
||||||
default = [];
|
default = [];
|
||||||
example = ["0.0.0.0/0"];
|
example = ["0.0.0.0/0"];
|
||||||
description = mdDoc ''
|
description = ''
|
||||||
Additional networks that are accessible through this machine. This will allow
|
Additional networks that are accessible through this machine. This will allow
|
||||||
other participants of the network to access these networks through the tunnel.
|
other participants of the network to access these networks through the tunnel.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue