store: local store

This just returns the verbatim string.
This commit is contained in:
Ophestra 2025-07-23 11:49:23 +09:00
parent e0278a6d7d
commit b6961508e8
Signed by: cat
SSH Key Fingerprint: SHA256:wr6yH7sDDbUFi81k/GsIGwpM3O2QrwqYlLF26CcJa4w
2 changed files with 16 additions and 0 deletions

View File

@ -12,6 +12,12 @@ type Store interface {
fmt.Stringer fmt.Stringer
} }
// Local points to a local filesystem path containing a nix store.
type Local string
func (Local) Environ() []string { return nil }
func (store Local) String() string { return string(store) }
const ( const (
EnvAwsSharedCredentialsFile = "AWS_SHARED_CREDENTIALS_FILE" EnvAwsSharedCredentialsFile = "AWS_SHARED_CREDENTIALS_FILE"
) )

View File

@ -6,6 +6,16 @@ import (
"gensokyo.uk/nix" "gensokyo.uk/nix"
) )
func TestLocal(t *testing.T) {
if got := nix.Local("/").String(); got != "/" {
t.Errorf("String: %v, want %v", got, "/")
}
if got := nix.Local("").Environ(); got != nil {
t.Errorf("Environ: %v, want %v", got, nil)
}
}
func TestBinaryCache(t *testing.T) { func TestBinaryCache(t *testing.T) {
testCases := []struct { testCases := []struct {
name string name string