aboutsummaryrefslogtreecommitdiff
path: root/example/example-batch.hcl
diff options
context:
space:
mode:
Diffstat (limited to 'example/example-batch.hcl')
-rw-r--r--example/example-batch.hcl27
1 files changed, 25 insertions, 2 deletions
diff --git a/example/example-batch.hcl b/example/example-batch.hcl
index a4dc946..15635f9 100644
--- a/example/example-batch.hcl
+++ b/example/example-batch.hcl
@@ -12,8 +12,11 @@ job "nix2-example-batch" {
driver = "nix2"
config {
+ # Packages contains a list of Nix flakes to include in the environement.
+ # Entries that start with # will be relative to nixpkgs.
+ # Otherwise, they are flake names that are passed directly to Nix build
packages = [
- "hello" # equivalent to "github:nixos/nixpkgs/nixos-22.05#hello"
+ "#hello" # equivalent to "github:nixos/nixpkgs/nixos-22.05#hello"
]
command = "hello"
}
@@ -31,7 +34,7 @@ job "nix2-example-batch" {
config {
packages = [
- "curl", "cacert"
+ "#curl", "#cacert"
]
command = "curl"
args = [
@@ -42,5 +45,25 @@ job "nix2-example-batch" {
SSL_CERT_FILE = "/etc/ssl/certs/ca-bundle.crt"
}
}
+
+ # This example show how to use a flake defined from a file
+ task "nix-hello-flake" {
+ driver = "nix2"
+
+ config {
+ # Packages contains a list of Nix flakes to include in the environement.
+ # Entries that start with # will be relative to nixpkgs.
+ # Otherwise, they are flake names that are passed directly to Nix build
+ packages = [
+ ".#hello"
+ ]
+ command = "hello"
+ }
+
+ template {
+ data = file("flake.nix")
+ destination = "flake.nix"
+ }
+ }
}
}