Copy dnsmasq NixNG image creation to here
Create GC roots for k8s manifests
This commit is contained in:
parent
cf8d278219
commit
1ee319f179
7 changed files with 222 additions and 22 deletions
41
modules/dnsmasq-image.nix
Normal file
41
modules/dnsmasq-image.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ globals, nixpkgs, nglib, ... }:
|
||||
nglib.makeSystem {
|
||||
inherit nixpkgs;
|
||||
system = "x86_64-linux";
|
||||
name = "nixng-dnsmasq";
|
||||
|
||||
config = { ... }: {
|
||||
dumb-init = {
|
||||
enable = true;
|
||||
type.services = { };
|
||||
};
|
||||
|
||||
init.services.dnsmasq = {
|
||||
shutdownOnExit = true;
|
||||
};
|
||||
|
||||
services.dnsmasq = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
address = [
|
||||
"/kms.kun.is/${globals.kmsIPv4}"
|
||||
"/ssh.git.kun.is/${globals.gitIPv4}"
|
||||
];
|
||||
|
||||
alias = "${globals.routerPublicIPv4},${globals.traefikIPv4}";
|
||||
expand-hosts = true;
|
||||
local = "/dmz/";
|
||||
log-queries = true;
|
||||
no-hosts = true;
|
||||
no-resolv = true;
|
||||
port = 53;
|
||||
|
||||
server = [
|
||||
"192.168.30.1"
|
||||
"/kun.is/${globals.bind9IPv4}"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,4 +1,20 @@
|
|||
{ globals, config, lib, ... }: {
|
||||
{ nixpkgs, pkgs, nixng, globals, config, lib, ... }:
|
||||
let
|
||||
dnsmasqStream = (import ./dnsmasq-image.nix {
|
||||
inherit nixpkgs nixng globals;
|
||||
inherit (nixng) nglib;
|
||||
}).config.system.build.ociImage.stream;
|
||||
|
||||
dnsmasqImage = pkgs.stdenv.mkDerivation {
|
||||
name = "dnsmasq.tar";
|
||||
src = dnsmasqStream;
|
||||
dontUnpack = true;
|
||||
buildPhase = ''
|
||||
$src > $out
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
options.dnsmasq.enable = lib.mkEnableOption "dnsmasq";
|
||||
|
||||
config = lib.mkIf config.dnsmasq.enable {
|
||||
|
@ -10,7 +26,7 @@
|
|||
metadata.labels.app = "dnsmasq";
|
||||
|
||||
spec.containers.dnsmasq = {
|
||||
image = "nix:0/var/container_images/dnsmasq.tar";
|
||||
image = "nix:0${dnsmasqImage}";
|
||||
imagePullPolicy = "Always";
|
||||
|
||||
ports.dns = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue