how to create files without hash-prefix? i need a file „post-receive“, not „abc123-post-receive“ when specifying a list of type.path in

@bake Hey, maybe pkgs.writeTextFile is what you are looking for? It has a destination argument where you can say sth like { destination = "/post-receive"; }.

@erictapen thank you, i did not know about writeTextFile (only writeText). the problem i see with it is that gitolite.nix tries to copy the result (/store/abc123-post-receive, not /store/abc123-post-receive/post-receive). i could probably just modify gitolite.nix or use the function independently of gitolite.customHooks.

@bake Yeah, that seems to be the behaviour of the script. Have you tried providing the whole path like this? In the end these are just file paths so you can append strings to it.

services.gitolite.commonHooks = [
"${pkgs.writeTextFile { yourstuffhere }}/post-receive"

@erictapen it actually worked, thank you! i didn't think about just appending the scripts name.

@bake Glad it helped. Yeah I guess that's something always handy to know: That Nix derivations just evalualate to Strings (or actually Paths).

Sign in to participate in the conversation

Cybrespace is an instance of Mastodon, a social network based on open web protocols and free, open-source software. It is decentralized like e-mail.