nixos-config/common/constants.nix
2023-11-27 13:19:16 -08:00

75 lines
1.9 KiB
Nix

{ config, lib, ... }: with lib; {
options.constants = {
domain = mkOption {
type = types.str;
default = "invariantspace.com";
description = ''
The domain for all devices.
'';
};
homeDir = mkOption {
type = types.str;
default = "/home/${config.constants.userName}";
description = ''
The home directory for the default user.
'';
};
localhost = mkOption {
type = types.str;
default = "127.0.0.1";
description = ''
The localhost address.
'';
};
port = mkOption {
type = types.attrsOf types.port;
default = {
http = 80;
https = 443;
jellyfin = 8096;
wireguard-server = 45556;
xray = 50051;
};
description = ''
The mapping from service to ports.
'';
};
postMaster = mkOption {
type = types.str;
default = "trivial@${config.constants.domain}";
description = ''
The post master email address.
'';
};
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 = ''
The username across all devices.
'';
};
};
}