From 33af9948e51d769f95298aa3f7a64598b6d9ffd5 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 4 Jan 2018 11:59:58 +0100 Subject: [PATCH] home-environment: describe session variable trickyness --- modules/home-environment.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/home-environment.nix b/modules/home-environment.nix index f2936415..61ca0649 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -127,6 +127,25 @@ in example = { EDITOR = "emacs"; GS_OPTIONS = "-sPAPERSIZE=a4"; }; description = '' Environment variables to always set at login. + + Note, these variables may be set in any order so no session + variable may have a runtime dependency on another session + variable. In particular code like + + home.sessionVariables = { + FOO = "Hello"; + BAR = "$FOO World!"; + }; + + may not work as expected. If you need to reference another + session variable, then do so inside Nix instead. The above + example then becomes + + home.sessionVariables = { + FOO = "Hello"; + BAR = "''${config.home.sessionVariables.FOO} World!"; + }; + ''; };