Self-host your own digital island

add enable options to hosting modules

Changed files
+10 -10
modules
+2 -2
modules/hosting/dns.nix
···
let cfg = config.hosting; in
{
-
options.hosting.dns = lib.mkEnableOption "dns";
+
options.hosting.dns.enable = lib.mkEnableOption "dns";
-
config.dns = lib.mkIf cfg.dns {
+
config.dns = lib.mkIf cfg.dns.enable {
enable = true;
soa.serial = 2018011623;
records = builtins.concatMap (ns: [
+2 -2
modules/hosting/gitea.nix
···
cfg = config.hosting;
domain = config.networking.domain;
in {
-
options.hosting.gitea = lib.mkEnableOption "gitea";
+
options.hosting.gitea.enable = lib.mkEnableOption "gitea";
-
config = lib.mkIf cfg.gitea {
+
config = lib.mkIf cfg.gitea.enable {
services.nginx = {
recommendedProxySettings = true;
virtualHosts."git.${domain}" = {
+2 -2
modules/hosting/mailserver.nix
···
cfg = config.hosting;
domain = config.networking.domain;
in {
-
options.hosting.mailserver = lib.mkEnableOption "mailserver";
+
options.hosting.mailserver.enable = lib.mkEnableOption "mailserver";
-
config = lib.mkIf cfg.mailserver {
+
config = lib.mkIf cfg.mailserver.enable {
mailserver = {
enable = true;
fqdn = "mail.${domain}";
+2 -2
modules/hosting/mastodon.nix
···
cfg = config.hosting;
domain = config.networking.domain;
in {
-
options.hosting.mastodon = lib.mkEnableOption "mastodon";
+
options.hosting.mastodon.enable = lib.mkEnableOption "mastodon";
-
config = lib.mkIf cfg.mastodon {
+
config = lib.mkIf cfg.mastodon.enable {
services.mastodon = {
enable = true;
enableUnixSocket = false;
+2 -2
modules/hosting/matrix.nix
···
let cfg = config.hosting; in
{
-
options.hosting.matrix = lib.mkEnableOption "matrix";
+
options.hosting.matrix.enable = lib.mkEnableOption "matrix";
-
config = lib.mkIf cfg.matrix {
+
config = lib.mkIf cfg.matrix.enable {
services.postgresql.enable = true;
services.postgresql.package = pkgs.postgresql_13;
services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" ''