hydra icon indicating copy to clipboard operation
hydra copied to clipboard

GitInput: Allow setting a umask

Open dasJ opened this issue 3 years ago • 3 comments

dasJ avatar Jun 12 '22 16:06 dasJ

Hm, what's the use case for this?

edolstra avatar Jun 16 '22 13:06 edolstra

@edolstra probably one of the weirdest use cases tbh.

First off, initNix() (from nix) sets a umask which is too restrictive for me, overriding the one that is set from the systemd unit. I could store the umask before the call, and restore it afterwards but I was too afraid I could break something nix-internal (I really don't know enough about it).

I want a more open umask because I wrote a Hydra plugin that interacts with the git repos as well by fetching into them and creating them if necessary. This plugin however runs in hydra-notify while the regular git fetcher runs in hydra-evaluator. For this to work properly, I need to have write permissions for hydra group.

There may be a more clever solution I haven't thought of yet, maybe restoring the umask as mentioned above but this is the best I could come up with.

dasJ avatar Jun 17 '22 12:06 dasJ

Now that I come to think of it, maybe not as weird as I expected. My plugin has a evalAdded hook that parses local lockfiles and generates git inputs so the SCM diff works. May be worth supporting for future things like a flake lock extractor?

dasJ avatar Jun 17 '22 12:06 dasJ