lots of shit

This commit is contained in:
fwastring 2025-10-06 13:33:47 +02:00
parent b55175a527
commit 5d10961778
17 changed files with 475 additions and 256 deletions

View file

@ -0,0 +1,79 @@
{
lib,
config,
...
}:
let
cfg = config.adguardhome;
in
with lib;
{
options = {
adguardhome = {
enable = mkEnableOption "enables AdGuardHome";
port = lib.mkOption {
type = lib.types.int;
default = 3000;
description = "The port that AdGuardHome is served on.";
};
};
};
config = mkMerge [
(mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [ 53 cfg.port ];
networking.firewall.allowedUDPPorts = [ 53 ];
services.adguardhome = {
enable = true;
settings = {
http = {
# You can select any ip and port, just make sure to open firewalls where needed
address = "0.0.0.0:${cfg.port toString}";
};
dns = {
upstream_dns = [
# Example config with quad9
"9.9.9.9#dns.quad9.net"
"149.112.112.112#dns.quad9.net"
# Uncomment the following to use a local DNS service (e.g. Unbound)
# Additionally replace the address & port as needed
# "127.0.0.1:5335"
];
rewrites = [
{
domain = "macmini.local";
answer = "192.168.1.100";
}
{
domain = "centre.local";
answer = "192.168.1.227";
}
];
};
filtering = {
protection_enabled = true;
filtering_enabled = true;
parental_enabled = false; # Parental control-based DNS requests filtering.
safe_search = {
enabled = false; # Enforcing "Safe search" option for search engines, when possible.
};
};
# The following notation uses map
# to not have to manually create {enabled = true; url = "";} for every filter
# This is, however, fully optional
# filters =
# map
# (url: {
# enabled = true;
# url = url;
# })
# [
# "https://adguardteam.github.io/HostlistsRegistry/assets/filter_9.txt" # The Big List of Hacked Malware Web Sites
# "https://adguardteam.github.io/HostlistsRegistry/assets/filter_11.txt" # malicious url blocklist
# ];
};
};
})
];
}

View file

@ -0,0 +1,54 @@
{
lib,
pkgs,
config,
...
}:
with lib;
{
options = {
mpd = {
enable = mkEnableOption "enables MPD";
port = lib.mkOption {
type = lib.types.int;
default = 6600;
description = "The port that MPD is served on.";
};
httpPort = lib.mkOption {
type = lib.types.int;
default = 8006;
description = "The port that MPD is served on.";
};
musicDir = lib.mkOption {
type = lib.types.str;
default = "/home/fw/Music";
description = "the path to the Music";
};
};
};
config = mkMerge [
(mkIf config.mpd.enable {
services.mpd = {
enable = true;
user = "fw";
group = "users";
network = {
port = config.mpd.port;
listenAddress = "any";
};
musicDirectory = config.mpd.musicDir;
extraConfig = ''
audio_output {
type "httpd"
name "My HTTP Stream"
encoder "vorbis" # or "mp3" if you have lame installed
port "${toString config.mpd.httpPort}" # default HTTP port
bind_to_address "0.0.0.0" # listen on all network interfaces
quality "5.0" # Ogg Vorbis quality
}
'';
};
})
];
}

View file

@ -38,10 +38,10 @@ with lib;
logtail.enabled = false;
dns = {
base_domain = config.headscale.baseDomain;
nameservers.global = [
"1.1.1.1"
"8.8.8.8"
];
nameservers.global = [
"1.1.1.1"
"8.8.8.8"
];
};
};
};