1
0

Compare commits

...

2 Commits

Author SHA1 Message Date
Garionion
750e87181a enable qemu guest agent per default 2022-07-14 21:05:07 +02:00
Garionion
37c2affac9 add dns server 2022-07-14 21:04:27 +02:00
5 changed files with 79 additions and 2 deletions

View File

@ -5,10 +5,12 @@
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
# networking.useDHCP = false; TODO: why was this globally disabled? # networking.useDHCP = false; TODO: why was this globally disabled? Because it should be! DHCP should only be enabled per interface.
networking.firewall.allowedTCPPorts = [ 19999 ]; networking.firewall.allowedTCPPorts = [ 19999 ];
services.netdata.enable = true; services.netdata.enable = true;
services.qemuGuest.enable = true;
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
console = { console = {

View File

@ -26,6 +26,10 @@
deployment.targetUser = null; deployment.targetUser = null;
}; };
dns = { config, pkgs, ... }: {
deployment.targetHost = "dns.bula22.de";
};
monitoring = { config, pkgs, ... }: { monitoring = { config, pkgs, ... }: {
deployment.targetHost = "monitoring.bula22.de"; deployment.targetHost = "monitoring.bula22.de";
}; };
@ -40,7 +44,7 @@
}; };
pre-router = { config, pkgs, ... }: { pre-router = { config, pkgs, ... }: {
deployment.targetHost = "lightbuffet.entr0py.cloud"; deployment.targetHost = "lightbuffet.bula22.de";
deployment.keys = { deployment.keys = {
}; };

View File

@ -0,0 +1,31 @@
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./dns.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "dns-1"; # Define your hostname.
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
#networking.interfaces.ens18.useDHCP = false;
#networking.interfaces.ens19.useDHCP = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.11"; # Did you read the comment?
}

40
hosts/dns/dns.nix Normal file
View File

@ -0,0 +1,40 @@
{ config, pkgs, lib, ...}:
{
networking.firewall.interfaces.ens19.allowedUDPPorts = [ 53 ];
services.coredns = {
enable = true;
config = ''
.:53 {
log
cache
unbound
}
'';
package = lib.fix (self: (pkgs.buildGoModule {
inherit (pkgs.coredns) pname version src postPatch;
patches = pkgs.coredns.patches or [ ] ++ [
./coredns-unbound.patch
];
buildInputs = [ pkgs.unbound ];
vendorSha256 = "sha256-48S1oT+5uT6d+AM8u93AOTbJkW3CLtaowGv+th3cfyM=";
preBuild = ''
go generate
postInstall () {
cp go.mod $out
}
'';
}).overrideAttrs(old: {
preBuild = ''
cp ${self.passthru.go-modules}/go.mod .
go generate
'';
}));
};
}

View File