package
1.6.112
Repository: https://github.com/hernad/nomad.git
Documentation: pkg.go.dev

# README

Nomad Nix Driver Plugin

origin: https://git.deuxfleurs.fr/Deuxfleurs/nomad-driver-nix2

A Nomad driver to run Nix jobs. Uses the same isolation mechanism as the exec driver. Partially based on nomad-driver-nix

Requirements

  • Go v1.19 or later (to compile the plugin)
  • Nomad v1.3 or later (to run the plugin)
  • Nix v2.11 or later (to run the plugin), either through NixOS or installed in root mode

Building and using the Nix driver plugin

To build the plugin and run a dev agent:

$ make build
$ nomad agent -dev -config=./example/agent.hcl -plugin-dir=$(pwd)

# in another shell
$ nomad run ./example/example-batch.hcl
$ nomad run ./example/example-service.hcl
$ nomad logs <ALLOCATION ID>

Writing Nix job specifications

See documentation comments in example HCL files.

# Functions

NewPlugin returns a new DrivePlugin implementation.

# Variables

PluginConfig is the rawexec factory function registered in the plugin catalog.
PluginID is the exec plugin metadata registered in the plugin catalog.

# Structs

Config is the driver configuration set by the SetConfig RPC call.
No description provided by the author
TaskConfig is the driver configuration of a task within a job.
TaskState is the state which is encoded in the handle returned in StartTask.