Skip to content

Commit

Permalink
feat(nix): follow xdg directories
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamHsieh committed Sep 18, 2023
1 parent 929d5e4 commit 8345fae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ in {
];
};

xdg.enable = true;

xdg.configFile = {
"nvim".source = link ".config/nvim";
"alacritty".source = link ".config/alacritty";
Expand Down Expand Up @@ -81,13 +83,13 @@ in {
initExtraFirst = ''
# p10k instant prompt
echo ""
if [[ -r "''${XDG_CACHE_HOME:-''$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "''${XDG_CACHE_HOME:-''$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh"
if [[ -r "${config.xdg.cacheHome}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "${config.xdg.cacheHome}/p10k-instant-prompt-''${(%):-%n}.zsh"
fi
# source nix profile
if [[ -r "''$HOME/.nix-profile/etc/profile.d/nix.sh" ]]; then
source "''$HOME/.nix-profile/etc/profile.d/nix.sh"
if [[ -r "${config.xdg.stateHome}/nix/profiles/profile/etc/profile.d/nix.sh" ]]; then
source "${config.xdg.stateHome}/nix/profiles/profile/etc/profile.d/nix.sh"
fi
'';
initExtra = "source ~/.zshrc";
Expand Down

0 comments on commit 8345fae

Please sign in to comment.