-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add flake-compat, fixup some issues, update docs
- Loading branch information
1 parent
06e806f
commit 71f246a
Showing
7 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,44 @@ | ||
## basic examples | ||
# basic examples | ||
|
||
## github tags fetcher | ||
|
||
```nix | ||
TODO | ||
github_tags = pog.pog { | ||
name = "github_tags"; | ||
description = "a nice wrapper for getting github tags for a repo!"; | ||
flags = [ | ||
{ | ||
name = "latest"; | ||
description = "fetch only the latest tag"; | ||
bool = true; | ||
} | ||
pog._.flags.github.owner | ||
pog._.flags.github.repo | ||
]; | ||
script = helpers: '' | ||
tags="$(${pog._.curl} -Ls "https://api.github.com/repos/''${owner}/''${repo}/tags" | | ||
${pkgs.lib.getExe pkgs.jaq} -r '.[].name')" | ||
if ${helpers.flag "latest"}; then | ||
echo "$tags" | ${pog._.head} -n 1 | ||
else | ||
echo "$tags" | ||
fi | ||
''; | ||
}; | ||
``` | ||
|
||
### generated docs | ||
|
||
```bash | ||
Usage: github_tags [-l|--latest] [-o|--owner VAR] [-r|--repo VAR] | ||
|
||
a nice wrapper for getting github tags for a repo! | ||
|
||
Flags: | ||
-l, --latest fetch only the latest tag [bool] | ||
-o, --owner the github user or organization that owns the repo [will prompt if not passed in] | ||
-r, --repo the github repo to pull tags from [will prompt if not passed in] | ||
-h, --help print this help and exit | ||
-v, --verbose enable verbose logging and info | ||
--no-color disable color and other formatting | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Getting Started | ||
|
||
## fetchTarball + import | ||
|
||
```nix | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
let | ||
inherit (builtins) fromJSON readFile; | ||
lock = fromJSON (readFile ./flake.lock); | ||
flake-compat = with lock.nodes.flake-compat.locked; import (fetchTarball { | ||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; | ||
sha256 = narHash; | ||
}); | ||
in | ||
(flake-compat { src = ./.; }).defaultNix |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters