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

services definitions on OS X #21252

Closed
nhooyr opened this issue Dec 18, 2016 · 8 comments
Closed

services definitions on OS X #21252

nhooyr opened this issue Dec 18, 2016 · 8 comments
Labels
6.topic: darwin Running or building packages on Darwin 9.needs: community feedback

Comments

@nhooyr
Copy link
Contributor

nhooyr commented Dec 18, 2016

There are no launchd services for servers such as postgres on macOS, you have to manually start/stop postgres yourself. While it is trivial to create a script/alias to do this or even write the service definition yourself, it would be nice if nix could do it for you.

#5246 was opened to address this but it was abandoned.

@LnL7 LnL7 added the 6.topic: darwin Running or building packages on Darwin label Dec 18, 2016
@LnL7
Copy link
Member

LnL7 commented Dec 18, 2016

I've been working working on a project that tries some of the parts of nixos to darwin. At the moment it's a separate project because I'm not sure yet how to integrate it with the existing nixos modules, but there should be very little difference for the parts that overlap.

Feedback and help are appreciated to make it easier to get started with it.
https://github.com/LnL7/nix-darwin

@LnL7
Copy link
Member

LnL7 commented Dec 18, 2016

@copumpkin do you have any thoughts on this?

@globin
Copy link
Member

globin commented Jan 11, 2017

ping @periklis, he had some thoughts on this, too.

@Mic92 Mic92 changed the title services definitions services definitions on OS X Jan 18, 2017
@periklis
Copy link
Contributor

periklis commented Mar 6, 2017

Way months back, when i was doing my first baby steps with nixpkgs, i tried to create a PR for a new output type called "plist" to adress this issue. My assumptions were:

  • A lot of projects deliver in the first place sane default plists, so use them.
  • Make the usage of a plist an optional part of the derivation outputs,
    e.g. outputs = ["lib", "dev"] ++ stdenv.lib.optional (stdenv.isDarwin) ["plist"];
  • If the default plist needed modifications, we could use an extra attribute plist =''...'';
  • Make ouput type and attr plist only available in the stenv.darwin.
  • Print out instructions for launchctl load /nix/store/long-hash-name-version-plist/org.company.name.plist for the user after installPhase.

However, i failed to produce the PR at that time, because of lack of knowledge of the internals of stdenv.darwin. I got lost in the recursion of stageFun calls at that time, when i tried to inject just a custom build-plist.sh to extend the defaultNativeBuildInputs of the initial stdenv/generic/default.nix.

In summary, this just an abstraction of the approach currently found in packages like xquatz, that produce plist files in the derivation's attrset and reference to the contents during the phases.

@LnL7
Copy link
Member

LnL7 commented Mar 6, 2017

I might be bias, but I'm not sure how useful a plist output is in practice since there's no way to customise it. Using the module system makes more sense to me and has some nice advantages like type checking and nice descriptions for all of the launchd options.

@periklis
Copy link
Contributor

periklis commented Mar 6, 2017

@LnL7 Sure you are right, but modules are the heavy-lifting way. I could not foresee that nix-darwin would be possible at that moment. However, i having a plist attribute which anybody can override would do the same all the launchd options, but this is the dirty way.

@mmahut
Copy link
Member

mmahut commented Aug 12, 2019

Are there any updates to this issue, please?

@nhooyr
Copy link
Contributor Author

nhooyr commented Nov 21, 2019

Going to close as it has been a long time and I'm not sure if this is relevant anymore.

@nhooyr nhooyr closed this as completed Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 9.needs: community feedback
Projects
None yet
Development

No branches or pull requests

5 participants