Skip to content

Commit

Permalink
nixos-http: support versioned releases
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Stephens <adam@valkor.net>
  • Loading branch information
adamcstephens committed Dec 15, 2023
1 parent 7007498 commit 7f14626
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sources/nixos-http.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ type nixos struct {
}

func (s *nixos) Run() error {
tarballURL := fmt.Sprintf("https://hydra.nixos.org/job/nixos/trunk-combined/nixos.lxdContainerImage.%s-linux/latest/download-by-type/file/system-tarball", s.definition.Image.ArchitectureMapped)
hydraRelease := fmt.Sprintf("release-%s", s.definition.Image.Release)

if s.definition.Image.Release == "unstable" {
hydraRelease = "trunk-combined"
}

tarballURL := fmt.Sprintf("https://hydra.nixos.org/job/nixos/%s/nixos.lxdContainerImage.%s-linux/latest/download-by-type/file/system-tarball", hydraRelease, s.definition.Image.ArchitectureMapped)

fpath, err := s.DownloadHash(s.definition.Image, tarballURL, "", nil)
if err != nil {
Expand Down

0 comments on commit 7f14626

Please sign in to comment.