Skip to content

Instantly share code, notes, and snippets.

@flokli
Last active October 13, 2022 20:19
Show Gist options
  • Save flokli/b1b0a1d2c0b7ba6e73101e1447812114 to your computer and use it in GitHub Desktop.
Save flokli/b1b0a1d2c0b7ba6e73101e1447812114 to your computer and use it in GitHub Desktop.
Snippet to include into your nixos configuration to run a nsncd (non-caching NSS daemon, written in Rust)
{ pkgs, lib, ... }:
let
nsncdPackage = pkgs.rustPlatform.buildRustPackage rec {
pname = "nsncd";
version = "unstable-2021-10-13";
src = pkgs.fetchFromGitHub {
owner = "flokli";
repo = "nsncd";
rev = "c9f7ba1cfe482200a8f722b5f7c3e9c5042fe1a8";
hash = "sha256-n6nDqNVBQQYmYsJ/a8lRxwKRR6kgpJhko5KrODLHFT8=";
};
cargoSha256 = "sha256-lBK5Q/+FAvxgTQEudbYOGKJGtw0Lx5UJgUP8GTjAqAs=";
# dumps tons of logs into the systemd journal in debug mode, drop line if running in a prod-like scenario
buildType = "debug";
};
in
{
systemd.services.nscd.serviceConfig.ExecStart = lib.mkForce "${nsncdPackage}/bin/nsncd";
systemd.services.nscd.serviceConfig.Type = lib.mkForce "notify";
systemd.services.nscd.serviceConfig.ExecReload = lib.mkForce [ ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment