depot/go/nix/nixdrv/localfs.go

23 lines
336 B
Go

package nixdrv
import (
"bufio"
"os"
)
type LocalFSResolver struct{}
func (LocalFSResolver) LoadDerivation(path string) (*Derivation, error) {
f, err := os.Open(path)
if err != nil {
return nil, err
}
defer f.Close()
bio := bufio.NewReader(f)
drv, err := Load(bio)
if err != nil {
return nil, err
}
return drv, nil
}