summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Leidi <therewasa@fishinthecalculator.me>2025-12-15 20:03:00 +0100
committerCayetano Santos <csantosb@inventati.org>2026-02-22 19:51:46 +0100
commit4533da834d277dda82ebf51861eb5796e20508df (patch)
tree1748df981ce72911df2de9108336e661481bbd29
parentdc93f8c7f77c50f1de5717e3e67ba4f8d693dc03 (diff)
gnu: home: dotfiles: Files not excluded when they should.
* gnu/home/services/dotfiles.scm (%home-dotfiles-excluded): Match content of .git directories. (directory-contents): Match whole file-name instead of basename. * doc/guix.texi: Document it. Fixes <https://issues.guix.gnu.org/71217> Authored-by: Nicolas Odermatt-Lemay <nodermattlemay@gmail.com> Change-Id: I2929fe3318e1f9f0b552c891207524dea25389ed Signed-off-by: Cayetano Santos <csantosb@inventati.org>
-rw-r--r--doc/guix.texi2
-rw-r--r--gnu/home/services/dotfiles.scm5
2 files changed, 3 insertions, 4 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 0a6020220c6..bb07432d49b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -51103,7 +51103,7 @@ the @code{home-dotfiles-service-type} will only provision dotfiles from this
51103subset of applications. This field will be ignored if @code{layout} is set 51103subset of applications. This field will be ignored if @code{layout} is set
51104to @code{'plain}. 51104to @code{'plain}.
51105 51105
51106@item @code{excluded} (default: @code{'(".*~" ".*\\.swp" "\\.git" "\\.gitignore")}) (type: list-of-strings) 51106@item @code{excluded} (default: @code{'(".*~" ".*\\.swp" "\\.git/.*" "\\.gitignore")}) (type: list-of-strings)
51107The list of file patterns @code{home-dotfiles-service-type} will exclude 51107The list of file patterns @code{home-dotfiles-service-type} will exclude
51108while visiting each one of the @code{directories}. 51108while visiting each one of the @code{directories}.
51109 51109
diff --git a/gnu/home/services/dotfiles.scm b/gnu/home/services/dotfiles.scm
index c7c798abc4e..1860009275b 100644
--- a/gnu/home/services/dotfiles.scm
+++ b/gnu/home/services/dotfiles.scm
@@ -45,7 +45,7 @@
45(define %home-dotfiles-excluded 45(define %home-dotfiles-excluded
46 '(".*~" 46 '(".*~"
47 ".*\\.swp" 47 ".*\\.swp"
48 "\\.git" 48 "\\.git/.*"
49 "\\.gitignore")) 49 "\\.gitignore"))
50 50
51(define %home-dotfiles-layouts 51(define %home-dotfiles-layouts
@@ -135,8 +135,7 @@ value, excluding files that match any of the patterns configured."
135 (define (filter-files directory) 135 (define (filter-files directory)
136 (find-files directory 136 (find-files directory
137 (lambda (file stat) 137 (lambda (file stat)
138 (not (regexp-exec exclusion-rx 138 (not (regexp-exec exclusion-rx file)))))
139 (basename file))))))
140 (if (and stow? packages (maybe-value-set? packages)) 139 (if (and stow? packages (maybe-value-set? packages))
141 (append-map filter-files 140 (append-map filter-files
142 (map (lambda (pkg) 141 (map (lambda (pkg)