How to reference declared variable in application config?

Hello, using NixOS Unstable with Flakes/Home-Manager

I am trying to set some variable so abstract some of the configuration between programs. Setting the variables seems simple enough, that is no problem and I have ECHO’d to confirm they are working.

However, when I set my variable as a binding in Hyprland for example I am not having any luck. This is probably a simple problem to solve but I can’t find the proper information.

I have it set as such in home.nix

  home = {
    username = "cmde";
    homeDirectory = "/home/cmde";
    stateVersion = "23.11";
  
    sessionPath = [ "~/.env" ];
    sessionVariables = {
    EDITOR = "hx";

    MOD = "SUPER";

    LEFT  = "n";
    DOWN  = "e";
    UP    = "i";
    RIGHT = "o";
    };
  
  };

and the offending line in hyprland.nix

    "$MOD, $RIGHT, layoutmsg, cyclenext"

Is there some syntax I need to use to delimiter or import the variables manually somehow? Thanks in advance.

Nix cannot read environment variables at build time. The variables won’t be set until the configuration is already running.

Either set the variables in a custom option to use them during the build, or use whatever functionality hyprland has to read environment variables when it’s running.