Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vano2903/nixpacks-go
nixpacks go sdk
https://github.com/vano2903/nixpacks-go
nix nixpacks nixpacks-wrapper
Last synced: 8 days ago
JSON representation
nixpacks go sdk
- Host: GitHub
- URL: https://github.com/vano2903/nixpacks-go
- Owner: Vano2903
- License: mit
- Created: 2023-03-14T07:53:38.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-03T13:22:42.000Z (8 months ago)
- Last Synced: 2024-11-09T03:16:44.724Z (2 months ago)
- Topics: nix, nixpacks, nixpacks-wrapper
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nixpacks-go
nixpacks-go is a golang sdk for [nixpacks](https://github.com/railwayapp/nixpacks).
## Dependencies
This sdk calls the shell script `nixpacks` so make sure to have it installed.
The sdk was build on top of version `1.4.2`If you dont have nixpacks installed you can check the documentation at: https://nixpacks.com/docs/install
## Example
```go
package mainimport (
"context"
"fmt"nixpacks "github.com/vano2903/nixpacks-go"
)func main(){
n, err := nixpacks.NewNixpacks()
if err != nil {
panic(err)
}cmd, err := n.Build(context.Background(), nixpacks.BuildOptions{
Path: "path/to/directory/to/build",
Name: "image-name",
})
if err != nil {
panic(err)
}out, err := cmd.Result()
if err != nil {
panic(err)
}fmt.Println(out.ImageName)
}
```---
This sdk is still under development and is not ready for a production environment.
Most of the options to build and plan an image are implemented but there are still some missing (about cache mainly).
Feel free to contribute to this project and open issues if you find any bugs or have any suggestions.