modularize Unbound config and add to slab

This commit is contained in:
NullBite 2024-03-20 00:35:29 -04:00
parent 97d08df97a
commit b3664ac63f
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
4 changed files with 17 additions and 1 deletions

View File

@ -12,7 +12,6 @@
./hardware-configuration.nix ./hardware-configuration.nix
# Encryption # Encryption
./luks.nix ./luks.nix
./unbound.nix
]; ];
config = { config = {
@ -52,6 +51,7 @@
nixfiles = { nixfiles = {
profile.pc.enable = true; profile.pc.enable = true;
programs.adb.enable = true; programs.adb.enable = true;
programs.unbound.enable = true;
common.remoteAccess.enable = true; common.remoteAccess.enable = true;
sessions.plasma.enable = lib.mkDefault false; sessions.plasma.enable = lib.mkDefault false;
sessions.hyprland.enable = lib.mkDefault true; sessions.hyprland.enable = lib.mkDefault true;

View File

@ -66,6 +66,7 @@
sessions.plasma.enable = lib.mkDefault false; sessions.plasma.enable = lib.mkDefault false;
programs = { programs = {
adb.enable = true; adb.enable = true;
unbound.enable = true;
}; };
}; };

View File

@ -3,5 +3,6 @@
imports = [ imports = [
./syncthing.nix ./syncthing.nix
./android.nix ./android.nix
./unbound.nix
]; ];
} }

View File

@ -0,0 +1,14 @@
{ pkgs, lib, config, ... }:
let
cfg = config.nixfiles.programs.unbound;
in
{
options.nixfiles.programs.unbound = {
enable = lib.mkEnableOption "unbound DNS server configuration";
};
config = lib.mkIf cfg.enable {
networking.networkmanager.dns = "none";
services.unbound.enable = true;
};
}