network/nix/nixos-module/defaults.nix

53 lines
1.3 KiB
Nix

{ hostName, inputs, pkgs, options, lib, ... }:
{
boot.kernelParams = [
# No server/router runs any untrusted user code
"mitigations=off"
# Prevents automatic creation of interface bond0 by the kernel
"bonding.max_bonds=0"
];
# Includes wireguard
boot.kernelPackages = pkgs.linuxPackages_latest;
nix = {
package = pkgs.nixFlakes;
extraOptions = "experimental-features = nix-command flakes";
registry = {
nixpkgs.flake = inputs.nixpkgs;
};
};
documentation = {
enable = false;
nixos.enable = false;
};
environment.systemPackages = with pkgs; [
vim screen git wget psmisc
tcpdump iputils mtr traceroute bmon iptables conntrack-tools
bridge-utils dhcpcd ethtool
];
networking.hostName = hostName;
users.users.root.initialHashedPassword = "";
# for vm-packages
virtualisation = lib.optionalAttrs (builtins.hasAttr "qemu" options.virtualisation) {
# larger than the defaults
memorySize = 8192;
cores = 2;
diskSize = 8192;
# 9P performance optimization that quelches a qemu warning
msize = 65536;
# allow building packages
writableStore = true;
# keep the store paths built inside the VM across reboots
writableStoreUseTmpfs = false;
qemu.options = [ "-enable-kvm" ];
};
system.stateVersion = "20.09";
}