2024-11-19 10:31:29 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
2024-03-21 15:00:36 +01:00
|
|
|
with lib;
|
|
|
|
with lib.metacfg;
|
|
|
|
{
|
2024-11-19 10:31:29 +01:00
|
|
|
imports = [ ./hardware-configuration.nix ];
|
2024-03-21 15:00:36 +01:00
|
|
|
|
|
|
|
boot.kernel.sysctl."net.ipv4.conf.all.route_localnet" = 1;
|
2024-06-03 13:21:50 +02:00
|
|
|
boot.kernelPackages = lib.mkOverride 0 pkgs.linuxPackages_latest;
|
|
|
|
|
2024-03-21 15:00:36 +01:00
|
|
|
networking.firewall.extraCommands = ''
|
|
|
|
iptables -t nat -A OUTPUT -o lo -p tcp --dport 8081 -j DNAT --to-destination 192.168.122.1:8081
|
|
|
|
iptables -t nat -A POSTROUTING -j MASQUERADE
|
|
|
|
'';
|
|
|
|
|
|
|
|
metacfg = {
|
|
|
|
base.enable = true;
|
|
|
|
nix-ld.enable = true;
|
|
|
|
nix.enable = true;
|
|
|
|
aesmd_dcap.enable = true;
|
2024-03-21 16:52:35 +01:00
|
|
|
podman.enable = true;
|
2024-11-19 10:31:29 +01:00
|
|
|
user.extraGroups = [
|
|
|
|
"docker"
|
|
|
|
"sgx"
|
|
|
|
];
|
2024-03-21 15:00:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
environment.etc."sgx_default_qcnl.conf".text = ''
|
|
|
|
{
|
2024-05-21 15:44:20 +02:00
|
|
|
"pccs_url": "https://192.168.122.1:8081/sgx/certification/v4/",
|
2024-03-21 15:00:36 +01:00
|
|
|
"use_secure_cert": false,
|
|
|
|
"collateral_service": "https://api.trustedservices.intel.com/sgx/certification/v4/",
|
|
|
|
"retry_times": 6,
|
|
|
|
"retry_delay": 10,
|
|
|
|
"pck_cache_expire_hours": 168,
|
|
|
|
"verify_collateral_cache_expire_hours": 168,
|
|
|
|
"local_cache_only": false
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
2024-03-21 16:52:35 +01:00
|
|
|
virtualisation = {
|
|
|
|
docker.enable = true;
|
|
|
|
podman.dockerCompat = false;
|
|
|
|
};
|
2024-03-21 15:00:36 +01:00
|
|
|
|
|
|
|
system.autoUpgrade = {
|
|
|
|
enable = true;
|
|
|
|
operation = "switch";
|
|
|
|
allowReboot = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
security.tpm2.enable = false;
|
|
|
|
security.tpm2.abrmd.enable = false;
|
|
|
|
|
|
|
|
networking.wireless.enable = false; # Enables wireless support via wpa_supplicant.
|
2024-07-05 15:48:19 +02:00
|
|
|
|
2024-06-28 12:17:40 +02:00
|
|
|
networking.firewall.allowPing = true;
|
2024-03-21 15:00:36 +01:00
|
|
|
|
|
|
|
powerManagement.cpuFreqGovernor = "ondemand";
|
|
|
|
|
2024-10-23 10:21:20 +02:00
|
|
|
systemd.user.extraConfig = "DefaultLimitNOFILE=32768";
|
|
|
|
|
|
|
|
security.pam.loginLimits = [
|
2024-11-19 10:31:29 +01:00
|
|
|
{
|
|
|
|
domain = "*";
|
|
|
|
item = "nofile";
|
|
|
|
type = "-";
|
|
|
|
value = "32768";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
domain = "*";
|
|
|
|
item = "memlock";
|
|
|
|
type = "-";
|
|
|
|
value = "32768";
|
|
|
|
}
|
2024-10-23 10:21:20 +02:00
|
|
|
];
|
|
|
|
|
2024-03-21 15:00:36 +01:00
|
|
|
system.stateVersion = "23.11";
|
|
|
|
}
|