adicionando a VPS

This commit is contained in:
2026-04-19 15:17:37 -03:00
parent 5f85583bd0
commit 8329531ac7
37 changed files with 1630 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
{
config,
lib,
inputs,
pkgs,
...
}:
{
imports = [
./pkgs.nix
./nix-helper.nix
./self-host/self-host.nix
./self-host/firewall.nix
];
}
+26
View File
@@ -0,0 +1,26 @@
{
config,
lib,
inputs,
pkgs,
...
}:
{
programs = {
## nh
nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 8d --keep 7";
flake = "/etc/nixos"; # sets NH_OS_FLAKE variable for you
};
nix-ld = {
enable = true;
libraries = with pkgs; [ ];
};
};
nix.package = pkgs.lixPackageSets.stable.lix;
}
+28
View File
@@ -0,0 +1,28 @@
{
config,
lib,
inputs,
pkgs,
...
}:
{
environment.systemPackages = with pkgs; [
curl
git
vim
wget
screen
fish
btop
fastfetch
gitFull
unrar
unzip
## Zed
nixd
nil
];
}
@@ -0,0 +1,31 @@
{
config,
lib,
inputs,
pkgs,
...
}:
{
# Open ports in the firewall.
networking.firewall = {
enable = false;
allowedTCPPorts = [
80
443
];
allowedUDPPortRanges = [
{
from = 47998;
to = 48000;
}
{
from = 48002;
to = 48010;
}
];
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
};
}
@@ -0,0 +1,59 @@
{
config,
lib,
inputs,
pkgs,
...
}:
{
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
# Open ports in the firewall.
networking.firewall = {
enable = false;
allowedTCPPorts = [
80
443
];
allowedUDPPortRanges = [
{
from = 47998;
to = 48000;
}
{
from = 48002;
to = 48010;
}
];
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
};
boot.kernel.sysctl = {
"net.ipv4.ip_unprivileged_port_start" = 53;
"net.ipv6.conf.all.forwarding" = true;
};
users.groups.docker.gid = 131;
virtualisation.docker = {
enable = true;
};
services.tailscale = {
enable = true;
extraUpFlags = [
"--ssh"
"--accept-dns=true"
"--advertise-exit-node"
];
};
}