elemental icon indicating copy to clipboard operation
elemental copied to clipboard

Adapting elemental to distributed configurations

Open DeadlySquad13 opened this issue 2 years ago • 0 comments

Hello! I really like the style of this repo! Especially the part where you store nix configuration for the program in the same folder as this program's config files. And by simply importing it, you build up your dotfiles.

I'm wondering if I can achieve the same. I have my dotfiles spread across multiple repositories though. Is it possible to follow your approach in this scenario? For instance, you have:

{
  imports = [
    ./admin/restic/default.nix
    ./admin/topgrade/default.nix
    ./dev/git/default.nix
    ./editor/neovim/default.nix
    ./file-manager/ranger/default.nix
    ./networking/nmap/default.nix
    ./networking/ssh/default.nix
    ./scripts/index.nix
    ./shell/fish/default.nix
    ./shell/starship/default.nix
    ./terminal/alacritty/default.nix
    ./terminal/tmux/default.nix
  ];
}

But I have my NeoVim config in a separate repo. Can I cook up something like this?

{
  imports = [
    ...
    ./dev/git/default.nix
-    ./editor/neovim/default.nix
+   https://github.com/DeadlySquad13/NeoVim_config/default.nix
    ./file-manager/ranger/default.nix
    ...
  ];
}

While in NeoVim repo there will be a nix file with instruction how to symlink and install this piece of software on my machine. Right now it's not super important for me how to fetch this repo automagically but rather how to build my home-manager config in a distributed way (in multiple repos).

I have read a lot about derivations and flakes which seem up to task but all the examples I have seen are about packaging software, not parts of dotfiles. So I'm not sure how to integrate these flakes with home-manager...

I tried git-submodules in the past but for me they seem a pain to manage. You always end up with a huge main repo - as for me, it kind of breaks the whole point of separating these configs.

I'm a complete newbie in nix ecosystem so I would highly appreciate if you can share your knowledge with me!

DeadlySquad13 avatar Nov 10 '23 15:11 DeadlySquad13