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

Draft: nix-darwin module #558

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Draft: nix-darwin module #558

wants to merge 5 commits into from

Conversation

j-baker
Copy link

@j-baker j-baker commented May 5, 2024

Fixes #409.

The home manager module covers most cases on Darwin, but does not cover headless devices as agents don't run unless a user session exists. This is a (draft) small copy-paste job of the home-manager integration which is enough to get nix-darwin working.

I'd like feedback on:

  • What tests would be useful/how this should be tested?
  • What sort of code sharing should occur between this and normal Nix?
  • Any documentation that'd be nice?

and honestly anything else.

This is somewhat but not entirely duplicative with the home manager
support. The difference is primarily for MacOS servers, for which there
is no LaunchAgent support (as launch agents are tied to user sessions).

This PR adds a nix-darwin module (configured similarly to the home
manager module) which is suitable for e.g. other launchd daemons.
@j-baker j-baker marked this pull request as draft May 5, 2024 09:19
description = ''
Path where secrets are symlinked to.
If the default is kept no other symlink is created.
`%r` is replaced by $XDG_RUNTIME_DIR on linux or `getconf
Copy link
Owner

Choose a reason for hiding this comment

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

This does not exist on macos, right?


defaultSecretsMountPoint = lib.mkOption {
type = lib.types.str;
default = "%r/secrets.d";
Copy link
Owner

Choose a reason for hiding this comment

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

Same question here.

options.sops = {
logFile = lib.mkOption {
type = lib.types.path;
default = "/var/log/sops.log";
Copy link
Owner

Choose a reason for hiding this comment

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

Do applications need to log themselves to files?

@Mic92
Copy link
Owner

Mic92 commented May 9, 2024

I'd like feedback on:

* What tests would be useful/how this should be tested?

Automatic tests in the CI would be great, but I don't know how this is done on macOS. I do have a macos builder in buildbot, if that helps.

* What sort of code sharing should occur between this and normal Nix?

I don't think we need to butcher the nixos options to share them between platforms.
It's fine to just share the go code.

* Any documentation that'd be nice?

Yes, would be. I assume it's not that different from other platforms?

and honestly anything else.

'';
};

mode = lib.mkOption {
Copy link
Owner

Choose a reason for hiding this comment

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

We also want owner/group here.

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.

darwin-nix support
3 participants