aboutsummaryrefslogtreecommitdiff
path: root/cluster/staging
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-11-29 14:21:12 +0100
committerAlex Auvolat <alex@adnab.me>2022-11-29 14:21:12 +0100
commitc9f9ed4c711b8db80ce03f9aff3f9cc25c568b3a (patch)
tree4bd31889ad7a90d930d6d41ac305457cbabacc25 /cluster/staging
parent105c08172827499504816106ffe1b61d76c2d4c8 (diff)
downloadnixcfg-c9f9ed4c711b8db80ce03f9aff3f9cc25c568b3a.tar.gz
nixcfg-c9f9ed4c711b8db80ce03f9aff3f9cc25c568b3a.zip
Deploy garage on staging using nix2 driver
Diffstat (limited to 'cluster/staging')
-rw-r--r--cluster/staging/app/garage/deploy/garage-nix2.hcl (renamed from cluster/staging/app/garage/deploy/garage-nix-exec2.hcl)13
-rw-r--r--cluster/staging/cluster.nix21
2 files changed, 11 insertions, 23 deletions
diff --git a/cluster/staging/app/garage/deploy/garage-nix-exec2.hcl b/cluster/staging/app/garage/deploy/garage-nix2.hcl
index ad36b4e..a60b506 100644
--- a/cluster/staging/app/garage/deploy/garage-nix-exec2.hcl
+++ b/cluster/staging/app/garage/deploy/garage-nix2.hcl
@@ -57,22 +57,21 @@ job "garage-staging" {
# }
task "server" {
- driver = "exec2"
+ driver = "nix2"
config {
- #command = "/usr/bin/env"
- command = "/run/current-system/sw/bin/nix"
- args = [
- "run",
+ packages = [
+ "bash", # so that we can enter a shell inside container
"git+https://git.deuxfleurs.fr/Deuxfleurs/garage.git?ref=nix-remove-system&rev=60c26fbc628d7b450ae39214b578ab6a30583d5c",
- "--",
- "server"
]
+ command = "garage"
+ args = [ "server" ]
bind = {
"/mnt/storage/garage-staging/data" = "/data",
"/mnt/ssd/garage-staging/meta" = "/meta",
}
}
+ user = "root"
template {
data = file("../config/garage.toml")
diff --git a/cluster/staging/cluster.nix b/cluster/staging/cluster.nix
index 79e3cf0..71a8d98 100644
--- a/cluster/staging/cluster.nix
+++ b/cluster/staging/cluster.nix
@@ -77,16 +77,16 @@
## EXPERIMENTAL ON STAGING: NIX NOMAD JOBS
services.nomad.dropPrivileges = false;
- # ----- nomad-driver-nix & nomad-driver-exec2 -----
+ # ----- nomad-driver-nix & nomad-driver-nix2 -----
services.nomad.extraSettingsPlugins =
let nomad_driver_nix = import ./nomad-driver-nix.nix { inherit pkgs; };
- nomad_driver_exec2 = import ./nomad-driver-exec2.nix { inherit pkgs; };
+ nomad_driver_nix2 = import ./nomad-driver-nix2.nix { inherit pkgs; };
in [
(pkgs.symlinkJoin {
name = "nomad-drivers";
paths = [
nomad_driver_nix
- nomad_driver_exec2
+ nomad_driver_nix2
];
})
];
@@ -99,22 +99,11 @@
# default config for the exec2 driver
services.nomad.settings.plugin = [
{
- "exec2-driver" = [
+ "nix2-driver" = [
{
config = [
{
- bind_read_only = {
- "/etc/static" = "/etc/static";
- "/etc/passwd" = "/etc/passwd";
- "/etc/resolv.conf" = "/etc/resolv.conf";
- "/etc/nix/nix.conf" = "/etc/nix/nix.conf";
- "/etc/ssl" = "/etc/ssl";
- "/etc/nsswitch.conf" = "/etc/nsswitch.conf";
- "/nix" = "/nix";
- "/bin" = "/bin";
- "/usr" = "/usr";
- "/run/current-system/sw" = "/run/current-system/sw";
- };
+ # default_nixpkgs = "github:nixos/nixpkgs/nixos-22.11";
}
];
}