Copy dnsmasq NixNG image creation to here

Create GC roots for k8s manifests
This commit is contained in:
Pim Kunis 2024-09-24 23:00:55 +02:00
parent cf8d278219
commit 1ee319f179
7 changed files with 222 additions and 22 deletions

View file

@ -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 = {