Networks aren't a function
This commit is contained in:
parent
409f341fbb
commit
5383cea338
|
@ -48,8 +48,8 @@ in {
|
||||||
createMountPoints = false;
|
createMountPoints = false;
|
||||||
exports = let
|
exports = let
|
||||||
exportList = [
|
exportList = [
|
||||||
"/export/documents 10.0.0.0/24 (rw,sync,root_squash,no_subtree_check,fsid=10,sec=krb5p)"
|
"/export/documents 10.0.0.0/24(rw,sync,no_root_squash,no_subtree_check,fsid=10,sec=krb5p)"
|
||||||
"/export/downloads 10.0.0.0/24 (rw,sync,root_squash,no_subtree_check,fsid=11,sec=krb5i)"
|
"/export/downloads 10.0.0.0/24(rw,sync,no_root_squash,no_subtree_check,fsid=11,sec=krb5i)"
|
||||||
];
|
];
|
||||||
in ''
|
in ''
|
||||||
${concatStringsSep "\n" exportList}
|
${concatStringsSep "\n" exportList}
|
||||||
|
@ -58,7 +58,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.nfs-server = {
|
systemd.services.nfs-server = {
|
||||||
# Don't start in on boot
|
# Don't start on boot
|
||||||
wantedBy = mkForce [ "sea-store.target" ];
|
wantedBy = mkForce [ "sea-store.target" ];
|
||||||
# Only start after filesystem mounts are available
|
# Only start after filesystem mounts are available
|
||||||
after = [ "export-documents.mount" "export-downloads.mount" ];
|
after = [ "export-documents.mount" "export-downloads.mount" ];
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
{
|
{
|
||||||
mx = [ "smtp.informis.land" ];
|
mx = [ "smtp.informis.land" ];
|
||||||
|
|
||||||
|
@ -11,16 +8,6 @@ with lib;
|
||||||
git = "procul.informis.land.";
|
git = "procul.informis.land.";
|
||||||
};
|
};
|
||||||
|
|
||||||
verbatim-dns-records = let
|
|
||||||
domain-name = config.fudo.hosts.${config.instance.hostname}.domain;
|
|
||||||
# NOTE: we're assuming IPv4...
|
|
||||||
domain-local-nets = map (network: "ip4:${network}") config.fudo.domains.${domain-name}.local-networks;
|
|
||||||
local-net-string = concatStringsSep " " domain-local-nets;
|
|
||||||
in [
|
|
||||||
''@ IN TXT "v=spf1 mx ${local-net-string} -all"''
|
|
||||||
''@ IN SPF "v=spf1 mx ${local-net-string} -all"''
|
|
||||||
];
|
|
||||||
|
|
||||||
srv-records = {
|
srv-records = {
|
||||||
tcp = {
|
tcp = {
|
||||||
domain = [{
|
domain = [{
|
||||||
|
|
|
@ -37,60 +37,45 @@ in {
|
||||||
fsType = "nfs4";
|
fsType = "nfs4";
|
||||||
options = [ "comment=systemd.automount" ];
|
options = [ "comment=systemd.automount" ];
|
||||||
};
|
};
|
||||||
# "/net/documents" = {
|
"/net/documents" = {
|
||||||
# device = "sea-store.${local-domain}:/export/documents";
|
device = "sea-store.${local-domain}:/export/documents";
|
||||||
# fsType = "nfs";
|
fsType = "nfs";
|
||||||
# options = [
|
options = [
|
||||||
# "nfsvers=4.2"
|
"nfsvers=4.2"
|
||||||
# "comment=systemd.automount"
|
"comment=systemd.automount"
|
||||||
# "sec=krb5p"
|
"sec=krb5p"
|
||||||
# # "noauto" ?
|
# "noauto" ?
|
||||||
# ];
|
];
|
||||||
# };
|
|
||||||
# "/net/downloads" = {
|
|
||||||
# device = "sea-store.${local-domain}:/export/downloads";
|
|
||||||
# fsType = "nfs";
|
|
||||||
# options = [
|
|
||||||
# "nfsvers=4.2"
|
|
||||||
# "comment=systemd.automount"
|
|
||||||
# "sec=krb5i"
|
|
||||||
# # "noauto" ?
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.mounts = [
|
|
||||||
{
|
|
||||||
what = "sea-store.sea.fudo.org:/export/documents";
|
|
||||||
where = "/net/documents";
|
|
||||||
type = "nfs4";
|
|
||||||
options = "sec=krb5p";
|
|
||||||
description = "sea-store documents on encrypted filesysem.";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
what = "sea-store.sea.fudo.org:/export/downloads";
|
|
||||||
where = "/net/downloads";
|
|
||||||
type = "nfs4";
|
|
||||||
options = "sec=krb5i";
|
|
||||||
description = "sea-store downloads on encrypted filesysem.";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
krb5 = {
|
|
||||||
domain_realm = {
|
|
||||||
"fudo.org" = "FUDO.ORG";
|
|
||||||
".fudo.org" = "FUDO.ORG";
|
|
||||||
"sea.fudo.org" = "FUDO.ORG";
|
|
||||||
".sea.fudo.org" = "FUDO.ORG";
|
|
||||||
};
|
};
|
||||||
realms = {
|
"/net/downloads" = {
|
||||||
"FUDO.ORG" = {
|
device = "sea-store.${local-domain}:/export/downloads";
|
||||||
admin_server = "france.fudo.org";
|
fsType = "nfs";
|
||||||
kdc = [ "france.fudo.org" ];
|
options = [
|
||||||
};
|
"nfsvers=4.2"
|
||||||
|
"comment=systemd.automount"
|
||||||
|
"sec=krb5i"
|
||||||
|
# "noauto" ?
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# systemd.mounts = [
|
||||||
|
# {
|
||||||
|
# what = "sea-store.sea.fudo.org:/export/documents";
|
||||||
|
# where = "/net/documents";
|
||||||
|
# type = "nfs4";
|
||||||
|
# options = "sec=krb5p";
|
||||||
|
# description = "sea-store documents on encrypted filesysem.";
|
||||||
|
# }
|
||||||
|
# {
|
||||||
|
# what = "sea-store.sea.fudo.org:/export/downloads";
|
||||||
|
# where = "/net/downloads";
|
||||||
|
# type = "nfs4";
|
||||||
|
# options = "sec=krb5i";
|
||||||
|
# description = "sea-store downloads on encrypted filesysem.";
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
|
|
||||||
services.printing = {
|
services.printing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
drivers = [
|
drivers = [
|
||||||
|
|
|
@ -10,4 +10,16 @@ in {
|
||||||
description = "A map of networks to network definitions.";
|
description = "A map of networks to network definitions.";
|
||||||
default = { };
|
default = { };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = let
|
||||||
|
domain-name = config.instance.local-domain;
|
||||||
|
local-networks = map (network: "ip4:${network}")
|
||||||
|
config.fudo.domains.${domain-name}.local-networks;
|
||||||
|
local-net-string = concatStringsSep " " domain-local-nets;
|
||||||
|
in {
|
||||||
|
fudo.networks.${domain-name}.verbatim-dns-records = [
|
||||||
|
''@ IN TXT "v=spf1 mx ${local-net-string} -all"''
|
||||||
|
''@ IN SPF "v=spf1 mx ${local-net-string} -all"''
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ in {
|
||||||
in {
|
in {
|
||||||
General = {
|
General = {
|
||||||
Verbosity = 10;
|
Verbosity = 10;
|
||||||
Domain = local-domain;
|
# Domain = local-domain;
|
||||||
"Local-Realms" = local-realm;
|
"Local-Realms" = local-realm;
|
||||||
};
|
};
|
||||||
Translation = {
|
Translation = {
|
||||||
|
|
Loading…
Reference in New Issue