Commit 87f1d200a96a

Vincent Demeester <vincent@sbr.pm>
2026-06-10 14:58:55
feat(aomi): add unscd service for nix NSS/LDAP user resolution
Run unscd from nix with LD_LIBRARY_PATH pointing to system NSS libs so it can load libnss_sss.so. Creates /var/run/nscd/socket that nix glibc queries automatically, fixing user resolution for all nix-built programs (emacs, git, etc.) on Fedora CSB with SSSD/LDAP.
1 parent 1fe7b0d
Changed files (2)
systems/aomi/home.nix
@@ -23,6 +23,7 @@
 
   home.sessionVariables = {
     PASSAGE_IDENTITIES_FILE = pkgs.lib.mkForce "${config.home.homeDirectory}/.ssh/id_ed25519";
+
   };
 
   home.packages = with pkgs; [
systems/aomi/system.nix
@@ -59,6 +59,23 @@ in
       mode = "0644";
     };
 
+    # nscd for nix NSS resolution
+    # Nix glibc can't load system NSS modules (libnss_sss.so) but queries
+    # nscd's socket at /var/run/nscd/socket automatically.
+    # We run unscd from nix with LD_LIBRARY_PATH pointing to system NSS
+    # libs so it can load libnss_sss.so and serve nix programs.
+    systemd.services.unscd = {
+      description = "Name Service Cache Daemon (unscd for nix)";
+      wantedBy = [ "system-manager.target" ];
+      after = [ "network.target" ];
+      serviceConfig = {
+        Type = "forking";
+        Environment = "LD_LIBRARY_PATH=/usr/lib64";
+        ExecStart = "${pkgs.unscd}/bin/nscd";
+        Restart = "on-failure";
+      };
+    };
+
     # Syncthing is managed by home-manager (user service with full folder config)
   };
 }