mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-26 05:40:52 +01:00
deployment module
This commit is contained in:
parent
361d3c57c4
commit
7b8c08c068
4 changed files with 27 additions and 8 deletions
1
base.nix
1
base.nix
|
@ -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" ];
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
22
modules/deployment/default.nix
Normal file
22
modules/deployment/default.nix
Normal 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;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue