1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-06 03:13:48 +02:00
goreleaser/internal/pipe/nix/template.go
Carlos Alexandro Becker 1e0d269c97
fix(nix): sourceRoot when using archives.wrap_in_directory (#4550)
If `archives.[*].wrap_in_directory` is set, it'll create a folder inside
the archive file, usually something like `app_goos_goarch`.

In those cases, the root of the archive is not constant, so we create a
`sourceRootMap` and use it instead.

In cases where the `sourceRoot` is constant, the generated derivation
will be the same.

refs https://github.com/orgs/goreleaser/discussions/4549

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-18 12:59:04 -03:00

27 lines
448 B
Go

package nix
import _ "embed"
//go:embed tmpl.nix
var pkgTmpl []byte
type Archive struct {
URL, Sha string
}
type templateData struct {
Name string
Version string
Install []string
PostInstall []string
SourceRoot string
SourceRoots map[string]string
Archives map[string]Archive
Description string
Homepage string
License string
Platforms []string
Inputs []string
Dependencies []string
}