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

Automatically grant file access permissions #1334

Open
YTG1234 opened this issue Feb 12, 2025 · 5 comments
Open

Automatically grant file access permissions #1334

YTG1234 opened this issue Feb 12, 2025 · 5 comments

Comments

@YTG1234
Copy link

YTG1234 commented Feb 12, 2025

I run Jellyfin as a launchd agent, adapted code:

launchd.user.agents.jellyfin = {
  path = [ pkgs.jellyfin ];
  command = pkgs.writeShellScript "jellyfin-service" ''
    exec ${pkgs.lib.getExe pkgs.jellyfin} --service -d $HOME/.local/share/jellyfin -c $HOME/.config/jellyfin -C $HOME/.cache/jellyfin
  '';
  serviceConfig.KeepAlive = true;
  serviceConfig.RunAtLoad = true;
};

My libraries live on an external drive, and macOS apps need extra permissions for that. My problems are two:

  1. macOS doesn't show the pop-up at all, so I just get System.IO.IOException: Operation not permitted errors.
  2. Even if the pop-up were to show up, I would still prefer to grant the permissions preemptively, perhaps during activation.

How should I go about this?


Note: this isn't just a standard Unix permission error. The relevant files have read permission for everyone (mode 644).

@YTG1234 YTG1234 changed the title Automatically grant permissions Automatically grant file access permissions Feb 12, 2025
@Samasaur1
Copy link
Contributor

I think problem 1 would be solved by manually running the executable from a terminal?

@YTG1234
Copy link
Author

YTG1234 commented Feb 13, 2025

This is very weird… Running the generated script from the terminal works, but the launchd service is still denied access.

@Samasaur1
Copy link
Contributor

Samasaur1 commented Feb 13, 2025

Have you tried restarting after running the script manually?

@YTG1234
Copy link
Author

YTG1234 commented Feb 13, 2025

I have, it still doesn't work.

@YTG1234
Copy link
Author

YTG1234 commented Feb 20, 2025

Any other ideas?

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

2 participants