How do I get chemgreek to use κ instead of ϰ with fontspec and newcomputermodern?

Ensure math mode. The text font has the “x-like” kappa.

\documentclass[]{article}
\usepackage{newcomputermodern}
\usepackage{chemmacros}
\usepackage{chemgreek}

\selectchemgreekmapping{fontspec}
\changechemgreeksymbol{fontspec}{lower}{kappa}{\ensuremath{κ}}
\selectchemgreekmapping{fontspec}

\chemsetup{formula=chemformula}

\begin{document}
Math mode: 
\( 
    \chemalpha
    \chembeta
    \chemeta
    \chemkappa
    \chemmu
\)

Text mode: 
    \chemalpha
    \chembeta
    \chemeta
    \chemkappa
    \chemmu 

ch: 
    \ch{\dento{1}\bridge{1}\hapto{1}}

Text: 
    \dento{1}\bridge{1}\hapto{1}
\end{document}

enter image description here


One tweak to the excellent answer by @egreg: \ensuremath{κ} will give you a slanted κ, and you want an upright κ to match your other symbols. Therefore, load \ensuremath{\symup{\kappa}} in unicode-math. (With some other packages, you might want \upkappa or \kappaup.)

\documentclass{article}
\usepackage{newcomputermodern}
\usepackage{chemgreek}
\changechemgreeksymbol{fontspec}{lower}{kappa}{\ensuremath{\symup{\kappa}}}
\selectchemgreekmapping{fontspec}

\usepackage{chemmacros}
\chemsetup{formula=chemformula}

\begin{document}
Math mode: 
\( 
    \chemalpha
    \chembeta
    \chemeta
    \chemkappa
    \chemmu
\)

Text mode: 
    \chemalpha
    \chembeta
    \chemeta
    \chemkappa
    \chemmu 

ch: 
    \ch{\dento{1}\bridge{1}\hapto{1}}

Text: 
    \dento{1}\bridge{1}\hapto{1}
\end{document}

New Computer Modern sample