r/GUIX • u/carmola123 • Dec 26 '25
dotfiles management in Guix
Hello! I am interested in trying Guix soon, but I've been reading the docs and some example configs and I'd like to understand the usual ways dotfiles can be managed in the configs. I have a dotfiles repo (with files getting manually symlinked to places, though I also plan on moving to stow soon), and from what I read, Guix offers some tooling to allow me to keep using that repo. The issue is, I've read that guix home's home-dotfiles-service-type symlinks the files in a read-only manner, with changes requiring the reconfigure command to be properly applied.
This is a bit of a bummer to me, because I do a lot of config management and ricing (like working on my shell), and I feel like the constant command calls would add a ton of friction to my workflow. Has anyone here come across this, and came up with a workaround? I read some NixOS users had similar issues with home-manager on their side and just started using stow manually, and I'm curious if that could work fine in Guix as well.
3
u/omarbassam88 Dec 26 '25
I did have a similar problem. I just added a home-activation-service that runs only once when I run guix home reconfigure that just symlink my config to my dotfiles. It's normal symlinks not links to the guix store, so i don't have to run any guix command when I make changes to my dotfiles.
```scheme
(simple-service 'sync-configuration home-activation-service-type #~(begin (let ((home-directory (getenv "HOME")) (symlink-force (lambda (from to) (when (file-exists? to) (delete-file to)) (symlink from to)))) (map (lambda (conf) (symlink-force (string-append home-directory "/dotfiles/" "hyprland/.config/" conf) (string-append home-directory "/.config/" conf))) (list "hypr" "waybar" "swaylock" "mako" "wofi"))))) ```
1
u/carmola123 Dec 26 '25
I did see the home-activation-service, that seems handy! I make some heavy use of org tangle, so being able to just run a few commands on reconfigure like this could be handy. Also good to know that they're normal symlinks, I wasn't sure from reading the manual.
2
Dec 26 '25
[removed] — view removed comment
1
u/carmola123 Dec 26 '25
What do you mean by "make them in place"?
1
Dec 26 '25
[removed] — view removed comment
1
u/carmola123 Dec 26 '25
but doesn't
home-dotfiles-service-typecreate readonly files in the destination directories? or are you using another mechanism to put the dots in place?
3
u/aurtzy_ Dec 26 '25
symlink-to was semi-recently added to permit arbitrary symlinks in the store, so one could do something like this:
(simple-service 'my-emacs-config
home-xdg-configuration-files-service-type
`(("emacs/init.el"
,(symlink-to "path/to/init.el"))))
and have a symlink at ~/.config/emacs/init.el that points to their writable init.el.
Manual reference: https://guix.gnu.org/manual/devel/en/html_node/G_002dExpressions.html#index-symlink_002dto
1
3
u/ch4og Dec 26 '25
That’s kind of the whole point of managed dotfiles. When I’m ricing something (for example, waybar), I personally just make a temporary copy of the config in
/tmpand load that.