2022-11-28 16:06:00 +00:00
|
|
|
job "example" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "batch"
|
|
|
|
|
|
|
|
group "example" {
|
2022-11-28 17:30:33 +00:00
|
|
|
task "test-host-bin" {
|
|
|
|
driver = "exec2"
|
|
|
|
|
|
|
|
config {
|
|
|
|
command = "/bin/sh"
|
|
|
|
args = ["-c", "echo hello world"]
|
|
|
|
bind_read_only = {
|
|
|
|
"/bin" = "/bin",
|
|
|
|
"/lib" = "/lib",
|
|
|
|
"/lib64" = "/lib64",
|
|
|
|
"/usr" = "/usr",
|
|
|
|
"/nix" = "/nix",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
user = "lx"
|
|
|
|
}
|
|
|
|
|
|
|
|
task "test-nix-hello" {
|
2022-11-28 16:06:00 +00:00
|
|
|
driver = "exec2"
|
|
|
|
|
|
|
|
config {
|
2022-11-28 17:08:02 +00:00
|
|
|
command = "/sw/bin/nix"
|
|
|
|
args = [
|
|
|
|
"--extra-experimental-features", "flakes",
|
|
|
|
"--extra-experimental-features", "nix-command",
|
|
|
|
"run",
|
|
|
|
"github:NixOS/nixpkgs#hello"
|
|
|
|
]
|
|
|
|
bind = {
|
|
|
|
"/nix" = "/nix",
|
|
|
|
}
|
|
|
|
bind_read_only = {
|
|
|
|
"/home/lx/.nix-profile" = "/sw",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
user = "lx"
|
|
|
|
}
|
|
|
|
|
2022-11-28 17:30:33 +00:00
|
|
|
task "test-nix-store" {
|
2022-11-28 17:08:02 +00:00
|
|
|
driver = "exec2"
|
|
|
|
|
|
|
|
config {
|
|
|
|
command = "/nix/store/30j23057fqnnc1p4jqmq73p0gxgn0frq-bash-5.1-p16/bin/sh"
|
|
|
|
args = ["-c", "/nix/store/y41s1vcn0irn9ahn9wh62yx2cygs7qjj-coreutils-8.32/bin/ls /*; /nix/store/y41s1vcn0irn9ahn9wh62yx2cygs7qjj-coreutils-8.32/bin/id"]
|
2022-11-28 16:06:00 +00:00
|
|
|
bind_read_only = {
|
|
|
|
"/nix" = "/nix",
|
|
|
|
}
|
|
|
|
}
|
2022-11-28 17:08:02 +00:00
|
|
|
user = "lx"
|
2022-11-28 16:06:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|