nix-config/options.nix
2025-05-13 15:12:33 +02:00

339 lines
6.8 KiB
Nix

{
config,
lib,
...
}: let
inherit (lib) mkOption;
inherit (lib.types) nullOr attrsOf listOf enum str bool port;
inherit (config) conf;
inherit (config.conf) host;
in {
options = {
conf = {
host = mkOption {
type = nullOr (enum ["server" "laptop" "desktop" "phone"]);
default = null;
};
niri = {
enable = mkOption {
type = bool;
default = host == "laptop" || host == "desktop";
};
};
vm = {
enable = mkOption {
type = bool;
default = false;
};
};
containers = {
enable = mkOption {
type = bool;
default = false;
};
};
games = {
enable = mkOption {
type = bool;
default = false;
};
};
secureboot = {
enable = mkOption {
type = bool;
default = false;
};
};
extraLayout = {
enable = mkOption {
type = bool;
default = true;
};
};
fonts = {
enable = mkOption {
type = bool;
default = conf.host != "server";
};
};
networkmanager = {
enable = mkOption {
type = bool;
default = conf.host != "server";
};
};
yubikey = {
enable = mkOption {
type = bool;
default = conf.host != "server";
};
login = mkOption {
type = bool;
default = false;
};
};
ssh = {
enable = mkOption {
type = bool;
default = conf.host == "server";
};
};
nginx = {
enable = mkOption {
type = bool;
default = conf.host == "server";
};
domains = mkOption {
type = listOf str;
default = [];
};
email = mkOption {
type = nullOr str;
default = null;
};
};
email = {
enable = mkOption {
type = bool;
default = false;
};
domain = mkOption {
type = nullOr str;
default = null;
};
ports = {
smtp = mkOption {
type = port;
default = 25;
};
lmtp = mkOption {
type = port;
default = 24;
};
jmap = mkOption {
type = port;
default = 8080;
};
imap = mkOption {
type = port;
default = 143;
};
imaps = mkOption {
type = port;
default = 993;
};
submission = mkOption {
type = port;
default = 587;
};
submissions = mkOption {
type = port;
default = 465;
};
local = mkOption {
type = port;
default = 9000;
};
};
};
vikunja = {
enable = mkOption {
type = bool;
default = false;
};
domain = {
base = mkOption {
type = nullOr str;
default = null;
};
full = mkOption {
type = nullOr str;
default = null;
};
};
port = mkOption {
type = port;
default = 7070;
};
};
website = {
enable = mkOption {
type = bool;
default = false;
};
domain = {
full = mkOption {
type = nullOr str;
default = null;
};
base = mkOption {
type = nullOr str;
default = null;
};
me = mkOption {
type = nullOr str;
default = null;
};
};
};
fedi = {
enable = mkOption {
type = bool;
default = false;
};
iceshrimp = {
enable = mkOption {
type = bool;
default = false;
};
domain = {
full = mkOption {
type = nullOr str;
default = null;
};
base = mkOption {
type = nullOr str;
default = null;
};
};
};
domain = {
full = mkOption {
type = nullOr str;
default = null;
};
base = mkOption {
type = nullOr str;
default = null;
};
};
email = mkOption {
type = nullOr str;
default = null;
};
};
matrix = {
enable = mkOption {
type = bool;
default = false;
};
domain = {
full = mkOption {
type = nullOr str;
default = null;
};
base = mkOption {
type = nullOr str;
default = null;
};
};
email = mkOption {
type = nullOr str;
default = null;
};
port = mkOption {
type = port;
default = 6167;
};
element-web = {
enable = mkOption {
type = bool;
default = conf.matrix.enable;
};
domain = mkOption {
type = nullOr str;
default = null;
};
};
};
git = {
enable = mkOption {
type = bool;
default = false;
};
domain = {
full = mkOption {
type = nullOr str;
default = null;
};
base = mkOption {
type = nullOr str;
default = null;
};
};
};
username = mkOption {
type = str;
default = "twoneis";
};
stateVersion = mkOption {
type = nullOr str;
default = null;
};
hmStateVersion = mkOption {
type = nullOr str;
default = null;
};
keys = {
up = mkOption {
type = str;
default = "t";
};
down = mkOption {
type = str;
default = "n";
};
left = mkOption {
type = str;
default = "h";
};
right = mkOption {
type = str;
default = "s";
};
};
};
theme = mkOption {
type = attrsOf str;
default = {
base = "#191724";
surface = "#1f1d2e";
overlay = "#26233a";
muted = "#6e6a86";
subtle = "#908caa";
text = "#e0def4";
love = "#eb6f92";
gold = "#f6c177";
rose = "#ebbcba";
pine = "#31748f";
foam = "#9ccfd8";
iris = "#c4a7e7";
highlight-low = "#21202e";
highlight-med = "#403d52";
highlight-high = "#524f67";
};
};
};
}