feat: roughly set up virtual aliases to use.

Will need to see if I cna get the idea merged in upstream.

Closes https://gitlab.skynet.ie/compsoc1/skynet/nixos/-/issues/22
This commit is contained in:
silver 2023-10-09 17:53:22 +01:00
parent 78ab6de860
commit bece34b65e
3 changed files with 88 additions and 6 deletions

View file

@ -15,12 +15,20 @@ with lib; let
# thought you could escape racket?
create_filter = groups: create_filter_join (create_filter_array groups);
create_skynet_email = accounts: (map (account: "${account}@skynet.ie") accounts);
create_skynet_email_admin = create_skynet_email config.users.admin;
create_skynet_email_committee = create_skynet_email config.users.committee;
in {
imports = [
./dns.nix
./acme.nix
./nginx.nix
inputs.simple-nixos-mailserver.nixosModule
# for teh config
../config/users.nix
];
options.services.skynet_email = {
@ -226,6 +234,77 @@ in {
cfg.domain
];
extraVirtualAliases = {
"abuse@skynet.ie" =
[
"abuse_int@skynet.ie"
]
++ create_skynet_email_admin;
"accounts@skynet.ie" =
[
"accounts_int@skynet.ie"
]
++ create_skynet_email_committee;
"compsoc@skynet.ie" =
[
"compsoc_int@skynet.ie"
]
++ create_skynet_email_committee;
"contact@skynet.ie" =
[
"contact_int@skynet.ie"
]
++ create_skynet_email_committee;
"dbadmin@skynet.ie" =
[
"dbadmin_int@skynet.ie"
]
++ create_skynet_email_admin;
"dnsadm@skynet.ie" =
[
"dnsadm_int@skynet.ie"
]
++ create_skynet_email_admin;
"hostmaster@skynet.ie" =
[
"hostmaster_int@skynet.ie"
]
++ create_skynet_email_admin;
"intersocsrep@skynet.ie" =
[
"intersocsrep_int@skynet.ie"
]
++ create_skynet_email_committee;
"mailman@skynet.ie" =
[
"mailman_int@skynet.ie"
]
++ create_skynet_email_admin;
"security@skynet.ie" =
[
"security_int@skynet.ie"
]
++ create_skynet_email_admin;
"sysadm@skynet.ie" =
[
"sysadm_int@skynet.ie"
]
++ create_skynet_email_admin;
"webadmin@skynet.ie" =
[
"webadmin_int@skynet.ie"
]
++ create_skynet_email_admin;
};
# use the letsencrypt certs
certificateScheme = "acme";

View file

@ -634,15 +634,17 @@
"utils": "utils_3"
},
"locked": {
"lastModified": 1689976554,
"narHash": "sha256-uWJq3sIhkqfzPmfB2RWd5XFVooGFfSuJH9ER/r302xQ=",
"owner": "simple-nixos-mailserver",
"host": "gitlab.skynet.ie",
"lastModified": 1696865182,
"narHash": "sha256-zyUUOA+RiwRjLP6+zi80p5pqftYK3+9yIN5wQ9VlGkw=",
"owner": "compsoc1%2Fskynet%2Fmisc",
"repo": "nixos-mailserver",
"rev": "c63f6e7b053c18325194ff0e274dba44e8d2271e",
"rev": "14007ae0eaeba4cc0235135f872122e398f09040",
"type": "gitlab"
},
"original": {
"owner": "simple-nixos-mailserver",
"host": "gitlab.skynet.ie",
"owner": "compsoc1%2Fskynet%2Fmisc",
"repo": "nixos-mailserver",
"type": "gitlab"
}

View file

@ -17,7 +17,8 @@
};
# email
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
# simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
simple-nixos-mailserver.url = "gitlab:compsoc1%2Fskynet%2Fmisc/nixos-mailserver?host=gitlab.skynet.ie";
# account.skynet.ie
skynet_ldap_backend.url = "gitlab:compsoc1%2Fskynet%2Fldap/backend?host=gitlab.skynet.ie";