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

[help wanted] homemanager postgres setup #6335

Open
ehrktia opened this issue Jan 18, 2025 · 3 comments
Open

[help wanted] homemanager postgres setup #6335

ehrktia opened this issue Jan 18, 2025 · 3 comments

Comments

@ehrktia
Copy link

ehrktia commented Jan 18, 2025

hi,
I am trying to move all my dev tools in to home-manager .
Am using ubuntu
os - Ubuntu 24.04.1 LTS
home-manager - home.stateVersion = "24.11"
trying to install tools via packages (no flakes).
home.nix.txt

I have installed pkgs.postgres_17 and understand clearly it only installs package in nix store not start server.
followed postgres docs and ran initdb - D $HOME/pg_data which is successful.
when trying to run pg_ctl -D $HOME/pg_data -l logfile start i get error missing lock file. To make postgres as system wide service using
systemd i did create /etc/systemd/system/postgres.service based on example from postgres docs.
Updated the executable to point /nix/store/hash_key-postgres and data dir to $HOME/pg_data now ended with permission error for postgres executable in nix store.
Is there any other easier way to start postgres after installation using home-manager?
similar to firefox

@irdaislakhuafa
Copy link

you setup postgres with home-manager why you create service a at /etc/systemd/system? user service location is on /home/$USER/.config/systemd/user/.
For easy way you can try devenv to setup service like postgresql
https://devenv.sh/supported-services/postgres/

Image

@teto
Copy link
Collaborator

teto commented Jan 29, 2025

(if it's just for quick testing, you can look at https://eradman.com/ephemeralpg/ as well)

@ehrktia
Copy link
Author

ehrktia commented Jan 29, 2025

sorry is not just for testing, i use it as datastore for all the applications

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

No branches or pull requests

3 participants