feat: Dynamic templating

This commit is contained in:
Inex Code
2024-12-18 15:40:15 +03:00
parent 7b69b39bff
commit cca51699ee
36 changed files with 802 additions and 43 deletions

View File

@@ -14,6 +14,27 @@
};
configPathsNeeded =
builtins.fromJSON (builtins.readFile ./config-paths-needed.json);
meta = { lib, ... }: {
spModuleVersion = 1;
id = "simple-nixos-mailserver";
name = "Mail Server";
description = "E-Mail for company and family.";
svgIcon = builtins.readFile ./icon.svg;
isMovable = true;
isRequired = true;
canBeBackedUp = true;
backupDescription = "Mail boxes and filters.";
systemdServices = [
"dovecot2.service"
"postfix.service"
];
user = "virtualMail";
folders = [
"/var/vmail"
"/var/sieve"
];
supportLevel = "normal";
};
# TODO generate json docs from module? something like:
# nix eval --impure --expr 'let flake = builtins.getFlake (builtins.toPath ./.); pkgs = flake.inputs.mailserver.inputs.nixpkgs.legacyPackages.x86_64-linux; in (pkgs.nixosOptionsDoc { inherit (pkgs.lib.evalModules { modules = [ flake.nixosModules.default ]; }) options; }).optionsJSON'