NixOS deployment for LinuxLab
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
1.9 KiB

2 weeks ago
  1. { pkgs, lib, config, ... }:
  2. with lib;
  3. let
  4. baseDN = concatMapStringsSep ","
  5. (part: "dc=${part}")
  6. (splitString "." "informatik.hs-fulda.de");
  7. in
  8. {
  9. security.pam.services = {
  10. sshd = {
  11. makeHomeDir = true;
  12. sssdStrictAccess = true;
  13. unixAuth = lib.mkForce true;
  14. };
  15. login = {
  16. makeHomeDir = true;
  17. sssdStrictAccess = true;
  18. unixAuth = lib.mkForce true;
  19. };
  20. systemd-user = {
  21. makeHomeDir = true;
  22. sssdStrictAccess = true;
  23. unixAuth = lib.mkForce true;
  24. };
  25. };
  26. services.sssd = {
  27. enable = true;
  28. config = ''
  29. [sssd]
  30. config_file_version = 2
  31. services = nss, pam, ssh, ifp
  32. domains = hsfd
  33. debug_level = 8
  34. [nss]
  35. override_homedir = /home/%u
  36. override_shell = /run/current-system/sw/bin/bash
  37. filter_users = root
  38. filter_groups = root
  39. reconnection_retries = 3
  40. [pam]
  41. [domain/hsfd]
  42. id_provider = ldap
  43. access_provider = ldap
  44. auth_provider = ldap
  45. # TODO: ldap_uri = ldaps://ldap${config.networking.domain}/
  46. ldap_uri = ldaps://ldap-linuxlab.informatik.hs-fulda.de/
  47. ldap_search_base = ou=users,${baseDN}
  48. ldap_tls_reqcert = demand
  49. ldap_id_use_start_tls = true
  50. ldap_default_bind_dn = cn=login,dc=informatik,dc=hs-fulda,dc=de
  51. ldap_default_authtok_type = password
  52. ldap_default_authtok = TXyk&6G?Ta/B[DZ2^g'KmpUw
  53. ldap_access_order = filter
  54. ldap_access_filter = (objectClass=*)
  55. ldap_user_object_class = posixAccount
  56. ldap_user_name = cn
  57. override_gid = ${toString config.users.groups."users".gid}
  58. cache_credentials = true
  59. min_id = 1000
  60. enumerate = false
  61. '';
  62. };
  63. users.users."root".packages = with pkgs; [
  64. sss-cli
  65. ];
  66. #sops.secrets."ldap/login/password" = {
  67. # owner = "nslcd";
  68. # sopsFile = ./secrets.yaml;
  69. #};
  70. }