nixos/config/common.nix

98 lines
2.9 KiB
Nix

{ config, pkgs, ... }:
{
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# auto optimize store and experimental features
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
# Enable networking
networking.networkmanager.enable = true;
# we're using/prioritizing dnscrypt!
networking.nameservers = [ "127.0.0.1" "::1" ];
# resolved and others conflicts with setting dns here
networking.resolvconf.enable = pkgs.lib.mkForce false;
networking.dhcpcd.extraConfig = "nohook resolv.conf";
services.resolved.enable = false;
# also ensuring that networkmanager doesn't modify dns settings
networking.networkmanager.dns = "none";
# dnscrypt settings
services.dnscrypt-proxy2 = {
enable = true;
settings = {
ipv6_servers = true;
require_dnssec = true;
sources.public-resolvers = {
# of course, sourcing from the main public lists
urls = [
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
];
cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md";
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
};
# You can choose a specific set of servers from https://github.com/DNSCrypt/dnscrypt-resolvers/blob/master/v3/public-resolvers.md
# prioritize quad9, then adguard, and cloudflare as last resort
server_names = [ "quad9-dnscrypt-ip4-filter-pri" "quad9-doh-ip4-port443-filter-pri" "quad9-doh-ip6-port443-filter-pri" "adguard-dns-doh" "adguard-dns-ipv6" "cloudflare" "cloudflare-ipv6" ];
};
};
systemd.services.dnscrypt-proxy2.serviceConfig = {
StateDirectory = "dnscrypt-proxy";
};
# enable plymouth because it looks cool :)))
boot.plymouth = {
enable = true;
theme = "bgrt";
}
# Enable CUPS to print documents.
services.printing = {
enable = true;
drivers = with pkgs; [ canon-cups-ufr2 ];
};
services.avahi.enable = true;
services.avahi.nssmdns4 = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# wireplumber exists so, lets *not* use the example session
wireplumber.enable = true;
};
# gnupg is basically required for everything i use
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# virtualization stuff
virtualisation.libvirtd = {
enable = true;
#qemu.runAsRoot = false;
qemu.swtpm.enable = true;
};
virtualisation.spiceUSBRedirection.enable = true;
# waydroid
virtualisation.waydroid.enable = true;
}