dot_testing/boxes/netbox/default.nix

135 lines
3.9 KiB
Nix
Raw Normal View History

2023-07-07 23:44:40 -05:00
{ lib, config, pkgs, ... }:
2024-02-25 20:29:31 -06:00
{
2023-07-07 23:44:40 -05:00
imports =
[
2024-01-18 04:28:32 -06:00
./hardware-configuration.nix
../../modules/bootstrap.nix
2024-06-20 20:00:55 -05:00
./radicale.nix
./ssh.nix
./gitea.nix
./radicale.nix
./vaultwarden.nix
./sslh.nix
./rss2email.nix
./fail2ban.nix
./nginx.nix
./franklincce.nix
2024-10-27 22:59:13 -05:00
./wireguard.nix
2024-11-05 14:58:06 -06:00
./nextcloud-bridge.nix
2024-10-28 00:10:19 -05:00
./grafana-bridge.nix
2024-11-13 22:00:07 -06:00
./paperless-bridge.nix
2024-10-28 00:10:19 -05:00
./prometheus.nix
2024-10-28 23:15:31 -05:00
./socks.nix
2023-07-07 23:44:40 -05:00
];
2024-10-09 04:26:18 -05:00
nix = {
optimise = {
automatic = true;
dates = [ "02:30" ];
};
gc = {
automatic = true;
dates = "03:15";
options = "-d";
};
};
2024-01-18 04:28:32 -06:00
time.timeZone = "America/Chicago";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
environment.systemPackages = with pkgs; [
2024-06-15 21:58:09 -05:00
python3
2024-01-18 04:28:32 -06:00
curl
htop
git
tree
dig
htop
2024-01-19 18:56:48 -06:00
neovim
2024-01-18 04:28:32 -06:00
];
2024-06-20 20:00:55 -05:00
system = {
copySystemConfiguration = true;
stateVersion = "23.05"; # don't change this, lol
2024-01-21 12:40:51 -06:00
};
2024-10-29 00:02:42 -05:00
services.journald.extraConfig = ''
SystemMaxUse=1G
'';
system.userActivationScripts = {
copyEssentialConfiguration = {
# we don't want to bring in the entirety of home-manager for this, so just
# write some files as a hack
text = ''
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/bash/bashrc /home/ryan/.bashrc
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/bash/profile /home/ryan/.bash_profile
${pkgs.coreutils}/bin/mkdir -p /home/ryan/.config/nvim
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/nvim/init.min.lua /home/ryan/.config/nvim/init.lua
'';
deps = [];
};
};
system.activationScripts = {
copyEssentialConfiguration = {
text = ''
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/bash/bashrc /root/.bashrc
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/bash/profile /root/.bash_profile
${pkgs.coreutils}/bin/mkdir -p /root/.config/nvim
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/nvim/init.min.lua /root/.config/nvim/init.lua
'';
deps = [];
};
};
2024-06-20 20:00:55 -05:00
boot.loader = {
grub.enable = true;
grub.device = "/dev/vda";
2023-12-03 21:46:37 -06:00
};
users.users.ryan = {
2024-01-21 12:14:04 -06:00
openssh.authorizedKeys.keys = [
2024-01-24 23:42:18 -06:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbhM3wj0oqjR3pUaZgpfX4Xo4dlzvBTbQ48zHyg7Pwx usr" # x230t
2024-07-22 16:30:37 -05:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILBGh1FHPneg7PCDkhMs2BCJPTIRVJkRTKpOj1w02ydD usr" # copernicus
2024-01-24 23:42:18 -06:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGrpVDLQszFKoYbvYKRyVTTpehxR0BVU47SXkz39l2wK usr" # mainsail
2024-10-07 14:50:10 -05:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB2xUbQw9+RCPVw7qCFm4NNCP/MpS2BIArcwMv0KdKOI usr" # mlg
2024-11-08 14:15:55 -06:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILuVT5W3kzjzsuMIWk1oeGtL8jZGtAhRSx8dK8oBJQcG u0_a291" # phone
2024-10-22 08:10:51 -05:00
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDCufie2JWc4ylZHIi03uR0RB/79/hTacn9qnlzqs+kaWcdk7eyHqpg3zmVrETCZQxJ8ssZx4+tlwC0+seOjgIfNktfKjiRpes2Sib0MowO3lRgzqJ0pZ5AEA/pc4314meAZP/CibFw54CWxOySEXsCWKm157HVJHpJ7P0HwqzHod4jXxUWKwMoZo5XyOTTMHv4oytcHTydIeiSymw3RtvEtqpBCRE3W5kIiJNuCXnZGZBxvOnhJsQ0FkeXgByeXOLFxUw0ma6Jy/621T2GrBnmFhiSIV+T7xk/cfgP+D1V9x2wCLX5gPQaNzwL03v3xohxnJwRa6EXTR9LzXE7Rhnolbmkb/YPPpI6U0RpueZrHv/1CIA3OSKnQh1cp/jMeP4DfeO+fSY1SsRZICQ3ndlnYkXtalEzGPxeLUgLsh6SxSIK+7jjlDGrJCUbOMHhR+92vBXy7XE8tgO2FuhrAIiroIsaWmZO/7sike3ps3GFEZHZMEe2v3IDqfX/Iecn++U= usr" # aristotle
2024-01-21 12:14:04 -06:00
];
isNormalUser = true;
extraGroups = [ "wheel" "docker" ];
};
2024-06-20 20:00:55 -05:00
networking = {
usePredictableInterfaceNames = false;
networkmanager.enable = true;
hostName = "netbox";
2023-07-07 23:44:40 -05:00
2024-06-20 20:00:55 -05:00
firewall = {
enable = true;
2024-10-28 19:29:20 -05:00
interfaces = {
eth0 = {
allowedTCPPorts = [ 80 443 ];
};
wg0 = {
# allow everything bound to the wg0 interface
allowedTCPPortRanges = [
{ from = 1; to = 35565; }
];
allowedUDPPortRanges = [
{ from = 1; to = 35565; }
];
};
};
};
2023-12-03 19:50:26 -06:00
};
2023-07-07 23:44:40 -05:00
}