Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(redis): Support using Unix socket #353

Merged
merged 1 commit into from
Oct 11, 2024
Merged

feat(redis): Support using Unix socket #353

merged 1 commit into from
Oct 11, 2024

Conversation

shivaraj-bh
Copy link
Member

resolves #352

@shivaraj-bh shivaraj-bh merged commit 821dbf3 into main Oct 11, 2024
2 checks passed
@shivaraj-bh shivaraj-bh deleted the redis-uds branch October 11, 2024 14:37
Copy link

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I wonder if it would be worth it to unify the option names around sockets. Right now, process-compose-flake has httpServer.uds = "path-relative-to-project-root", redis has unixSocket = "path-relative-to-data-dir" and postgres has socketDir = "path-relative-to-project-root" (with no way to specify the name, but just the directory; I think it's okay though). One annoyance with the process-compose uds option is that using "data/process-compose.socket" won't automatically create the data/ directory and instead fail.

nix/services/redis.nix Show resolved Hide resolved
@shivaraj-bh
Copy link
Member Author

Thanks!

I wonder if it would be worth it to unify the option names around sockets. Right now, process-compose-flake has httpServer.uds = "path-relative-to-project-root", redis has unixSocket = "path-relative-to-data-dir" and postgres has socketDir = "path-relative-to-project-root" (with no way to specify the name, but just the directory; I think it's okay though). One annoyance with the process-compose uds option is that using "data/process-compose.socket" won't automatically create the data/ directory and instead fail.

Usually we try to match what’s upstream so users coming from there don’t have a hard time figuring out options. For redis it is the same as in nixos module in nixpkgs. nixpkgs doesn’t define an option to configure socket dir for postgres, so we can consider renaming that for uniformity. Even uds in process-compose-flake can be re-considered.

@niklasmohrin
Copy link

Usually we try to match what’s upstream so users coming from there don’t have a hard time figuring out options. For redis it is the same as in nixos module in nixpkgs

Ah, yeah, that makes perfect sense!

nixpkgs doesn’t define an option to configure socket dir for postgres, so we can consider renaming that for uniformity. Even uds in process-compose-flake can be re-considered.

I am not sure what the postgres config file instruction for this is called, but I guess using this would make sense. Maybe this even is socketDir. Process compose seems to be a bit messy as the CLI flags are --use-uds and --unix-socket but the environment variable for the latter is PC_SOCKET_PATH.


Overall, I don't really mind, all options are somewhat okay to find. Since different programs have different ways of offering the same functionality, some heterogeneity in the naming here is probably unavoidable. I suppose finding a unified way that intuitively makes sense is not as easy as I initially made it out to be. Good documentation can probably make any naming scheme work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support using Redis with UDS
3 participants