juspay / services-flake

NixOS-like services for Nix flakes
https://community.flake.parts/services-flake
MIT License
327 stars 28 forks source link

Refactor(DRY): `./data/${name}` #200

Closed srid closed 1 month ago

srid commented 3 months ago

Easy to break this convention in new PRs

image

e.g.: https://github.com/juspay/services-flake/pull/195#discussion_r1615217405

shivaraj-bh commented 3 months ago

Shouldn't https://github.com/juspay/services-flake/issues/53 prevent this?

srid commented 3 months ago

Only if contributors always use that template and promise to never hand edit the generated dataDir option.

srid commented 2 months ago

Should we add namespace to this consideration as well?

c. https://github.com/juspay/services-flake/pull/219#issuecomment-2166758801

shivaraj-bh commented 2 months ago

namespace and dataDir are going to follow the same convention across services, so how about creating a default module and importing it in https://github.com/juspay/services-flake/blob/main/nix/lib.nix?

Edit: To be specific, here: https://github.com/juspay/services-flake/blob/14a37407105c948fb79f2933c22a5ada4ab22f60/nix/lib.nix#L25

srid commented 2 months ago

Good idea.

Make sure to use lib.mkDefault though.

srid commented 1 month ago

This should be fairly simple to implement after #258 (which does it for namespace)