modules: use hjem environment module
This commit is contained in:
parent
b8e696e17b
commit
4a38e90dfa
6 changed files with 28 additions and 45 deletions
|
@ -41,9 +41,5 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
hjem.users.${username} = {
|
hjem.users.${username}.environment.variables.FLAKE = "${config.hjem.users.${username}.directory}/.dotfiles";
|
||||||
files.".config/environment.d/${config.local.homeVars.userEnvFile}.conf".text = ''
|
|
||||||
FLAKE="${config.hjem.users.${username}.directory}/.dotfiles"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (lib.filesystem) listFilesRecursive;
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (!config.local.profiles.server.enable) {
|
config = lib.mkIf (!config.local.profiles.server.enable) {
|
||||||
|
@ -24,7 +25,9 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
directory = "/home/${username}";
|
directory = "/home/${username}";
|
||||||
user = "${username}";
|
user = "${username}";
|
||||||
|
environment.enable = true;
|
||||||
};
|
};
|
||||||
|
extraModules = listFilesRecursive ../../shared/modules/hjem;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,13 +22,6 @@ in {
|
||||||
type = str;
|
type = str;
|
||||||
description = "your ssh public key (used for signing git commits)";
|
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) [
|
config.assertions = mkIf (!config.local.profiles.server.enable) [
|
||||||
|
@ -41,8 +34,5 @@ in {
|
||||||
{
|
{
|
||||||
assertion = options.local.homeVars.signingKey.isDefined;
|
assertion = options.local.homeVars.signingKey.isDefined;
|
||||||
}
|
}
|
||||||
{
|
|
||||||
assertion = options.local.homeVars.userEnvFile.isDefined;
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
inherit (config.local.homeVars) userEnvFile;
|
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./neovim.nix
|
./neovim.nix
|
||||||
|
@ -20,10 +19,8 @@ in {
|
||||||
unset -v EDITOR
|
unset -v EDITOR
|
||||||
'';
|
'';
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
files = {
|
environment.variables = {
|
||||||
".config/environment.d/${userEnvFile}.conf".text = ''
|
EDITOR = "nvim";
|
||||||
EDITOR="nvim"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) toString;
|
inherit (builtins) toString;
|
||||||
inherit (lib) mkIf optionalAttrs optionalString;
|
inherit (lib) mkIf mkMerge optionalAttrs;
|
||||||
inherit (lib'.generators) toHyprConf;
|
inherit (lib'.generators) toHyprConf;
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
|
|
||||||
|
@ -146,7 +146,6 @@ in {
|
||||||
force_default_wallpaper = 0;
|
force_default_wallpaper = 0;
|
||||||
disable_hyprland_logo = true;
|
disable_hyprland_logo = true;
|
||||||
middle_click_paste = false;
|
middle_click_paste = false;
|
||||||
vrr = 1;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// optionalAttrs styleCfg.enable {
|
// optionalAttrs styleCfg.enable {
|
||||||
|
@ -161,24 +160,24 @@ in {
|
||||||
}
|
}
|
||||||
// import ./binds.nix lib;
|
// 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
|
}: let
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
inherit (config.local.homeVars) userEnvFile;
|
|
||||||
toConf = attrs:
|
toConf = attrs:
|
||||||
builtins.concatStringsSep "\n"
|
builtins.concatStringsSep "\n"
|
||||||
(lib.mapAttrsToList (option: value: "--${option}=\"${value}\"") attrs);
|
(lib.mapAttrsToList (option: value: "--${option}=\"${value}\"") attrs);
|
||||||
|
@ -20,11 +19,10 @@ in {
|
||||||
".config/bat/config".text = toConf {
|
".config/bat/config".text = toConf {
|
||||||
theme = "base16";
|
theme = "base16";
|
||||||
};
|
};
|
||||||
|
};
|
||||||
".config/environment.d/${userEnvFile}.conf".text = ''
|
environment.variables = {
|
||||||
MANPAGER = "sh -c 'col -bx | bat --language man' "
|
MANPAGER = "sh -c 'col -bx | bat --language man'";
|
||||||
MANROFFOPT = "-c"
|
MANROFFOPT = "-c";
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue