75 lines
1.5 KiB
Nix
75 lines
1.5 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}: let
|
|
containerName = "semitamaps";
|
|
pubKeys = lib.filesystem.listFilesRecursive ../../users/keys;
|
|
hostAddress = configVars.networking.addresses.semitamaps.hostAddress;
|
|
localAddress = configVars.networking.addresses.semitamaps.localAddress;
|
|
in {
|
|
|
|
networking = {
|
|
nat = {
|
|
enable = true;
|
|
internalInterfaces = ["ve-+"];
|
|
externalInterface = "enp1s0";
|
|
};
|
|
};
|
|
|
|
environment.persistence."/persist" = {
|
|
hideMounts = true;
|
|
directories = [
|
|
"/var/lib/nixos-containers/${containerName}"
|
|
];
|
|
};
|
|
|
|
containers."${containerName}" = {
|
|
autoStart = true;
|
|
privateNetwork = true;
|
|
hostAddress = hostAddress;
|
|
localAddress = localAddress;
|
|
nixpkgs = pkgs.path;
|
|
|
|
config = {
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}: {
|
|
|
|
networking = {
|
|
firewall = {
|
|
enable = true;
|
|
rejectPackets = true;
|
|
allowedTCPPorts = [
|
|
80 443
|
|
];
|
|
};
|
|
useHostResolvConf = lib.mkForce false;
|
|
};
|
|
|
|
services.resolved.enable = true;
|
|
|
|
imports = [
|
|
];
|
|
|
|
environment.systemPackages = [
|
|
pkgs.vim
|
|
pkgs.git
|
|
];
|
|
|
|
services.openssh = {
|
|
enable = true;
|
|
settings.PasswordAuthentication = false;
|
|
};
|
|
|
|
users.users = {
|
|
root = {
|
|
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
|
|
};
|
|
};
|
|
|
|
system.stateVersion = "24.05";
|
|
};
|
|
};
|
|
}
|