Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Last active March 29, 2024 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cleverca22/282c960da95dd23b72150ca36ef3ff50 to your computer and use it in GitHub Desktop.
Save cleverca22/282c960da95dd23b72150ca36ef3ff50 to your computer and use it in GitHub Desktop.
environment variables
# nixos-rebuild build-vm -I nixos-config=./configuration.nix -Q -j8
{ ... }:
{
environment.variables.A = "1";
programs.bash.shellInit = "export B=2";
environment.extraInit = "export C=3";
environment.shellInit = "export D=4";
environment.loginShellInit = "export E=5";
environment.interactiveShellInit = "export F=6";
services.xserver = {
displayManager.lightdm.enable = true;
#windowManager.i3.enable = true;
#windowManager.default = "i3";
#desktopManager.default = "none";
desktopManager.xterm.enable = true;
enable = true;
};
services.nixosManual.enable = false;
users.users.root.password = "root";
users.users.clever = {
isNormalUser = true;
initialPassword = "clever";
};
}
. /nix/store/x13swbpz573bgk0b5lfiddhk3w6ipns7-set-environment
export D=4
export B=2
export E=5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment