From b7cc34b6e9fa2bdc81a5dd715157ff9290564f01 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Fri, 4 Jun 2021 16:17:02 +0700 Subject: [PATCH] declutter $HOME :) --- users/rin/npm.nix | 2 +- users/rin/scripts/xinitrc | 4 +-- users/rin/theming.nix | 1 + users/rin/xorg.nix | 71 ++++++++++++++++++++++----------------- users/rin/zsh.nix | 19 ++++++++--- 5 files changed, 58 insertions(+), 39 deletions(-) diff --git a/users/rin/npm.nix b/users/rin/npm.nix index c37b3a1..db86429 100644 --- a/users/rin/npm.nix +++ b/users/rin/npm.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { home.packages = [ pkgs.nodejs ]; - home.file.".npmrc".text = '' + xdg.configFile."npm/npmrc".text = '' cache=${config.xdg.dataHome}/npm/cache prefix=${config.xdg.dataHome}/npm store-dir=${config.xdg.dataHome}/npm/pnpm-store diff --git a/users/rin/scripts/xinitrc b/users/rin/scripts/xinitrc index 743163a..44caff4 100755 --- a/users/rin/scripts/xinitrc +++ b/users/rin/scripts/xinitrc @@ -7,5 +7,5 @@ if command -v dbus-update-activation-environment > /dev/null 2>&1; then dbus-update-activation-environment DISPLAY XAUTHORITY fi -xrdb ~/.Xresources -exec ~/.xsession +xrdb ${XDG_CONFIG_HOME}/xorg/xresources +exec ${XDG_CONFIG_HOME}/xorg/xsession diff --git a/users/rin/theming.nix b/users/rin/theming.nix index 24cd3d9..adeaeac 100644 --- a/users/rin/theming.nix +++ b/users/rin/theming.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: { gtk = { enable = true; + gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; font = { package = pkgs.open-sans; name = "Open Sans"; diff --git a/users/rin/xorg.nix b/users/rin/xorg.nix index 5082adb..958934f 100644 --- a/users/rin/xorg.nix +++ b/users/rin/xorg.nix @@ -1,43 +1,52 @@ { config, ... }: { - xsession.enable = true; - home.file.".xinitrc".source = ./scripts/xinitrc; + + xsession = { + enable = true; + profilePath = ".config/xorg/xprofile"; + scriptPath = ".config/xorg/xsession"; + }; + + xdg.configFile."xorg/xinitrc".source = ./scripts/xinitrc; xdg.configFile."xorg/wallpaper.png".source = ../../res/wallpaper.png; - xresources.properties = { - # special - "*.foreground" = "#c5c8c6"; - "*.background" = "#1d1f21"; - "*.cursorColor" = "#c5c8c6"; + xresources = { + path = "${config.xdg.configHome}/xorg/xresources"; + properties = { + # special + "*.foreground" = "#c5c8c6"; + "*.background" = "#1d1f21"; + "*.cursorColor" = "#c5c8c6"; - # black - "*.color0" = "#1d1f21"; - "*.color8" = "#969896"; + # black + "*.color0" = "#1d1f21"; + "*.color8" = "#969896"; - # red - "*.color1" = "#cc342b"; - "*.color9" = "#cc342b"; + # red + "*.color1" = "#cc342b"; + "*.color9" = "#cc342b"; - # green - "*.color2" = "#198844"; - "*.color10" = "#198844"; + # green + "*.color2" = "#198844"; + "*.color10" = "#198844"; - # yellow - "*.color3" = "#fba922"; - "*.color11" = "#fba922"; + # yellow + "*.color3" = "#fba922"; + "*.color11" = "#fba922"; - # blue - "*.color4" = "#3971ed"; - "*.color12" = "#3971ed"; + # blue + "*.color4" = "#3971ed"; + "*.color12" = "#3971ed"; - # magenta - "*.color5" = "#a36ac7"; - "*.color13" = "#a36ac7"; + # magenta + "*.color5" = "#a36ac7"; + "*.color13" = "#a36ac7"; - # cyan - "*.color6" = "#3971ed"; - "*.color14" = "#3971ed"; + # cyan + "*.color6" = "#3971ed"; + "*.color14" = "#3971ed"; - # white - "*.color7" = "#c5c8c6"; - "*.color15" = "#ffffff"; + # white + "*.color7" = "#c5c8c6"; + "*.color15" = "#ffffff"; + }; }; } diff --git a/users/rin/zsh.nix b/users/rin/zsh.nix index 0a24003..8661501 100644 --- a/users/rin/zsh.nix +++ b/users/rin/zsh.nix @@ -116,17 +116,26 @@ in rec { ''; sessionVariables = { - WINEPREFIX = "${config.xdg.dataHome}/wine64"; - WINEARCH = "win64"; - - EDITOR = "nvim"; PATH = builtins.concatStringsSep ":" [ "${config.home.homeDirectory}/.local/bin" "${config.xdg.dataHome}/npm/bin" "$PATH" ]; - DIRENV_LOG_FORMAT = ""; + + XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; + EDITOR = "nvim"; + CARGO_HOME = "${config.xdg.dataHome}/cargo"; + DIRENV_LOG_FORMAT = ""; + GNUPGHOME = "${config.xdg.dataHome}/gnupg"; + GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + LESSHISTFILE = "-"; + NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc"; + WGETRC = "${config.xdg.configHome}/wgetrc"; + XINITRC = "${config.xdg.configHome}/xorg/xinitrc"; + + WINEPREFIX = "${config.xdg.dataHome}/wine64"; + WINEARCH = "win64"; }; localVariables = { PS1 = "%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b ";