diff --git a/README.md b/README.md index 4b65cbd..b1c921d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# tmpl templates +# nixpkg template for [tmpl](https://git.jojodev.com/jolheiser/tmpl) -Check out the various branches for some basic examples of templates. +Starting at the root of your NUR, this template generates a pkg. ## License diff --git a/template.toml b/template.toml deleted file mode 100644 index 1507fc7..0000000 --- a/template.toml +++ /dev/null @@ -1,6 +0,0 @@ -# template.toml -# Write any template args here to prompt the user for, giving any defaults/options as applicable - -name = "MyProject" - -lang = ["Go", "Rust", "Python"] diff --git a/template/.tmplkeep b/template/.tmplkeep deleted file mode 100644 index b4bd1aa..0000000 --- a/template/.tmplkeep +++ /dev/null @@ -1 +0,0 @@ -Delete this file and put something else here! \ No newline at end of file diff --git a/template/pkgs/{{gitea_repo}}/default.nix b/template/pkgs/{{gitea_repo}}/default.nix new file mode 100644 index 0000000..1dc0d8e --- /dev/null +++ b/template/pkgs/{{gitea_repo}}/default.nix @@ -0,0 +1,24 @@ +{ buildGoModule, fetchFromGitea, lib, ... }: +buildGoModule rec { + pname = "{{gitea_repo}}"; + version = "{{version}}"; + + src = fetchFromGitea { + domain = "{{gitea_domain}}"; + owner = "{{gitea_user}}"; + repo = "{{gitea_repo}}"; + rev = "v${version}"; + sha256 = lib.fakeSha256; + }; + + vendorSha256 = lib.fakeSha256; + + ldflags = [ "-s" "-w" "-X={{version_package}}.Version=${version}" ]; + + meta = with lib; { + description = "{{description}}"; + homepage = "https://{{gitea_domain}}/{{gitea_user}}/{{gitea_repo}}"; + license = licenses.mit; + }; +} + diff --git a/tmpl.yaml b/tmpl.yaml new file mode 100644 index 0000000..7d95656 --- /dev/null +++ b/tmpl.yaml @@ -0,0 +1,16 @@ +prompts: + - id: gitea_domain + label: Gitea Domain + default: git.jojodev.com + help: No protocol or trailing slash + - id: gitea_user + label: Gitea User + - id: gitea_repo + label: Gitea Repo + - id: version + label: Version + - id: version_package + label: Version Package + default: main + - id: description + label: Description \ No newline at end of file