diff options
| author | Fuwn <[email protected]> | 2024-10-30 22:35:19 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-30 22:35:19 -0700 |
| commit | 20a85bacc2f8c22c1c0f338c5a8872d29b432935 (patch) | |
| tree | e9a6b87b8be628f163b040d035410cc5cdeb23c0 /home/ebisu/core/system | |
| parent | core: move variables to core from kansai (diff) | |
| download | nixos-config-20a85bacc2f8c22c1c0f338c5a8872d29b432935.tar.xz nixos-config-20a85bacc2f8c22c1c0f338c5a8872d29b432935.zip | |
core: move variables to modules
Diffstat (limited to 'home/ebisu/core/system')
| -rw-r--r-- | home/ebisu/core/system/default.nix | 2 | ||||
| -rw-r--r-- | home/ebisu/core/system/variables/cleanup.nix (renamed from home/ebisu/core/system/variables.nix) | 52 | ||||
| -rw-r--r-- | home/ebisu/core/system/variables/default-programs.nix | 10 | ||||
| -rw-r--r-- | home/ebisu/core/system/variables/default.nix | 16 | ||||
| -rw-r--r-- | home/ebisu/core/system/variables/less.nix | 13 | ||||
| -rw-r--r-- | home/ebisu/core/system/variables/settings.nix | 23 | ||||
| -rw-r--r-- | home/ebisu/core/system/variables/xdg.nix | 10 |
7 files changed, 74 insertions, 52 deletions
diff --git a/home/ebisu/core/system/default.nix b/home/ebisu/core/system/default.nix index 262662e..2cb98ad 100644 --- a/home/ebisu/core/system/default.nix +++ b/home/ebisu/core/system/default.nix @@ -1,7 +1,7 @@ { imports = [ ./encryption - ./variables.nix + ./variables ./xdg.nix ]; } diff --git a/home/ebisu/core/system/variables.nix b/home/ebisu/core/system/variables/cleanup.nix index c958b85..18cc8f6 100644 --- a/home/ebisu/core/system/variables.nix +++ b/home/ebisu/core/system/variables/cleanup.nix @@ -1,29 +1,7 @@ -{ - pkgs, - config, - flakeDirectory, - lib, - ... -}: +{ config, flakeDirectory, ... }: { home.sessionVariables = { - # https://github.com/nix-community/home-manager/issues/354#issuecomment-475803163 - LOCALES_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive"; FLAKE = flakeDirectory; - - # Default programs - EDITOR = "lvim"; - TERMINAL = "kitty"; - TERMINAL_PROG = "kitty"; - BROWSER = "zen"; - FLAKE_EDITOR = "${lib.getExe pkgs.zed-editor}"; - - # Home directory clean-up - # https://github.com/NixOS/nixpkgs/issues/224525#issuecomment-1945290961 - XDG_DATA_HOME = "${config.xdg.dataHome}"; - XDG_CONFIG_HOME = "${config.xdg.configHome}"; - XDG_STATE_HOME = "${config.xdg.stateHome}"; - XDG_CACHE_HOME = "${config.xdg.cacheHome}"; NOTMUCH_CONFIG = "${config.xdg.configHome}/notmuch-config"; # GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc-2.0"; WGETRC = "${config.xdg.configHome}/wget/wgetrc"; @@ -70,33 +48,5 @@ STACK_ROOT = "${config.xdg.dataHome}/stack"; STACK_XDG = 1; PYHTHON_HISTORY = "${config.xdg.stateHome}/python_history"; - - # Other program settings - FZF_DEFAULT_OPTS = "--layout=reverse --height 40%"; - LESS = "R"; - LESS_TERMCAP_mb = "$(printf '%b' '[1;31m')"; - LESS_TERMCAP_md = "$(printf '%b' '[1;36m')"; - LESS_TERMCAP_me = "$(printf '%b' '[0m')"; - LESS_TERMCAP_so = "$(printf '%b' '[01;44;33m')"; - LESS_TERMCAP_se = "$(printf '%b' '[0m')"; - LESS_TERMCAP_us = "$(printf '%b' '[1;32m')"; - LESS_TERMCAP_ue = "$(printf '%b' '[0m')"; - LESSOPEN = "| highlight -O ansi %s 2>/dev/null"; - QT_QPA_PLATFORMTHEME = "gtk2"; - MOZ_USE_XINPUT2 = "1"; - AWT_TOOLKIT = "MToolkit wmname LG3D"; - _JAVA_AWT_WM_NONREPARENTING = 1; - OPENAI_API_KEY = "$(cat ${config.sops.secrets.openai_api_key.path})"; - NNN_FIFO = "/tmp/nnn.fifo"; - _Z_DATA = "${config.xdg.dataHome}/z"; - W3M_DIR = "${config.xdg.dataHome}/w3m"; - VMODULES = "${config.xdg.dataHome}/vmodules"; - TEXMFVAR = "${config.xdg.cacheHome}/texlive/texmf-var"; - BUNDLE_USER_CONFIG = "${config.xdg.configHome}/bundle"; - BUNDLE_USER_CACHE = "${config.xdg.cacheHome}/bundle"; - BUNDLE_USER_PLUGIN = "${config.xdg.dataHome}/bundle"; - PSQL_HISTORY = "${config.xdg.dataHome}/psql_history"; - PKG_CACHE_PATH = "${config.xdg.cacheHome}/pkg-cache"; - SUZURI_TOKEN = "$(cat ${config.sops.secrets.suzuri_token.path})"; }; } diff --git a/home/ebisu/core/system/variables/default-programs.nix b/home/ebisu/core/system/variables/default-programs.nix new file mode 100644 index 0000000..68a9d58 --- /dev/null +++ b/home/ebisu/core/system/variables/default-programs.nix @@ -0,0 +1,10 @@ +{ lib, pkgs, ... }: +{ + home.sessionVariables = { + EDITOR = "lvim"; + TERMINAL = "kitty"; + TERMINAL_PROG = "kitty"; + BROWSER = "zen"; + FLAKE_EDITOR = "${lib.getExe pkgs.zed-editor}"; + }; +} diff --git a/home/ebisu/core/system/variables/default.nix b/home/ebisu/core/system/variables/default.nix new file mode 100644 index 0000000..307f578 --- /dev/null +++ b/home/ebisu/core/system/variables/default.nix @@ -0,0 +1,16 @@ +{ + pkgs, + ... +}: +{ + imports = [ + ./cleanup.nix + ./default-programs.nix + ./less.nix + ./settings.nix + ./xdg.nix + ]; + + # https://github.com/nix-community/home-manager/issues/354#issuecomment-475803163 + home.sessionVariables.LOCALES_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive"; +} diff --git a/home/ebisu/core/system/variables/less.nix b/home/ebisu/core/system/variables/less.nix new file mode 100644 index 0000000..2ff31f0 --- /dev/null +++ b/home/ebisu/core/system/variables/less.nix @@ -0,0 +1,13 @@ +{ + home.sessionVariables = { + LESS = "R"; + LESS_TERMCAP_mb = "$(printf '%b' '[1;31m')"; + LESS_TERMCAP_md = "$(printf '%b' '[1;36m')"; + LESS_TERMCAP_me = "$(printf '%b' '[0m')"; + LESS_TERMCAP_so = "$(printf '%b' '[01;44;33m')"; + LESS_TERMCAP_se = "$(printf '%b' '[0m')"; + LESS_TERMCAP_us = "$(printf '%b' '[1;32m')"; + LESS_TERMCAP_ue = "$(printf '%b' '[0m')"; + LESSOPEN = "| highlight -O ansi %s 2>/dev/null"; + }; +} diff --git a/home/ebisu/core/system/variables/settings.nix b/home/ebisu/core/system/variables/settings.nix new file mode 100644 index 0000000..e3b5eb0 --- /dev/null +++ b/home/ebisu/core/system/variables/settings.nix @@ -0,0 +1,23 @@ +{ config, ... }: +{ + home.sessionVariables = { + FZF_DEFAULT_OPTS = "--layout=reverse --height 40%"; + QT_QPA_PLATFORMTHEME = "gtk2"; + MOZ_USE_XINPUT2 = "1"; + AWT_TOOLKIT = "MToolkit wmname LG3D"; + _JAVA_AWT_WM_NONREPARENTING = 1; + OPENAI_API_KEY = "$(cat ${config.sops.secrets.openai_api_key.path})"; + NNN_FIFO = "/tmp/nnn.fifo"; + _Z_DATA = "${config.xdg.dataHome}/z"; + W3M_DIR = "${config.xdg.dataHome}/w3m"; + VMODULES = "${config.xdg.dataHome}/vmodules"; + TEXMFVAR = "${config.xdg.cacheHome}/texlive/texmf-var"; + BUNDLE_USER_CONFIG = "${config.xdg.configHome}/bundle"; + BUNDLE_USER_CACHE = "${config.xdg.cacheHome}/bundle"; + BUNDLE_USER_PLUGIN = "${config.xdg.dataHome}/bundle"; + PSQL_HISTORY = "${config.xdg.dataHome}/psql_history"; + PKG_CACHE_PATH = "${config.xdg.cacheHome}/pkg-cache"; + SUZURI_TOKEN = "$(cat ${config.sops.secrets.suzuri_token.path})"; + FILTER_BRANCH_SQUELCH_WARNING = 1; + }; +} diff --git a/home/ebisu/core/system/variables/xdg.nix b/home/ebisu/core/system/variables/xdg.nix new file mode 100644 index 0000000..734d85d --- /dev/null +++ b/home/ebisu/core/system/variables/xdg.nix @@ -0,0 +1,10 @@ +{ config, ... }: +{ + # https://github.com/NixOS/nixpkgs/issues/224525#issuecomment-1945290961 + home.sessionVariables = { + XDG_DATA_HOME = "${config.xdg.dataHome}"; + XDG_CONFIG_HOME = "${config.xdg.configHome}"; + XDG_STATE_HOME = "${config.xdg.stateHome}"; + XDG_CACHE_HOME = "${config.xdg.cacheHome}"; + }; +} |