Skip to content

Commit dc02b47

Browse files
committed
refactor(home.nix): add mkXdgConfigDirs helper
Add mkXdgConfigDirs in nix/home.nix. Move xdg.configFile entries (zeno/config.yml and catppuccin-*.ini) into a configFile attrset and invoke mkXdgConfigDirs for dotfiles nvim, git, and wezterm.
1 parent 0c82bb4 commit dc02b47

2 files changed

Lines changed: 26 additions & 20 deletions

File tree

nix/home.nix

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ let
1818
rev = "a9bdf479f8982c4b83b5c5005c8231c6b3352e2a";
1919
hash = "sha256-WeqvsKXTO3Iham+2dI1QsNZWA8Yv9BHn1BgdlvR8zaw=";
2020
};
21+
22+
mkXdgConfigDirs =
23+
base: names:
24+
lib.genAttrs names (name: {
25+
source = "${base}/${name}";
26+
recursive = true;
27+
});
2128
in
2229
{
2330
home.username = username;
@@ -253,15 +260,25 @@ in
253260
opencode.enable = true;
254261
};
255262

256-
xdg.enable = true;
263+
xdg = {
264+
enable = true;
257265

258-
xdg.configFile."zeno/config.yml".text = ''
259-
snippets:
260-
- name: git status
261-
keyword: gs
262-
snippet: git status --short --branch
263-
'';
266+
configFile = {
267+
"zeno/config.yml".text = ''
268+
snippets:
269+
- name: git status
270+
keyword: gs
271+
snippet: git status --short --branch
272+
'';
264273

265-
xdg.configFile."fsh/catppuccin-${config.catppuccin.flavor}.ini".source =
266-
"${catppuccinZshFsh}/themes/catppuccin-${config.catppuccin.flavor}.ini";
274+
"fsh/catppuccin-${config.catppuccin.flavor}.ini".source =
275+
"${catppuccinZshFsh}/themes/catppuccin-${config.catppuccin.flavor}.ini";
276+
277+
}
278+
// mkXdgConfigDirs dotfiles [
279+
"nvim"
280+
"git"
281+
"wezterm"
282+
];
283+
};
267284
}

setupScripts/setup.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
#!/bin/env bash
22
DOTDIR=$(cd $(git rev-parse --show-toplevel);pwd)
3-
ZSHRC="$DOTDIR/zsh/.zshrc"
43
cd $DOTDIR
54
XDG_CONFIG_HOME="$HOME/.config"
6-
export AQUA_GLOBAL_CONFIG=$XDG_CONFIG_HOME/aquaproj-aqua/aqua.yaml
75
if [ ! -d $XDG_CONFIG_HOME ]; then
86
mkdir $XDG_CONFIG_HOME
97
fi
108
git submodule update --init --recursive
119
ln -sfnv $DOTDIR/git-hook/post-merge $DOTDIR/.git/hooks/post-merge
12-
ln -sfnv $DOTDIR/git $XDG_CONFIG_HOME/git
13-
ln -sfnv $DOTDIR/zsh $XDG_CONFIG_HOME/zsh
14-
ln -sfnv $ZSHRC $HOME/.zshrc
15-
ln -sfnv $DOTDIR/zsh/sheldon $XDG_CONFIG_HOME/sheldon
16-
ln -sfnv $DOTDIR/starship.toml $XDG_CONFIG_HOME/starship.toml
17-
ln -sfnv $DOTDIR/nvim $XDG_CONFIG_HOME/nvim
18-
ln -sfnv $DOTDIR/wezterm $XDG_CONFIG_HOME/wezterm
19-
ln -sfnv $DOTDIR/sway $XDG_CONFIG_HOME/sway
20-
ln -sfnv $DOTDIR/tofi $XDG_CONFIG_HOME/tofi
2110
ln -sfnv $DOTDIR/emacs $HOME/.emacs.d
2211

2312
if type nix > /dev/null 2>&1; then

0 commit comments

Comments
 (0)