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

feat: remove tera from flake output #792

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tools/docgen/docgen.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{ self, ... }: {
perSystem = { pkgs, self', lib, config, ... }:
perSystem = { pkgs, self', lib, config, tera, ... }:
let
treefmt = config.treefmt.build.wrapper;
tera = "${self'.packages.tera}/bin/tera";
teraBin = "${tera}/bin/tera";
rootFile = "flake.nix";
doc_comment = "<!-- GENERATED: DO NOT EDIT -->";
in
{
packages = {
docgen = pkgs.writeShellApplication {
name = "docgen";
runtimeInputs = [ tera treefmt ];
runtimeInputs = [ teraBin treefmt ];
text = ''
if ! test -f "${rootFile}"; then
echo "Error: please run docgen from the root of the repository"
exit 1
fi

echo '{"doc_comment": "${doc_comment}"}' | ${tera} --template unionvisor/docs/README.md --include-path unionvisor -s -o unionvisor/README.md > /dev/null 2>&1
echo '{"doc_comment": "${doc_comment}"}' | ${teraBin} --template unionvisor/docs/README.md --include-path unionvisor -s -o unionvisor/README.md > /dev/null 2>&1
treefmt > /dev/null 2>&1
'';
};
Expand Down
22 changes: 10 additions & 12 deletions tools/tera/tera.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@
name = "tera";
in
{
packages = {
tera = crane.lib.buildPackage {
name = name;
version = "0.2.4";
src = pkgs.fetchFromGitHub {
name = "tera";
owner = "chevdor";
repo = "tera-cli";
rev = "fbccb741db347aa6c85a7d14d98bdc83ddc2dedd";
sha256 = "sha256-ZBlxikPa92qqKTCyOzFT6pVmNnGxw+0G0XTwzH/ST3w=";
};
meta.mainProgram = "tera";
_module.args.tera = crane.lib.buildPackage {
inherit name;
version = "0.2.4";
src = pkgs.fetchFromGitHub {
inherit name;
owner = "chevdor";
repo = "tera-cli";
rev = "fbccb741db347aa6c85a7d14d98bdc83ddc2dedd";
sha256 = "sha256-ZBlxikPa92qqKTCyOzFT6pVmNnGxw+0G0XTwzH/ST3w=";
};
meta.mainProgram = "tera";
};
};
}