this post was submitted on 18 Jun 2025
14 points (100.0% liked)

Nix / NixOS

2310 readers
1 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

Hi! I'm trying out Nix and I'm trying to set up and organize everything. Usually I put all my configs in a directory which is also a git repo and synced to my NAS, using the same subfolders they'd be in, and use GNU Stow to symlink the top-level folders (/dotfiles/home/ to /home/username/, /dotfiles/etc to /etc and /dotfiles/usr to /usr) and let it do its thing. Would it cause problems to also do that for configuration.nix?

On Arch I already had a /dotfiles/etc symlinked to /etc for my custom keyboard layouts, which worked fine... until the update which moved the location of the GUI keyboard layouts. It prevented the update so I undid the symlinks, updated, and put them again to the new location... but somehow it broke everything except the tty and no Wayland compositor I tried would work anymore (and there went my record of having never broken Arch since the first install over a year ago ๐Ÿ˜… )

So I'm kinda wary of doing it on an even more critical file... but also I'm very lazy and having everything in a single repo is very convenient... How do you do it?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 5 points 1 week ago (1 children)

FYI โ€“ The reference to the flake doesn't have to be a path, but can also point to git repositories. This let's you do fun stuff like:

nixos-rebuild switch --flake github:myusername/mynixosrepo

The default fragment name used is the current hostname of the machine, so it can be omitted most of the time.

[โ€“] [email protected] 3 points 1 week ago

That's actually pretty sick. I knew you could run things this way, but not rebuild