deployment module

This commit is contained in:
Julien Malka 2023-07-27 21:08:00 +02:00
parent 361d3c57c4
commit 7b8c08c068
Signed by: Luj
GPG key ID: 6FC74C847011FD83
4 changed files with 27 additions and 8 deletions

View file

@ -6,6 +6,7 @@
#luj.secrets.enable = true;
luj.ssh-server.enable = true;
luj.programs.mosh.enable = true;
luj.deployment.enable = true;
sops.defaultSopsFile = ./secrets/secrets.yaml;
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];

View file

@ -14,12 +14,6 @@
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
deployment = {
targetHost = "core-security.luj";
targetPort = 45;
targetUser = "root";
};
security.acme.defaults.email = "julien@malka.sh";
networking.hostName = "core-security"; # Define your hostname.

View file

@ -12,6 +12,8 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
deployment.buildOnTarget = true;
networking.hostName = "lambda";
time.timeZone = "Europe/Paris";
@ -56,7 +58,7 @@
};
};
security.acme.certs."uptime.luj".server = "https://ca.luj:8444/acme/acme/directory";
security.acme.certs."uptime.luj".server = "https://ca.luj/acme/acme/directory";
services.nginx.virtualHosts."uptime.luj" = {
forceSSL = true;
@ -92,7 +94,7 @@
};
security.acme.certs."prometheus.luj".server = "https://ca.luj:8444/acme/acme/directory";
security.acme.certs."prometheus.luj".server = "https://ca.luj/acme/acme/directory";
services.nginx.virtualHosts."prometheus.luj" = {
forceSSL = true;
enableACME = true;

View file

@ -0,0 +1,22 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.luj.deployment;
hostname = config.networking.hostName;
in
{
options.luj.deployment.enable = mkEnableOption "activate deployment on machine";
config = mkIf cfg.enable {
deployment = {
targetHost = "${hostname}.${lib.luj.machines.${hostname}.tld}";
targetPort = 45;
targetUser = "root";
allowLocalDeployment = true;
};
};
}