updates / experimental TC setup
This commit is contained in:
@@ -36,10 +36,33 @@
|
||||
}: let
|
||||
cfg = config.az.tc;
|
||||
hostname = config.networking.hostName;
|
||||
domain = "az-group.local";
|
||||
realm = "AZ-GROUP";
|
||||
domain = cfg.ad.domain;
|
||||
realm = cfg.ad.realm;
|
||||
in {
|
||||
options.az.tc.ad = {
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "az-group.local";
|
||||
description = "Active Directory DNS domain.";
|
||||
};
|
||||
|
||||
realm = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "AZ-GROUP";
|
||||
description = "Kerberos realm.";
|
||||
};
|
||||
|
||||
domainControllers = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.submodule {
|
||||
options = {
|
||||
host = lib.mkOption {type = lib.types.str;};
|
||||
address = lib.mkOption {type = lib.types.str;};
|
||||
};
|
||||
});
|
||||
default = [];
|
||||
description = "AD domain controllers with bootstrap-safe IP addresses.";
|
||||
};
|
||||
|
||||
ou = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "OU=ThinClients,DC=az-group,DC=local";
|
||||
@@ -51,7 +74,13 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
config = lib.mkIf (cfg.enable && cfg.features.ad) {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.ad.domainControllers != [];
|
||||
message = "az.tc.features.ad requires az.tc.ad.domainControllers with host names and IP addresses.";
|
||||
}
|
||||
];
|
||||
environment.systemPackages = with pkgs; [
|
||||
adcli # AD computer-account precreate + join helper
|
||||
sssd # AD client daemon
|
||||
@@ -82,8 +111,8 @@ in {
|
||||
};
|
||||
realms = {
|
||||
"${realm}" = {
|
||||
kdc = ["az-dc01.az-group.local" "az-dc02.az-group.local"];
|
||||
admin_server = "az-dc01.az-group.local";
|
||||
kdc = map (dc: dc.host) cfg.ad.domainControllers;
|
||||
admin_server = (builtins.head cfg.ad.domainControllers).host;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -113,9 +142,9 @@ in {
|
||||
access_provider = ad
|
||||
chpass_provider = ad
|
||||
ad_domain = ${domain}
|
||||
ad_server = az-dc01.az-group.local, az-dc02.az-group.local
|
||||
ad_server = ${lib.concatMapStringsSep ", " (dc: dc.host) cfg.ad.domainControllers}
|
||||
krb5_realm = ${realm}
|
||||
krb5_server = az-dc01.az-group.local, az-dc02.az-group.local
|
||||
krb5_server = ${lib.concatMapStringsSep ", " (dc: dc.host) cfg.ad.domainControllers}
|
||||
krb5_keytab = /etc/krb5.keytab
|
||||
krb5_store_password_if_offline = True
|
||||
cache_credentials = True
|
||||
@@ -124,14 +153,14 @@ in {
|
||||
override_shell = /run/current-system/sw/bin/bash
|
||||
default_shell = /run/current-system/sw/bin/bash
|
||||
ad_gpo_access_control = permissive
|
||||
enumerate = true
|
||||
ldap_id_mapping = false
|
||||
enumerate = false
|
||||
ldap_id_mapping = true
|
||||
'';
|
||||
};
|
||||
|
||||
# DNS — Thin Clients use AD DCs as resolver (NetBird DNS overlays
|
||||
# for corp-VPN-only domains via systemd-resolved; see network/dns.nix)
|
||||
networking.nameservers = lib.mkDefault ["az-dc01.az-group.local" "az-dc02.az-group.local"];
|
||||
networking.nameservers = lib.mkDefault (map (dc: dc.address) cfg.ad.domainControllers);
|
||||
networking.domain = lib.mkDefault domain;
|
||||
networking.search = lib.mkDefault [domain];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user