ITADN

[Feature Request] nssSystemd wrapper for non-NixOS systemd-homed users

#9399Opensauyon 创建于 2026-05-29
feature request
S
sauyoncommented
### Module Name - ### Requested Feature A wrapper helper under `targets.genericLinux`, modeled on `targets.genericLinux.nixGL`: - Option `targets.genericLinux.nssSystemd.libraryPath` — string, default `/usr/lib/libnss_systemd.so.2`. - Helper `config.lib.nssSystemd.wrap drv` — returns `drv` with its binaries able to `dlopen` the host's `libnss_systemd.so.2`. ```nix services.emacs.package = config.lib.nssSystemd.wrap pkgs.emacs; ``` ### Current Limitations Nix's bundled glibc ships no `libnss_systemd.so.2` and only searches the nix store for NSS plugins. On a non-NixOS host where the current user is resolved via `systemd-homed` or `systemd`'s userdb (anyone not in `/etc/passwd`), `getpwnam`/`getpwuid` from any nix-built binary fails. Concretely, on Arch + nix + a systemd-homed user, emacs aborts initialization with `Error (initialization): User <name> has no home directory` and `init.el` never loads; xdg-desktop-portal, gpg-agent, and others degrade similarly. ### Additional Context I have a working implementation locally and will happily clean it up into a PR if this shape looks right.
0 条评论