about summary refs log tree commit diff
path: root/tvix/nar-bridge/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/nar-bridge/pkg')
-rw-r--r--tvix/nar-bridge/pkg/http/narinfo_get.go4
-rw-r--r--tvix/nar-bridge/pkg/http/narinfo_put.go6
-rw-r--r--tvix/nar-bridge/pkg/pathinfosvc/server.go4
3 files changed, 7 insertions, 7 deletions
diff --git a/tvix/nar-bridge/pkg/http/narinfo_get.go b/tvix/nar-bridge/pkg/http/narinfo_get.go
index a03aff7339fc..93192c03e52e 100644
--- a/tvix/nar-bridge/pkg/http/narinfo_get.go
+++ b/tvix/nar-bridge/pkg/http/narinfo_get.go
@@ -19,7 +19,7 @@ import (
 	"github.com/nix-community/go-nix/pkg/narinfo"
 	"github.com/nix-community/go-nix/pkg/narinfo/signature"
 	"github.com/nix-community/go-nix/pkg/nixbase32"
-	"github.com/nix-community/go-nix/pkg/nixpath"
+	"github.com/nix-community/go-nix/pkg/storepath"
 	log "github.com/sirupsen/logrus"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/status"
@@ -92,7 +92,7 @@ func renderNarinfo(
 	}
 
 	narInfo := narinfo.NarInfo{
-		StorePath:   path.Join(nixpath.StoreDir, string(nodeName)),
+		StorePath:   path.Join(storepath.StoreDir, string(nodeName)),
 		URL:         "nar/" + nixbase32.EncodeToString(narHash.Digest()) + ".nar",
 		Compression: "none", // TODO: implement zstd compression
 		NarHash:     narHash,
diff --git a/tvix/nar-bridge/pkg/http/narinfo_put.go b/tvix/nar-bridge/pkg/http/narinfo_put.go
index 831f93fbdf77..6494bca6f20d 100644
--- a/tvix/nar-bridge/pkg/http/narinfo_put.go
+++ b/tvix/nar-bridge/pkg/http/narinfo_put.go
@@ -9,7 +9,7 @@ import (
 	"github.com/go-chi/chi/v5"
 	"github.com/nix-community/go-nix/pkg/narinfo"
 	"github.com/nix-community/go-nix/pkg/nixbase32"
-	"github.com/nix-community/go-nix/pkg/nixpath"
+	"github.com/nix-community/go-nix/pkg/storepath"
 	"github.com/sirupsen/logrus"
 	log "github.com/sirupsen/logrus"
 )
@@ -82,7 +82,7 @@ func registerNarinfoPut(s *Server) {
 		// the bytes in pathInfo.References, and the full strings in pathInfo.Narinfo.ReferenceNames.
 		referencesBytes := make([][]byte, 0)
 		for _, reference := range narInfo.References {
-			np, err := nixpath.FromString(path.Join(nixpath.StoreDir, reference))
+			storePath, err := storepath.FromString(reference)
 			if err != nil {
 				log.WithField("reference", reference).WithError(err).Error("unable to parse reference")
 				w.WriteHeader(http.StatusBadRequest)
@@ -93,7 +93,7 @@ func registerNarinfoPut(s *Server) {
 
 				return
 			}
-			referencesBytes = append(referencesBytes, np.Digest)
+			referencesBytes = append(referencesBytes, storePath.Digest)
 		}
 
 		// assemble the []*storev1pb.NARInfo_Signature{} from narinfo.Signatures.
diff --git a/tvix/nar-bridge/pkg/pathinfosvc/server.go b/tvix/nar-bridge/pkg/pathinfosvc/server.go
index 545966b20448..116d06e6b6a9 100644
--- a/tvix/nar-bridge/pkg/pathinfosvc/server.go
+++ b/tvix/nar-bridge/pkg/pathinfosvc/server.go
@@ -16,7 +16,7 @@ import (
 	mh "github.com/multiformats/go-multihash/core"
 	"github.com/nix-community/go-nix/pkg/narinfo"
 	"github.com/nix-community/go-nix/pkg/nixbase32"
-	"github.com/nix-community/go-nix/pkg/nixpath"
+	"github.com/nix-community/go-nix/pkg/storepath"
 	"github.com/sirupsen/logrus"
 	"github.com/ulikunitz/xz"
 	"google.golang.org/grpc/codes"
@@ -246,7 +246,7 @@ func (p *PathInfoServiceServer) Get(ctx context.Context, getPathInfoRequest *sto
 
 	// set the root node name to the basename of the output path in the narInfo.
 	// currently the root node has no name yet.
-	outPath, err := nixpath.FromString(narInfo.StorePath)
+	outPath, err := storepath.FromAbsolutePath(narInfo.StorePath)
 	if err != nil {
 		// unreachable due to nixpath.Check()
 		panic(err)