about summary refs log tree commit diff
path: root/modules/services
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-11-05 13:26:49 -0700
committerFranck Cuny <franck@fcuny.net>2022-11-06 19:27:33 -0800
commit9038f3998dcc66f2ca091100f857a518fe201212 (patch)
tree6e0ff5e7b3ee7367d1fedbf57a407040b8b8ec49 /modules/services
parentRevert "ref(drone): remove all modules and configurations" (diff)
downloadworld-9038f3998dcc66f2ca091100f857a518fe201212.tar.gz
fix(services/drone): enable drone
The URL for drone changed to https://ci.fcuny.net. The secrets also
changed (and we remove the unencrypted file with secrets).
Diffstat (limited to 'modules/services')
-rw-r--r--modules/services/drone/runner-exec/default.nix7
-rw-r--r--modules/services/drone/server/default.nix7
2 files changed, 6 insertions, 8 deletions
diff --git a/modules/services/drone/runner-exec/default.nix b/modules/services/drone/runner-exec/default.nix
index 01cc11b..cbfbb9d 100644
--- a/modules/services/drone/runner-exec/default.nix
+++ b/modules/services/drone/runner-exec/default.nix
@@ -19,10 +19,12 @@ in
           "DRONE_SERVER_PROTO=https"
           "DRONE_RUNNER_CAPACITY=10"
           "CLIENT_DRONE_RPC_HOST=127.0.0.1:${toString cfg.port}"
-          "NIX_REMOTE=daemon"
           "PAGER=cat"
         ];
-        BindPaths = [ "/nix/var/nix/daemon-socket/socket" ];
+        BindPaths = [
+          "/nix/var/nix/daemon-socket/socket"
+          "/var/run/docker.sock"
+        ];
         BindReadOnlyPaths = [
           "/etc/resolv.conf:/etc/resolv.conf"
           "/etc/resolvconf.conf:/etc/resolvconf.conf"
@@ -49,6 +51,7 @@ in
     users.users.drone-runner-exec = {
       isSystemUser = true;
       group = "drone-runner-exec";
+      extraGroups = [ "docker" ]; # Give access to the daemon
     };
     users.groups.drone-runner-exec = { };
   };
diff --git a/modules/services/drone/server/default.nix b/modules/services/drone/server/default.nix
index 97e20a3..77f4ee2 100644
--- a/modules/services/drone/server/default.nix
+++ b/modules/services/drone/server/default.nix
@@ -36,18 +36,13 @@ in
 
     services.nginx.virtualHosts."${cfg.vhostName}" = {
       forceSSL = true;
-      useACMEHost = cfg.vhostName;
+      enableACME = true;
       locations."/" = {
         proxyPass = "http://127.0.0.1:${toString cfg.port}";
         proxyWebsockets = true;
       };
     };
 
-    security.acme.certs."${cfg.vhostName}" = {
-      dnsProvider = "gcloud";
-      credentialsFile = secrets."acme/credentials".path;
-    };
-
     my.services.backup = { paths = [ "/var/lib/droner-server" ]; };
   };
 }