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

nixos: define defaut state dir (/var...) prefix #1773

Closed
offlinehacker opened this issue Feb 18, 2014 · 11 comments
Closed

nixos: define defaut state dir (/var...) prefix #1773

offlinehacker opened this issue Feb 18, 2014 · 11 comments

Comments

@offlinehacker
Copy link
Contributor

We need an option to define a default state dir prefix, something like system.defaultStateDir = "/var";. other nixos modules can then use it like dataDir = ${config.system.defaultStateDir}/db/postgresql;.

I want to know:

  • Where should i put this option(in which nixos file, under which namespace)?
  • Do you see any problems with this behaviour?

This is also related to #1689

@vcunat
Copy link
Member

vcunat commented Feb 18, 2014

Note: many packages need to know the state dir at configure-time (so rebuild is typically needed).

@offlinehacker
Copy link
Contributor Author

Well yes, they won't work with changed state dir if they won't get rebuilt,
but that's something that has to be fixed upstream.
On Feb 18, 2014 5:21 PM, "Vladimír Čunát" [email protected] wrote:

Note: many packages need to know the state dir at configure-time (so
rebuild is typically needed).


Reply to this email directly or view it on GitHubhttps://github.com//issues/1773#issuecomment-35401388
.

@edolstra
Copy link
Member

What's the use case for this? I mean, I can see why you want to override the state directory for a specific service (like PostgreSQL), but there already are options for that.

@offlinehacker
Copy link
Contributor Author

Well yes, but then you can globally override and don't have to override for
each service. This is really helpfull in a case of user services where you
have to set to someting like user's home.

On Tue, Feb 18, 2014 at 5:26 PM, Eelco Dolstra [email protected]:

What's the use case for this? I mean, I can see why you want to override
the state directory for a specific service (like PostgreSQL), but there
already are options for that.

Reply to this email directly or view it on GitHubhttps://github.com//issues/1773#issuecomment-35401984
.

@offlinehacker
Copy link
Contributor Author

It's just one flag that could not hurt anyone and is used only for services. I tought services.dataPrefix by default set to /var. I'm just wondering if it's okay to rewrite nixos modules to use it?

@shlevy
Copy link
Member

shlevy commented Apr 5, 2014

I think this will be more useful once we have user services, but no real objections from me (other than the general objection that we shouldn't provide configurability that doesn't provide useful benefits)

@offlinehacker
Copy link
Contributor Author

I already have services.dataDir, which is just a simple string(defaulting
to /var), that modules can use, defined in my fork, and i use it in my user
services implementation. I will make pull request for services.dataDir
if you think it's ok?
On Apr 5, 2014 7:38 PM, "Shea Levy" [email protected] wrote:

I think this will be more useful once we have user services, but no real
objections from me (other than the general objection that we shouldn't
provide configurability that doesn't provide useful benefits)

Reply to this email directly or view it on GitHubhttps://github.com//issues/1773#issuecomment-39645244
.

@shlevy
Copy link
Member

shlevy commented Apr 5, 2014

Sure, is your user services implementation available as well?

@offlinehacker
Copy link
Contributor Author

Here: https://github.com/kiberpipa/nix-rehash/tree/master/nix-servicesBasicly
nix-rehash is a library with a few functions, nix-services being
one of them. I use this primary for distribution of development
environments, setting systemd.dataDir to some temporary location.
On Apr 6, 2014 12:08 AM, "Shea Levy" [email protected] wrote:

Sure, is your user services implementation available as well?

Reply to this email directly or view it on GitHubhttps://github.com//issues/1773#issuecomment-39652212
.

@offlinehacker
Copy link
Contributor Author

Will make a pull request with system.dataDir avalible and used in a few
modules.
On Apr 6, 2014 12:54 AM, "Jaka Hudoklin" [email protected] wrote:

Here: https://github.com/kiberpipa/nix-rehash/tree/master/nix-servicesBasicly nix-rehash is a library with a few functions, nix-services being
one of them. I use this primary for distribution of development
environments, setting systemd.dataDir to some temporary location.
On Apr 6, 2014 12:08 AM, "Shea Levy" [email protected] wrote:

Sure, is your user services implementation available as well?

Reply to this email directly or view it on GitHubhttps://github.com//issues/1773#issuecomment-39652212
.

@domenkozar
Copy link
Member

Closing since it's little value and PR can be opened any time

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

5 participants