2024-02-26 21:06:48 -08:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
|
|
with lib; {
|
2023-10-09 10:44:07 -07:00
|
|
|
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
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
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;
|
2024-03-08 20:14:20 -08:00
|
|
|
writefreely = 61116;
|
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
|
|
|
'';
|
|
|
|
|
};
|
2024-03-03 00:11:51 -08:00
|
|
|
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.
|
|
|
|
|
'';
|
|
|
|
|
};
|
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.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
sopsFile = mkOption {
|
|
|
|
|
type = types.path;
|
|
|
|
|
default = ./secrets.yaml;
|
|
|
|
|
description = ''
|
|
|
|
|
The secrets file for device.
|
|
|
|
|
'';
|
|
|
|
|
};
|
2024-03-03 00:11:51 -08:00
|
|
|
syncthingDevices = mkOption {
|
|
|
|
|
type = types.attrsOf (types.attrsOf types.str);
|
|
|
|
|
default = {
|
|
|
|
|
blitzar.id = "KGCBCIZ-GG6KMQ2-FLK5BWW-GLCEDML-5LCI24S-UKO5UWL-HWNCPYX-ZWWD5AQ";
|
|
|
|
|
nebula.id = "NJXA5XS-2PSWECD-UHBV7JH-IR2RSWY-PRUPFTZ-AHL7IN6-RXSLZKB-2FUNRQH";
|
2024-03-17 12:40:09 -07:00
|
|
|
protostar.id = "RQBGBAP-TI2VGMA-IO6OOAC-5KDJJKC-5NH2HNW-VAKLHMS-2YCRRQU-QKXFXQM";
|
2024-03-03 00:11:51 -08:00
|
|
|
};
|
|
|
|
|
description = ''
|
|
|
|
|
The device information for syncthing
|
|
|
|
|
'';
|
|
|
|
|
};
|
2023-10-09 10:44:07 -07:00
|
|
|
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
|
|
|
'';
|
|
|
|
|
};
|
2024-03-03 00:11:51 -08:00
|
|
|
wildcard = mkOption {
|
|
|
|
|
type = types.str;
|
|
|
|
|
default = "0.0.0.0";
|
|
|
|
|
description = ''
|
|
|
|
|
The localhost address.
|
|
|
|
|
'';
|
|
|
|
|
};
|
2023-10-09 10:44:07 -07:00
|
|
|
};
|
|
|
|
|
}
|