modules: use hjem environment module
This commit is contained in:
parent
107729a57a
commit
8c64859dab
6 changed files with 28 additions and 45 deletions
|
@ -41,9 +41,5 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
hjem.users.${username} = {
|
||||
files.".config/environment.d/${config.local.homeVars.userEnvFile}.conf".text = ''
|
||||
FLAKE="${config.hjem.users.${username}.directory}/.dotfiles"
|
||||
'';
|
||||
};
|
||||
hjem.users.${username}.environment.variables.FLAKE = "${config.hjem.users.${username}.directory}/.dotfiles";
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.filesystem) listFilesRecursive;
|
||||
inherit (config.local.systemVars) username;
|
||||
in {
|
||||
config = lib.mkIf (!config.local.profiles.server.enable) {
|
||||
|
@ -24,7 +25,9 @@ in {
|
|||
enable = true;
|
||||
directory = "/home/${username}";
|
||||
user = "${username}";
|
||||
environment.enable = true;
|
||||
};
|
||||
extraModules = listFilesRecursive ../../shared/modules/hjem;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -22,13 +22,6 @@ in {
|
|||
type = str;
|
||||
description = "your ssh public key (used for signing git commits)";
|
||||
};
|
||||
|
||||
userEnvFile = mkOption {
|
||||
type = str;
|
||||
description = "filename where the user environment variables such as EDITOR will be stored, under `$XDG_CONFIG_HOME/environment.d` (needs to be a file name without extension).";
|
||||
default = "99-user-env";
|
||||
example = "99-user-env";
|
||||
};
|
||||
};
|
||||
|
||||
config.assertions = mkIf (!config.local.profiles.server.enable) [
|
||||
|
@ -41,8 +34,5 @@ in {
|
|||
{
|
||||
assertion = options.local.homeVars.signingKey.isDefined;
|
||||
}
|
||||
{
|
||||
assertion = options.local.homeVars.userEnvFile.isDefined;
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (config.local.systemVars) username;
|
||||
inherit (config.local.homeVars) userEnvFile;
|
||||
in {
|
||||
imports = [
|
||||
./neovim.nix
|
||||
|
@ -20,10 +19,8 @@ in {
|
|||
unset -v EDITOR
|
||||
'';
|
||||
hjem.users.${username} = {
|
||||
files = {
|
||||
".config/environment.d/${userEnvFile}.conf".text = ''
|
||||
EDITOR="nvim"
|
||||
'';
|
||||
environment.variables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (builtins) toString;
|
||||
inherit (lib) mkIf optionalAttrs optionalString;
|
||||
inherit (lib) mkIf mkMerge optionalAttrs;
|
||||
inherit (lib'.generators) toHyprConf;
|
||||
inherit (config.local.systemVars) username;
|
||||
|
||||
|
@ -146,7 +146,6 @@ in {
|
|||
force_default_wallpaper = 0;
|
||||
disable_hyprland_logo = true;
|
||||
middle_click_paste = false;
|
||||
vrr = 1;
|
||||
};
|
||||
}
|
||||
// optionalAttrs styleCfg.enable {
|
||||
|
@ -161,24 +160,24 @@ in {
|
|||
}
|
||||
// import ./binds.nix lib;
|
||||
};
|
||||
".config/environment.d/${config.local.homeVars.userEnvFile}.conf".text =
|
||||
''
|
||||
GDK_SCALE="1"
|
||||
''
|
||||
+ optionalString styleCfg.enable ''
|
||||
|
||||
HYPRCURSOR_THEME="${styleCfg.cursorTheme.name}"
|
||||
HYPRCURSOR_SIZE="${toString styleCfg.cursorTheme.size}"
|
||||
XCURSOR_SIZE="${toString styleCfg.cursorTheme.size}"
|
||||
|
||||
''
|
||||
+ optionalString config.local.modules.nvidia.enable ''
|
||||
LIBVA_DRIVER_NAME="nvidia"
|
||||
__GLX_VENDOR_LIBRARY_NAME="nvidia"
|
||||
XDG_SESSION_TYPE="wayland"
|
||||
GBM_BACKEND="nvidia-drm"
|
||||
'';
|
||||
};
|
||||
|
||||
environment.variables = mkMerge [
|
||||
{
|
||||
GDK_SCALE = 1;
|
||||
}
|
||||
(mkIf styleCfg.enable {
|
||||
HYPRCURSOR_THEME = "${styleCfg.cursorTheme.name}";
|
||||
HYPRCURSOR_SIZE = "${toString styleCfg.cursorTheme.size}";
|
||||
XCURSOR_SIZE = "${toString styleCfg.cursorTheme.size}";
|
||||
})
|
||||
(mkIf config.local.modules.nvidia.enable {
|
||||
LIBVA_DRIVER_NAME = "nvidia";
|
||||
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
GBM_BACKEND = "nvidia-drm";
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
...
|
||||
}: let
|
||||
inherit (config.local.systemVars) username;
|
||||
inherit (config.local.homeVars) userEnvFile;
|
||||
toConf = attrs:
|
||||
builtins.concatStringsSep "\n"
|
||||
(lib.mapAttrsToList (option: value: "--${option}=\"${value}\"") attrs);
|
||||
|
@ -20,11 +19,10 @@ in {
|
|||
".config/bat/config".text = toConf {
|
||||
theme = "base16";
|
||||
};
|
||||
|
||||
".config/environment.d/${userEnvFile}.conf".text = ''
|
||||
MANPAGER = "sh -c 'col -bx | bat --language man' "
|
||||
MANROFFOPT = "-c"
|
||||
'';
|
||||
};
|
||||
environment.variables = {
|
||||
MANPAGER = "sh -c 'col -bx | bat --language man'";
|
||||
MANROFFOPT = "-c";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue