nlewo / comin

GitOps For NixOS Machines
MIT License
241 stars 11 forks source link

support for subdirectories #49

Closed ajgon closed 1 week ago

ajgon commented 1 week ago

This PR adds support for flake.nix files not stored in the root of the repository.

I'm aware, that my use-case may be a little bit extra-ordinary, but I maintain one big, gitops monorepo with bunch of stuff separated in different subdirectories (i.e. k8s manifests in k8s, nix flakes in nix etc.). This PR will add support of such cases, by providing option to set up custom subdirectory, while still maintaing compatibility (as the param defaults to ".").

I also tested this branch on my local machine, and no issues so far.

ajgon commented 1 week ago

I agree, repo_dir wasn't a very good name :) I renamed it to flake_subdirectory as suggested, which sounds way better.

Regarding adding this options to remotes.* - I'm not sure if this is a good idea. From what I understood from the code, multiple remotes are generally the same git repository on different locations and is/are cloned to the same directory. Meaning the directory structure remain the same (i.e. they are equivalent of git remote add .....), so this option there wouldn't make much sense (as it has to be the same on each)?

nlewo commented 1 week ago

Thank you for your contribution.