Follow

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 nixos.org/nixos/options.html#s

@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"; }.

github.com/NixOS/nixpkgs/blob/

@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.
github.com/NixOS/nixpkgs/blob/

@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

cybrespace: the social hub of the information superhighway

jack in to the mastodon fediverse today and surf the dataflow through our cybrepunk, slightly glitchy web portal