NixOS configuration for HPC cluster https://docs.hpc.informatik.hs-fulda.de/
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.

59 lines
1.3 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. { pkgs, lib, config, ... }:
  2. with lib;
  3. let
  4. baseDN = concatMapStringsSep ","
  5. (part: "dc=${part}")
  6. (splitString "." config.networking.domain);
  7. in
  8. {
  9. users.mutableUsers = false;
  10. users.users."root" = {
  11. hashedPassword = "$y$j9T$tz8ojZ2gVOQ5AUp6GMhoj.$mAeE0eTGGsKNGddC7ebk/zFr5IMDyIpOpMP/6o.GI6D";
  12. openssh.authorizedKeys.keys = [
  13. "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK2nkarN0+uSuP5sGwDCb9KRu+FCjO/+da4VypGanPUZ fooker@k-2so"
  14. ];
  15. };
  16. users.ldap = {
  17. enable = true;
  18. useTLS = true;
  19. server = "ldaps://ldap.${config.networking.domain}/";
  20. base = "ou=users,${baseDN}";
  21. daemon.enable = true;
  22. bind = {
  23. distinguishedName = "cn=login,${baseDN}";
  24. passwordFile = config.sops.secrets."ldap/login/password".path;
  25. };
  26. };
  27. users.groups."cluster" = {
  28. gid = 1000; # Fixed, becaused it is used for LDAP users
  29. };
  30. security.pam.services."login".makeHomeDir = true;
  31. security.pam.services."sshd".makeHomeDir = true;
  32. security.pam.services."systemd-user".makeHomeDir = true;
  33. security.pam.loginLimits = [
  34. {
  35. domain = "@cluster";
  36. item = "memlock";
  37. type = "-";
  38. value = "unlimited";
  39. }
  40. ];
  41. sops.secrets."ldap/login/password" = {
  42. owner = "nslcd";
  43. sopsFile = ./secrets.yaml;
  44. };
  45. }