executor

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildFunc added in v0.9.0

type BuildFunc func(ctx context.Context, drvPath string) error

type Derivation

type Derivation struct {
	Outputs Output `json:"outputs"`
}

type DerivationOutput added in v0.11.0

type DerivationOutput struct {
	Version     int                   `json:"version"`
	Derivations map[string]Derivation `json:"derivations"`
}

type EvalFunc added in v0.9.0

type EvalFunc func(ctx context.Context, repositoryPath, repositorySubdir, commitId, systemAttr, hostname string, submodules bool) (drvPath string, outPath string, machineId string, err error)

type Executor

type Executor interface {
	Eval(ctx context.Context, repositoryPath, repositorySubdir, commitId, systemAttr, hostname string, submodules bool) (drvPath string, outPath string, machineId string, err error)
	Build(ctx context.Context, drvPath string) (err error)
	Deploy(ctx context.Context, outPath, operation string, profilePaths []string) (needToRestartComin bool, profilePath string, err error)
	NeedToReboot(outPath, operation string) bool
	ReadMachineId() (string, error)
	// IsStorePathExist returns true if a storepath exists. This
	// is used to detect if a build will be required or not.
	IsStorePathExist(string) bool
}

Executor contains the function used by comin to actually do actions on the host. This allows us to abstract the way Nix expression are evaluated, built and deployed. This could be for instance used by a Garnix implementation (such as proposed in https://github.com/nlewo/comin/pull/74)

func NewNixDarwinFlake added in v0.10.0

func NewNixDarwinFlake() (e Executor, err error)

func NewNixOSFlake added in v0.10.0

func NewNixOSFlake() (e Executor, err error)

func NewNixOSNix added in v0.10.0

func NewNixOSNix() (e Executor, err error)

type NixFlakeLocal added in v0.10.0

type NixFlakeLocal struct {
	// contains filtered or unexported fields
}

func NewNixFlakeExecutor added in v0.10.0

func NewNixFlakeExecutor(systemAttr string) (*NixFlakeLocal, error)

func (*NixFlakeLocal) Build added in v0.10.0

func (n *NixFlakeLocal) Build(ctx context.Context, drvPath string) (err error)

func (*NixFlakeLocal) Deploy added in v0.10.0

func (n *NixFlakeLocal) Deploy(ctx context.Context, outPath, operation string, profilePaths []string) (needToRestartComin bool, profilePath string, err error)

func (*NixFlakeLocal) Eval added in v0.10.0

func (n *NixFlakeLocal) Eval(ctx context.Context, repositoryPath, repositorySubdir, commitId, systemAttr, hostname string, submodules bool) (drvPath string, outPath string, machineId string, err error)

func (*NixFlakeLocal) IsStorePathExist added in v0.10.0

func (n *NixFlakeLocal) IsStorePathExist(storePath string) bool

func (*NixFlakeLocal) List added in v0.10.0

func (n *NixFlakeLocal) List(flakeUrl string) (hosts []string, err error)

func (*NixFlakeLocal) NeedToReboot added in v0.10.0

func (n *NixFlakeLocal) NeedToReboot(outPath, operation string) bool

func (*NixFlakeLocal) ReadMachineId added in v0.10.0

func (n *NixFlakeLocal) ReadMachineId() (string, error)

func (*NixFlakeLocal) ShowDerivation added in v0.10.0

func (n *NixFlakeLocal) ShowDerivation(ctx context.Context, flakeUrl, hostname string) (drvPath string, outPath string, err error)

type NixLocal

type NixLocal struct{}

func NewNixExecutor

func NewNixExecutor() (*NixLocal, error)

func (*NixLocal) Build

func (n *NixLocal) Build(ctx context.Context, drvPath string) (err error)

func (*NixLocal) Deploy

func (n *NixLocal) Deploy(ctx context.Context, outPath, operation string, profilePaths []string) (needToRestartComin bool, profilePath string, err error)

func (*NixLocal) Eval

func (n *NixLocal) Eval(ctx context.Context, repositoryPath, repositorySubdir, commitId, systemAttr, hostname string, submodules bool) (drvPath string, outPath string, machineId string, err error)

func (*NixLocal) IsStorePathExist added in v0.9.0

func (n *NixLocal) IsStorePathExist(storePath string) bool

func (*NixLocal) NeedToReboot added in v0.9.0

func (n *NixLocal) NeedToReboot(outPath, operation string) bool

func (*NixLocal) ReadMachineId added in v0.9.0

func (n *NixLocal) ReadMachineId() (string, error)

type Output

type Output struct {
	Out Path `json:"out"`
}

type Path

type Path struct {
	Path string `json:"path"`
}

type Show

type Show struct {
	NixosConfigurations  map[string]struct{} `json:"nixosConfigurations"`
	DarwinConfigurations map[string]struct{} `json:"darwinConfigurations"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL