OS Detection in home-manager - home.homeDirectory

Hi there,

Is there a way to do OS detection in home.nix

# On Darwin
  home.homeDirectory = "/Users/kmf/";

# On Linux
  home.homeDirectory = "/home/kmf";
{pkgs, ...}:

{
  home.homeDirectory = if pkgs.stdenv.isDarwin then "/Users/kmf" else "/home/kmf";
}
3 Likes