Skip to content

Commit d27a192

Browse files
author
Pablo Lezaeta
committed
fix(modules): move config files to .config XDG locations; skip system 'etc/' modules in installer and CI
1 parent 1d546ea commit d27a192

File tree

8 files changed

+27
-62
lines changed

8 files changed

+27
-62
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ jobs:
129129
# Iterate modules and try to stow to temporary directory
130130
for m in */ ; do
131131
m=$(basename "$m")
132+
# Skip modules that include system-level files (e.g. etc/) to avoid attempting to apply them
133+
if find "$m" -mindepth 1 -maxdepth 2 -type f -path '*/etc/*' | read; then
134+
echo "Skipping module: $m (contains system-level files under etc/)"
135+
continue
136+
fi
132137
echo "Testing module: $m"
133138
# Use explicit target to avoid modifying home
134139
stow -v -t "$TMP" "$m" || { echo "stow failed for module: $m"; exit 1; }

docs/INSTALL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Pasos para reinstalar y aplicar tu configuración (Linux, WSL):
2929
Precauciones:
3030
- Si tienes archivos existentes en `$HOME`, el instalador no los sobrescribirá y te avisará. Haz backup de configuraciones importantes antes de ejecutar.
3131

32+
Nota sobre archivos de sistema:
33+
- Este instalador solo aplica dotfiles de usuario en `$HOME`.
34+
- Módulos que contienen archivos bajo `etc/` (por ejemplo `modules/system/etc/thinkfan.conf`) son considerados archivos a nivel sistema y **no serán aplicados** por `scripts/install.sh` para evitar que se instalen en ubicaciones como `/etc` inadvertidamente. Si deseas aplicar dichos archivos deberás copiarlos manualmente con permisos de root y siguiendo las instrucciones del módulo.
35+
3236

3337
### Opción A: Xorg InputClass (recomendado para X11)
3438
1. Copiar `modules/system/etc/X11/*.conf` a `/etc/X11/xorg.conf.d/`.

modules/editor/neovim/init.vim renamed to modules/editor/neovim/.config/nvim/init.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
" init.vim example minimal
1+
" init.vim example minimal (moved to correct XDG path)
22
set nocompatible
33
set number
44
set tabstop=2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
" Neovim sample init.vim
1+
" Neovim sample init.vim (moved to correct XDG path)
22
set number
33
set relativenumber
44
set tabstop=2
File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Moved config for fish to the expected XDG path
2+
# This file was previously at the module root (which created $HOME/config.fish).
3+
# Stow will link this to $HOME/.config/fish/config.fish
4+
5+
set -g -x PATH $HOME/bin $PATH
6+
# prompt and basic behaviour
7+
set -g theme_nerd_fonts yes

modules/shell/fish/config.fish

Lines changed: 0 additions & 60 deletions
This file was deleted.

scripts/install.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ for MOD in "${MODULES[@]}"; do
6767
BASENAME=$(basename "$MOD")
6868
echo "Preparing to stow: $BASENAME -> $TARGET"
6969

70+
# Safety: skip modules that contain system-level paths (e.g., etc/) because this installer
71+
# only operates on user-level files under $HOME. If you intentionally want to apply system
72+
# files, handle them manually (or run a separate system installer as root).
73+
if (cd "$(dirname "$MOD")" && find "$(basename "$MOD")" -mindepth 1 -maxdepth 2 -type f -path '*/etc/*' | read); then
74+
echo "Skipping module $BASENAME because it contains system-level files under 'etc/'." >&2
75+
echo "This installer will not apply files intended for /etc (e.g., /etc/thinkfan.conf)." >&2
76+
continue
77+
fi
78+
7079
# dry-run check: list conflicting targets
7180
CONFLICTS=()
7281
while IFS= read -r -d $'\0' SRC; do

0 commit comments

Comments
 (0)