feat: nixpkg

Signed-off-by: jolheiser <john.olheiser@gmail.com>
nixpkg
jolheiser 2023-07-05 16:48:24 -05:00
parent ac63841684
commit bc7aba1db4
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
5 changed files with 42 additions and 9 deletions

View File

@ -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 ## License

View File

@ -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"]

View File

@ -1 +0,0 @@
Delete this file and put something else here!

View File

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

16
tmpl.yaml 100644
View File

@ -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