2021-03-31 01:23:58 +02:00
|
|
|
{ hostName, inputs, pkgs, options, lib, ... }:
|
2021-03-05 20:05:50 +01:00
|
|
|
|
|
|
|
{
|
2021-04-06 22:34:05 +02:00
|
|
|
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"
|
|
|
|
];
|
2021-04-06 18:38:59 +02:00
|
|
|
# Includes wireguard
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
|
2021-03-05 20:05:50 +01:00
|
|
|
nix = {
|
|
|
|
package = pkgs.nixFlakes;
|
|
|
|
extraOptions = "experimental-features = nix-command flakes";
|
2021-03-26 21:10:21 +01:00
|
|
|
registry = {
|
|
|
|
nixpkgs.flake = inputs.nixpkgs;
|
|
|
|
};
|
2021-03-05 20:05:50 +01:00
|
|
|
};
|
|
|
|
|
2021-04-02 03:10:16 +02:00
|
|
|
documentation = {
|
|
|
|
enable = false;
|
|
|
|
nixos.enable = false;
|
|
|
|
};
|
|
|
|
|
2021-03-05 20:05:50 +01:00
|
|
|
environment.systemPackages = with pkgs; [
|
2021-04-02 03:10:16 +02:00
|
|
|
vim screen git wget psmisc
|
2021-04-08 02:31:53 +02:00
|
|
|
tcpdump iputils mtr traceroute bmon iptables conntrack-tools
|
2021-04-06 22:09:50 +02:00
|
|
|
bridge-utils dhcpcd ethtool
|
2021-03-05 20:05:50 +01:00
|
|
|
];
|
2021-03-22 22:38:15 +01:00
|
|
|
|
|
|
|
networking.hostName = hostName;
|
2021-03-22 23:37:25 +01:00
|
|
|
|
|
|
|
users.users.root.initialHashedPassword = "";
|
2021-03-25 04:07:18 +01:00
|
|
|
|
2021-04-02 03:10:16 +02:00
|
|
|
# for vm-packages
|
2021-03-31 01:23:58 +02:00
|
|
|
virtualisation = lib.optionalAttrs (builtins.hasAttr "qemu" options.virtualisation) {
|
2021-04-10 14:52:13 +02:00
|
|
|
# larger than the defaults
|
2021-04-02 03:10:16 +02:00
|
|
|
memorySize = 8192;
|
2021-04-10 14:52:13 +02:00
|
|
|
cores = 2;
|
2021-04-02 03:10:16 +02:00
|
|
|
diskSize = 8192;
|
2021-04-10 14:52:13 +02:00
|
|
|
# 9P performance optimization that quelches a qemu warning
|
|
|
|
msize = 65536;
|
|
|
|
# allow building packages
|
2021-04-02 03:10:16 +02:00
|
|
|
writableStore = true;
|
2021-04-10 14:52:13 +02:00
|
|
|
# keep the store paths built inside the VM across reboots
|
2021-04-02 03:10:16 +02:00
|
|
|
writableStoreUseTmpfs = false;
|
2021-03-31 01:23:58 +02:00
|
|
|
qemu.options = [ "-enable-kvm" ];
|
|
|
|
};
|
|
|
|
|
2021-03-25 04:07:18 +01:00
|
|
|
system.stateVersion = "20.09";
|
2021-03-05 20:05:50 +01:00
|
|
|
}
|