ryantm
September 12, 2020, 9:51pm
1
Hello.
I use GNOME on NixOS, and I noticed that environment variables, like EDITOR, set by the NixOS option environment.variables
are present in my session’s environment. Is there a way to override these variables via user configuration?
I have tried these things:
systemd environment.d in ~/.config/environment.d/
~/.profile
This issue seems relevant and has some workarounds, but I’m wondering if there is an official way.
Sincerely,
Ryan Mulligan
Maybe not the answer you are looking for; but I’ve solved this with home-manager + NixOS combined.
I tend to make a users/
directory in my NixOS repository and it looks very similar to a home-manager repository.
{ config, pkgs, lib, ... }: {
imports = [
../../modules/users.nix
];
{ config, pkgs, ... }: {
users.extraUsers.fmzakari = {
# This automatically sets group to users, createHome to true,
# home to /home/username, useDefaultShell to true, and isSystemUser to false
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6rdr4W0yak9JO48bf4B342rl7+8iupOQXuCZMZaenbyOu/qgPth//5j3vm+1OlprfktywzXT5TbfgzzCdvZIkvA7Q6lUgLc6cohU5JXpfpvvMUtEtxMC6RnHBHsOrm9rxeUSdiA7X7ZvjlnBsxH3R9e4nTWYThX6mXkMOevdFIxSGlrtdCSZyysngd0J7Kb4WeR6WsF/PFO6b/b0ag6ovr0i4P9/76lCrsGa1/ee042B950H3iZtIfnU80Y98fk59/6ZD7zI13WtFvocAxBvlwwj3DmGAPnt6Pgc7Jgr89MEPMRGbIlxL+EiVX3/OjguA/giBv4k00FZdZV2zaK/264YKgcZYSpnWmrju56IKRjtScZrxitFcOMHUt0SKEL5wQ8mZ2bDWLUcLyvkLlocv0+2Qn4DivOPMSQDHYLmVIqIjWdgi5s+WzbQ0PW9xM2N7x7YfzSKo1HXmL/q9LvvjpiZ9cerXevpInrszDZJ2gwQ9nsiVr588XILT4YdQUAmJU4sZbXXQeeLQvVMTJZTNo0NplyPhOLwZHmd+UhL8fVJHvDgEpxP4soVbyfeUwTwJ8sRKPZKvZOuijkYwSa18rfoCNZFstqvAJ4h6AJJnE9APqMORlGQa82S0lC9xkMuPZR/mCJrgqzvM/jeymfSNdNjzAtuIQCIxaYX7tycNWw=="
];
description = "Farid Zakaria";
};
home-manager.users.fmzakari = import ../users/fmzakari;
}
# Place common home-manager setup here
{ config, pkgs, lib, ... }:
with lib; {
imports = [
./git
./zsh
./broot.nix
./direnv.nix
./fzf.nix
./tmux
./bat
./jrnl
./fonts.nix
];
options.home.email = mkOption {
type = types.str;
default = "farid.m.zakaria@gmail.com";
description = "The email to associate primarily with my user.";
This file has been truncated. show original
ryantm
September 13, 2020, 5:45pm
3
@fzakaria I don’t understand what your suggestion is.
2 Likes