nix-config/hosts/leoncloud/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

82 lines
2.0 KiB
Nix
Raw Normal View History

{ zentralwerk, config, lib, pkgs, ... }:
2022-09-05 22:17:11 +02:00
{
microvm = {
2022-09-24 03:00:42 +02:00
mem = 4024;
2022-09-05 22:17:11 +02:00
writableStoreOverlay = "/nix/.rw-store";
2022-09-23 18:28:38 +02:00
volumes = [ {
image = "/dev/zvol/tank/storage/leoncloud/nix-store-overlay";
mountPoint = config.microvm.writableStoreOverlay;
size = 32 * 1024;
} ];
};
2022-09-23 18:28:38 +02:00
nix.settings.auto-optimise-store = lib.mkForce false;
2022-09-23 18:28:38 +02:00
2022-09-05 22:17:11 +02:00
c3d2.deployment = {
server = "server9";
mounts = [ "etc" "home" "var"];
autoNetSetup = true;
2022-09-05 22:17:11 +02:00
};
networking = {
2022-09-25 20:29:42 +02:00
hostName = "leoncloud";
2022-09-05 22:17:11 +02:00
firewall.enable = true;
};
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
c3d2.hq.statistics.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
2022-09-25 21:11:03 +02:00
wget vim python3Full python310Packages.pip nmap htop wireguard-tools docker-compose
2022-09-05 22:17:11 +02:00
];
2022-09-21 01:36:39 +02:00
users.users.leoncloud = {
2022-09-05 22:17:11 +02:00
isNormalUser = true;
2022-09-24 03:00:42 +02:00
extraGroups = [ "wheel" "docker" ];
2022-09-05 22:17:11 +02:00
createHome = true;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM2zpmWA3Z9zshWaU8k1SWyJnbAyasOu9pV+9BvTY0XE leon@¯\_()_/¯"
2022-09-19 21:14:52 +02:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJPZoT83l0ogbJpviBs4VmO+NdF4NPtYAnyf8RRSoXsv leon@leon"
];
2022-09-05 22:17:11 +02:00
};
networking.firewall = {
2022-09-20 02:41:57 +02:00
allowedTCPPorts = [ 80 443 22 ];
2022-09-25 18:11:45 +02:00
allowedUDPPorts = [ 18800 ];
2022-09-05 22:17:11 +02:00
};
2022-09-19 21:13:38 +02:00
#------------------DOCKER----------------------------
virtualisation.docker.enable = true;
#------------------DOCKER----------------------------
2022-09-05 22:17:11 +02:00
2022-09-24 03:00:42 +02:00
#------------------Wireguard-client----------------------------
# Enable WireGuard
networking.wireguard.interfaces = {
2022-09-25 21:11:03 +02:00
vpn = {
2022-09-24 03:00:42 +02:00
ips = [ "10.10.11.4/24" ];
privateKeyFile = "/etc/nixos/wireguard-keys/private-key";
peers = [
{
publicKey = "w3qegSSuqFTFrGk4XJaWBSwGDOiqbnnAIR9MzwjYVA8=";
2022-09-25 21:11:03 +02:00
allowedIPs = [ "10.10.11.0" ];
2022-09-25 18:11:45 +02:00
endpoint = "45.158.40.162:18800";
2022-09-24 03:00:42 +02:00
persistentKeepalive = 25;
}
];
};
};
#------------------End----------------------------
2022-09-05 22:17:11 +02:00
system.stateVersion = "22.05";
}