# Starting a package as a service on MacOs

**URL:** https://discourse.flox.dev/t/starting-a-package-as-a-service-on-macos/669
**Category:** Help
**Tags:** closed
**Created:** [February 17, 2023, 11:30pm UTC](https://discourse.flox.dev/t/starting-a-package-as-a-service-on-macos/669 "2023-02-17T23:30:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)
#### Post date: [February 17, 2023, 11:30pm UTC](https://discourse.flox.dev/t/starting-a-package-as-a-service-on-macos/669/1 "2023-02-17T23:30:00Z")

</div>

Hi,

I realize that my question is a bit far from flox, but this is still a result of not using brew nor NixOS.

I was able to install the [`yubikey-agent`](https://github.com/FiloSottile/yubikey-agent) package to give access to my new yubikey. However I can’t find how to start the downloaded executable as a service with `launchctl` on Mac. Is it something that someone already attempted? If not, don’t worry, I’ll keep on digging.

Thanks.

---

<div class="post-metadata">

### Author: ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)
#### Post date: [February 24, 2023, 7:02pm UTC](https://discourse.flox.dev/t/starting-a-package-as-a-service-on-macos/669/2 "2023-02-24T19:02:28Z")

</div>

Did you ever figure out how to do this? I haven’t attempted to do it, but I’m guessing you could start `/Users/matthew/.local/share/flox/environments/mkenigs/aarch64-darwin.default/bin/yubikey-agent` with `launchctl`.

This does start to touch on user-wide configuration, which flox hasn’t addressed yet. I’m curious, would you want something like starting yubikey-agent to be part of your default environment? You could add that in `shell.hook` of your default environment, but I’m not sure that’s the right place for it. And maybe you can only have one instance of yubikey-agent? There’s probably some things that should be part of system or user config that flox doesn’t support yet. Maybe we should integrate with [GitHub - LnL7/nix-darwin: nix modules for darwin](https://github.com/LnL7/nix-darwin)

---

<div class="post-metadata">

### Author: ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)
#### Post date: [February 25, 2023, 5:55pm UTC](https://discourse.flox.dev/t/starting-a-package-as-a-service-on-macos/669/3 "2023-02-25T17:55:07Z")

</div>

Hi Matthew,

> I’m curious, would you want something like starting yubikey-agent to be part of your default environment?

Yes that’s certainly the kind of thing I would like to do in that case.

> And maybe you can only have one instance of yubikey-agent?

Indeed.

Coming from Homebrew I would probably have done [`brew start`](https://github.com/FiloSottile/yubikey-agent#macos) in the past, but I didn’t know what would be the right approach with flox.
