2023-10-09 10:44:07 -07:00
|
|
|
{ config, lib, ... }: with lib; {
|
|
|
|
|
options.constants = {
|
|
|
|
|
domain = mkOption {
|
|
|
|
|
type = types.str;
|
|
|
|
|
default = "invariantspace.com";
|
|
|
|
|
description = ''
|
2023-11-27 13:19:16 -08:00
|
|
|
The domain for all devices.
|
2023-10-09 10:44:07 -07:00
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
homeDir = mkOption {
|
|
|
|
|
type = types.str;
|
|
|
|
|
default = "/home/${config.constants.userName}";
|
|
|
|
|
description = ''
|
2023-11-27 13:19:16 -08:00
|
|
|
The home directory for the default user.
|
2023-10-09 10:44:07 -07:00
|
|
|
'';
|
|
|
|
|
};
|
2023-12-06 23:34:51 -08:00
|
|
|
wildcard = mkOption {
|
2023-12-06 21:46:16 -08:00
|
|
|
type = types.str;
|
2023-12-06 23:34:51 -08:00
|
|
|
default = "0.0.0.0";
|
2023-12-06 21:46:16 -08:00
|
|
|
description = ''
|
|
|
|
|
The localhost address.
|
|
|
|
|
'';
|
|
|
|
|
};
|
2023-10-09 10:44:07 -07:00
|
|
|
localhost = mkOption {
|
|
|
|
|
type = types.str;
|
|
|
|
|
default = "127.0.0.1";
|
|
|
|
|
description = ''
|
2023-11-27 13:19:16 -08:00
|
|
|
The localhost address.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
port = mkOption {
|
|
|
|
|
type = types.attrsOf types.port;
|
|
|
|
|
default = {
|
2023-12-06 21:46:16 -08:00
|
|
|
conduit = 29800;
|
|
|
|
|
forgejo = 47674;
|
|
|
|
|
headscale = 27327;
|
2023-11-27 13:19:16 -08:00
|
|
|
http = 80;
|
|
|
|
|
https = 443;
|
|
|
|
|
jellyfin = 8096;
|
2024-01-31 11:06:40 -08:00
|
|
|
vault = 25487;
|
2023-11-27 13:19:16 -08:00
|
|
|
};
|
|
|
|
|
description = ''
|
|
|
|
|
The mapping from service to ports.
|
2023-10-09 10:44:07 -07:00
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
postMaster = mkOption {
|
|
|
|
|
type = types.str;
|
|
|
|
|
default = "trivial@${config.constants.domain}";
|
|
|
|
|
description = ''
|
2023-11-27 13:19:16 -08:00
|
|
|
The post master email address.
|
2023-10-09 10:44:07 -07:00
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
publicKeys = mkOption {
|
|
|
|
|
type = types.listOf types.str;
|
|
|
|
|
default = [
|
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHPT/zRq5fffcUmjxcwG2cTr09fOa9O4rBUb6ob2CyNy macronova@blitzar"
|
|
|
|
|
];
|
|
|
|
|
description = ''
|
|
|
|
|
The public keys for SSH authentication.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
privateKeyFiles = mkOption {
|
|
|
|
|
type = types.listOf types.str;
|
|
|
|
|
default = if config.services.openssh.enable then builtins.map (key: key.path) config.services.openssh.hostKeys else [ "/root/.ssh/${config.networking.hostName}" ];
|
|
|
|
|
description = ''
|
|
|
|
|
The private key files for sops.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
sopsFile = mkOption {
|
|
|
|
|
type = types.path;
|
|
|
|
|
default = ./secrets.yaml;
|
|
|
|
|
description = ''
|
|
|
|
|
The secrets file for device.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
userName = mkOption {
|
|
|
|
|
type = types.str;
|
|
|
|
|
default = "macronova";
|
|
|
|
|
description = ''
|
2023-11-27 13:19:16 -08:00
|
|
|
The username across all devices.
|
2023-10-09 10:44:07 -07:00
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|