drone.server: modularise
This commit is contained in:
parent
89374c44dc
commit
785a17059d
@ -3,7 +3,6 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/common/default.nix
|
../../modules/common/default.nix
|
||||||
../../modules/drone/server.nix
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -21,6 +20,7 @@
|
|||||||
## Custom Services
|
## Custom Services
|
||||||
custom = {
|
custom = {
|
||||||
locations.autoServe = true;
|
locations.autoServe = true;
|
||||||
|
drone.server.path = "/data/drone";
|
||||||
};
|
};
|
||||||
|
|
||||||
## Networking
|
## Networking
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
./chia.nix
|
./chia.nix
|
||||||
./common/hostinfo.nix
|
./common/hostinfo.nix
|
||||||
./desktop/awesome/default.nix
|
./desktop/awesome/default.nix
|
||||||
|
./drone/default.nix
|
||||||
./impermanence.nix
|
./impermanence.nix
|
||||||
./locations.nix
|
./locations.nix
|
||||||
./resilio.nix
|
./resilio.nix
|
||||||
|
7
modules/drone/default.nix
Normal file
7
modules/drone/default.nix
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./server.nix
|
||||||
|
];
|
||||||
|
}
|
@ -1,25 +1,43 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.custom.drone.server;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
config.age.secrets."drone/gitea_client_secret".file = ../../secrets/drone/gitea_client_secret.age;
|
options.custom.drone.server = {
|
||||||
config.age.secrets."drone/rpc_secret".file = ../../secrets/drone/rpc_secret.age;
|
enable = lib.mkEnableOption "drone server";
|
||||||
|
|
||||||
config.virtualisation.oci-containers.containers."drone" = {
|
path = lib.mkOption {
|
||||||
image = "drone/drone:2.16.0";
|
type = lib.types.str;
|
||||||
volumes = [ "/data/drone:/data" ];
|
default = "/var/lib/drone";
|
||||||
ports = [ "18733:80" ];
|
};
|
||||||
environment = {
|
port = lib.mkOption {
|
||||||
DRONE_AGENTS_ENABLED = "true";
|
type = lib.types.port;
|
||||||
DRONE_GITEA_SERVER = "https://gitea.hillion.co.uk";
|
default = 18733;
|
||||||
DRONE_GITEA_CLIENT_ID = "687ee331-ad9e-44fd-9e02-7f1c652754bb";
|
};
|
||||||
DRONE_SERVER_HOST = "drone.hillion.co.uk";
|
};
|
||||||
DRONE_SERVER_PROTO = "https";
|
|
||||||
DRONE_LOGS_DEBUG = "true";
|
config = lib.mkIf cfg.enable {
|
||||||
DRONE_USER_CREATE = "username:JakeHillion,admin:true";
|
age.secrets."drone/gitea_client_secret".file = ../../secrets/drone/gitea_client_secret.age;
|
||||||
|
age.secrets."drone/rpc_secret".file = ../../secrets/drone/rpc_secret.age;
|
||||||
|
|
||||||
|
virtualisation.oci-containers.containers."drone" = {
|
||||||
|
image = "drone/drone:2.21.0";
|
||||||
|
volumes = [ "${cfg.path}:/data" ];
|
||||||
|
ports = [ "${toString cfg.port}:80" ];
|
||||||
|
environment = {
|
||||||
|
DRONE_AGENTS_ENABLED = "true";
|
||||||
|
DRONE_GITEA_SERVER = "https://gitea.hillion.co.uk";
|
||||||
|
DRONE_GITEA_CLIENT_ID = "687ee331-ad9e-44fd-9e02-7f1c652754bb";
|
||||||
|
DRONE_SERVER_HOST = "drone.hillion.co.uk";
|
||||||
|
DRONE_SERVER_PROTO = "https";
|
||||||
|
DRONE_LOGS_DEBUG = "true";
|
||||||
|
DRONE_USER_CREATE = "username:JakeHillion,admin:true";
|
||||||
|
};
|
||||||
|
environmentFiles = [
|
||||||
|
config.age.secrets."drone/gitea_client_secret".path
|
||||||
|
config.age.secrets."drone/rpc_secret".path
|
||||||
|
];
|
||||||
};
|
};
|
||||||
environmentFiles = [
|
|
||||||
config.age.secrets."drone/gitea_client_secret".path
|
|
||||||
config.age.secrets."drone/rpc_secret".path
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,9 @@ in
|
|||||||
mastodon = "vm.strangervm.ts.hillion.co.uk";
|
mastodon = "vm.strangervm.ts.hillion.co.uk";
|
||||||
matrix = "jorah.cx.ts.hillion.co.uk";
|
matrix = "jorah.cx.ts.hillion.co.uk";
|
||||||
};
|
};
|
||||||
|
drone = {
|
||||||
|
server = "vm.strangervm.ts.hillion.co.uk";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -25,5 +28,7 @@ in
|
|||||||
custom.services.downloads.enable = cfg.locations.services.downloads == config.networking.fqdn;
|
custom.services.downloads.enable = cfg.locations.services.downloads == config.networking.fqdn;
|
||||||
custom.services.mastodon.enable = cfg.locations.services.mastodon == config.networking.fqdn;
|
custom.services.mastodon.enable = cfg.locations.services.mastodon == config.networking.fqdn;
|
||||||
custom.services.matrix.enable = cfg.locations.services.matrix == config.networking.fqdn;
|
custom.services.matrix.enable = cfg.locations.services.matrix == config.networking.fqdn;
|
||||||
|
|
||||||
|
custom.drone.server.enable = cfg.locations.drone.server == config.networking.fqdn;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ in
|
|||||||
reverse_proxy /_synapse/client/* http://${locations.services.matrix}:8008
|
reverse_proxy /_synapse/client/* http://${locations.services.matrix}:8008
|
||||||
'';
|
'';
|
||||||
"drone.hillion.co.uk".extraConfig = ''
|
"drone.hillion.co.uk".extraConfig = ''
|
||||||
reverse_proxy http://vm.strangervm.ts.hillion.co.uk:18733
|
reverse_proxy http://${locations.drone.server}:18733
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user