aboutsummaryrefslogtreecommitdiff
path: root/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'cluster')
-rw-r--r--cluster/staging/app/dummy/deploy/dummy-nginx.hcl39
-rw-r--r--cluster/staging/node/cariacou.nix18
2 files changed, 12 insertions, 45 deletions
diff --git a/cluster/staging/app/dummy/deploy/dummy-nginx.hcl b/cluster/staging/app/dummy/deploy/dummy-nginx.hcl
index 5f3d5f6..8e2dd43 100644
--- a/cluster/staging/app/dummy/deploy/dummy-nginx.hcl
+++ b/cluster/staging/app/dummy/deploy/dummy-nginx.hcl
@@ -5,17 +5,6 @@ job "dummy-nginx" {
group "nginx" {
count = 1
- volume "nix-store" {
- type = "host"
- source = "nix-store"
- read_only = true
- }
- volume "nix-current-system-bin" {
- type = "host"
- source = "nix-current-system-bin"
- read_only = true
- }
-
network {
port "http" {
to = 8080
@@ -23,32 +12,12 @@ job "dummy-nginx" {
}
task "not-actually-nginx" {
- driver = "exec"
+ driver = "nix"
config {
- command = "env"
- args = [
- "/run/current-system/sw/bin/nix-shell",
- "--run", "python3 -m http.server 8080"
+ packages = [
+ "github:nixos/nixpkgs/nixos-21.05#python3",
]
- }
- env = {
- NIX_PATH = "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
- }
-
- volume_mount {
- volume = "nix-store"
- read_only = true
- destination = "/nix"
- }
- volume_mount {
- volume = "nix-current-system-bin"
- read_only = true
- destination = "/run/current-system/sw/bin"
- }
-
- template {
- data = file("shell.nix")
- destination = "shell.nix"
+ command = [ "/bin/python3", "-m", "http.server", "8080" ]
}
}
diff --git a/cluster/staging/node/cariacou.nix b/cluster/staging/node/cariacou.nix
index 5662422..04e581d 100644
--- a/cluster/staging/node/cariacou.nix
+++ b/cluster/staging/node/cariacou.nix
@@ -24,14 +24,12 @@
# experimental: nomad as root, to enable exec driver
services.nomad.dropPrivileges = false;
- services.nomad.settings.client.host_volume = {
- "nix-store" = {
- path = "/nix";
- read_only = true;
- };
- "nix-current-system-bin" = {
- path = "/run/current-system/sw/bin";
- read_only = true;
- };
- };
+ services.nomad.extraPackages = [
+ pkgs.nix
+ ];
+ services.nomad.extraSettingsPlugins =
+ let nomad_driver_nix = import ./nomad-driver-nix.nix { inherit pkgs; };
+ in [ nomad_driver_nix ];
+ # the nix driver requires flakes to be enabled
+ nix.settings.experimental-features = [ "nix-command" "flakes" ];
}