Conversation
Wrap github-cli `gh` using nix-wrapper-module
take the env block out of drv block inside config block
Add `import = [ wlib.modules.default ];`
wrapperModules/g/gh/module.nix
Outdated
| buildPhase = '' | ||
| runHook preBuild | ||
| mkdir -p "${placeholder config.outputName}/gh-config" | ||
| cp "$(cat "$configYmlPath")" "${placeholder config.outputName}/gh-config/config.yml" |
There was a problem hiding this comment.
Since we are already doing some complicated thing here to build the directory, we can make this do placeholders without much extra effort, if you want?
If you set config.drv.nativeBuildInputs = [ pkgs.remarshal_0_17 ];
You can then configContent = builtins.toJSON config.settings;
and json2yaml $configContentPath "${placeholder config.outputName}/gh-config/config.yml" instead of this copy command.
Which is how they do it in nixpkgs
Alternatively, if you don't want all that, we should be able to simplify this line to
cp "$configYml" "${placeholder config.outputName}/gh-config/config.yml"
and then remove the passAsFile, which is not necessary in this case. configYml in this case as it is currently written contains a path. A single path is very very unlikely to ever exceed the max length for a variable. So if we are going to continue using .generate, you don't need passAsFile there either.
pass configYml directly to buildPhase
|
So, I found a problem with this approach. It tries to write to its config directory, which is now in the store. Any chance we can do this with |
|
Uh, yeah, I wanted to tell you about this problem. A similar one arises where the file Also there's this issue on home-manager. Seems that |
Wrap github-cli
ghusing nix-wrapper-modules.