I decided to go with the simpler solution of using `~/.profile`, as that is the only option that will ensure that the environment will be set correctly. If you launch a more barebones compositor such as Hyprland from your tty, since it won't be launched by systemd it will not inherit the environment.
39 lines
844 B
Nix
39 lines
844 B
Nix
{
|
|
inputs,
|
|
lib,
|
|
config,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf;
|
|
inherit (lib.lists) singleton;
|
|
inherit (lib.filesystem) listFilesRecursive;
|
|
inherit (config.local.systemVars) username;
|
|
inherit (config.local.homeVars) fullName;
|
|
inherit (config.local.profiles) desktop;
|
|
in {
|
|
imports = [inputs.hjem.nixosModules.default];
|
|
users.users.${username} = {
|
|
isNormalUser = true;
|
|
description = fullName;
|
|
extraGroups = mkIf desktop.enable [
|
|
"networkmanager"
|
|
"audio"
|
|
"video"
|
|
"wheel"
|
|
"plugdev"
|
|
];
|
|
};
|
|
|
|
hjem = mkIf desktop.enable {
|
|
clobberByDefault = true;
|
|
users.${username} = {
|
|
enable = true;
|
|
directory = "/home/${username}";
|
|
user = "${username}";
|
|
};
|
|
|
|
extraModules = singleton {
|
|
imports = listFilesRecursive ../../shared/modules/hjem;
|
|
};
|
|
};
|
|
}
|