Clean branch

This commit is contained in:
Invariantspace 2023-10-09 10:44:07 -07:00
commit de986accc2
42 changed files with 1959 additions and 0 deletions

62
common/constants.nix Normal file
View file

@ -0,0 +1,62 @@
{ config, lib, ... }: with lib; {
options.constants = {
domain = mkOption {
type = types.str;
default = "invariantspace.com";
description = ''
Store the default domain for all devices.
'';
};
homeDir = mkOption {
type = types.str;
default = "/home/${config.constants.userName}";
description = ''
The default home directory for the default user.
'';
};
localhost = mkOption {
type = types.str;
default = "127.0.0.1";
description = ''
Store the default localhost address.
'';
};
postMaster = mkOption {
type = types.str;
default = "trivial@${config.constants.domain}";
description = ''
Store the default 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 default username across all devices.
'';
};
};
}