Fixed sea-store:/export/projects, removed unnecesary submodules

This commit is contained in:
2021-10-29 11:40:43 -07:00
parent 08766dfeb6
commit 79b05be7d3
11 changed files with 66 additions and 165 deletions
+58 -26
View File
@@ -1,35 +1,34 @@
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, ... } @ toplevel:
with lib;
let
localCopyOpts = { copy, ... }: let
in {
options = with types; {
inherit domain;
user = mkOption {
type = str;
description = "User to which this copy belongs.";
};
# localCopyOpts = { copy, ... }: let
# in {
# options = with types; {
# user = mkOption {
# type = str;
# description = "User to which this copy belongs.";
# };
group = mkOption {
type = nullOr str;
description = "Group to which this copy belongs.";
default = null;
};
# group = mkOption {
# type = nullOr str;
# description = "Group to which this copy belongs.";
# default = null;
# };
path = mkOption {
type = str;
description = "Path at which to store the local copy.";
#default = "/var/run/${toplevel.config.domain}/${copy}";
};
# path = mkOption {
# type = str;
# description = "Path at which to store the local copy.";
# #default = "/var/run/${toplevel.config.domain}/${copy}";
# };
service = mkOption {
type = str;
description = "systemd job to copy certs.";
default = "fudo-${toplevel.config.domain}-${copy}-certs.service";
};
};
};
# service = mkOption {
# type = str;
# description = "systemd job to copy certs.";
# default = "fudo-${toplevel.config.domain}-${copy}-certs.service";
# };
# };
# };
domainOpts = { domain, ... }: {
options = with types; {
@@ -44,6 +43,39 @@ let
description = "List of domains to add to this certificate.";
default = [];
};
local-copies = let
localCopyOpts = { copy, ... }: {
options = with types; {
user = mkOption {
type = str;
description = "User to which this copy belongs.";
};
group = mkOption {
type = nullOr str;
description = "Group to which this copy belongs.";
default = null;
};
path = mkOption {
type = str;
description = "Path at which to store the local copy.";
default = "/var/run/${domain}/${copy}";
};
service = mkOption {
type = str;
description = "systemd job to copy certs.";
default = "fudo-${domain}-${copy}-certs.service";
};
};
};
in mkOption {
type = attrsOf (submodule localCopyOpts);
description = "Map of copies to make for use by services.";
default = {};
};
};
};
+7 -9
View File
@@ -19,8 +19,6 @@ let
};
};
site-copy = site: "ejabberd-${site}";
concatMapAttrs = f: attrs:
foldr (a: b: a // b) {} (mapAttrs f attrs);
@@ -30,7 +28,7 @@ let
host-domains = config.fudo.acme.host-domains.${hostname};
siteCerts = site: let
certPath = config.fudo.acme.local-copies.${site-copy site}.path;
certPath = host-domains.${site}.local-copies.ejabberd.path;
in [
"${certPath}/fullchain.pem"
"${certPath}/privkey.pem"
@@ -38,7 +36,7 @@ let
];
siteCertService = site:
config.fudo.acme.local-copies.${site-copy site}.service;
host-domains.${site}.local-copies.ejabberd.service;
config-file-template = let
jabber-config = {
@@ -158,13 +156,13 @@ in {
};
};
fudo.acme.local-copies = mapAttrs' (site: siteCfg:
nameValuePair (site-copy site)
mkif siteCfg.enableACME {
domain = site;
fudo.acme.host-domains.${hostname} = mapAttrs (site: siteCfg:
mkIf siteCfg.enableACME {
local-copies.ejabberd = {
user = cfg.user;
group = cfg.group;
}) cfg.sites;
};
}) cfg.sites;
systemd = {
tmpfiles.rules = [