1766694187

This commit is contained in:
2025-12-25 13:23:07 -07:00
parent a479ec48f8
commit 2ed733ebae
6 changed files with 17 additions and 134 deletions

View File

@@ -14,12 +14,11 @@
./modules/packages.nix ./modules/packages.nix
./modules/hardware.nix ./modules/hardware.nix
./modules/services.nix ./modules/services.nix
./modules/security.nix
./modules/aliases.nix ./modules/aliases.nix
]; ];
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
xdg.portal.config.common.default = [ "gnome" ]; # xdg.portal.config.common.default = [ "gnome" ];
system.stateVersion = "25.11"; system.stateVersion = "25.11";
} }

View File

@@ -1,8 +1,11 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
services.displayManager.gdm.enable = true; # Enable the COSMIC login manager
services.desktopManager.gnome.enable = true; services.displayManager.cosmic-greeter.enable = true;
# Enable the COSMIC desktop environment
services.desktopManager.cosmic.enable = true;
services.printing.enable = true; services.printing.enable = true;
} }

View File

@@ -13,35 +13,16 @@ in
networking.firewall = { networking.firewall = {
enable = true; enable = true;
# Allowed ports # Allowed ports
allowedTCPPorts = [ allowedTCPPorts = [
# Sunshine # Sunshine
47984 47989 48010 47984 47989 48010
]; ];
allowedUDPPorts = [ allowedUDPPorts = [
# Sunshine # Sunshine
47998 47999 48000 48010 47998 47999 48000 48010
]; ];
# Firewall
logReversePathDrops = true;
logRefusedConnections = true;
# Connection tracking
connectionTrackingModules = [];
autoLoadConntrackHelpers = false;
extraCommands = ''
iptables -A INPUT -p tcp --syn -m connlimit --connlimit-above 50 -j DROP
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j DROP
'';
extraStopCommands = ''
iptables -D INPUT -p tcp --syn -m connlimit --connlimit-above 50 -j DROP 2>/dev/null || true
iptables -D INPUT -p tcp --dport 22 -m state --state NEW -m recent --set 2>/dev/null || true
iptables -D INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j DROP 2>/dev/null || true
'';
}; };
networking.nameservers = [ "1.1.1.1" "9.9.9.9" ]; networking.nameservers = [ "1.1.1.1" "9.9.9.9" ];

View File

@@ -27,6 +27,7 @@
# Browsers and comms # Browsers and comms
discord discord
signal-desktop signal-desktop
librewolf
# Development tools # Development tools
git git
@@ -40,6 +41,7 @@
openssh openssh
nodePackages."pnpm" nodePackages."pnpm"
openssl openssl
killall
ffmpeg ffmpeg
zed-editor zed-editor
usbutils usbutils
@@ -61,9 +63,6 @@
streamcontroller streamcontroller
easyeffects easyeffects
onlyoffice-desktopeditors onlyoffice-desktopeditors
# GNOME extensions
gnomeExtensions.appindicator
]; ];
# Programs with extra configuration # Programs with extra configuration
@@ -74,6 +73,8 @@
localNetworkGameTransfers.openFirewall = true; localNetworkGameTransfers.openFirewall = true;
}; };
programs.thunderbird.enable = true; programs.java.enable = true;
programs.steam.extraPackages = [ pkgs.jdk ];
programs.obs-studio.enable = true; programs.obs-studio.enable = true;
} }

View File

@@ -1,101 +0,0 @@
{ config, pkgs, ... }:
{
security.sudo = {
execWheelOnly = true;
extraConfig = ''
# Reduce sudo timeout to 5 minutes
Defaults timestamp_timeout=5
# Require password for sudo even in same terminal session after timeout
Defaults timestamp_type=global
# Show asterisks when typing password
Defaults pwfeedback
'';
};
nix.settings.allowed-users = [ "@wheel" ];
security.apparmor = {
enable = true;
};
services.fail2ban = {
enable = true;
maxretry = 5;
bantime = "1h";
bantime-increment = {
enable = true;
maxtime = "168h"; # 1 week max ban
factor = "4";
};
};
security.pam.loginLimits = [
{ domain = "*"; type = "hard"; item = "core"; value = "0"; }
];
boot.kernelParams = [
"slab_nomerge"
"init_on_alloc=1"
"init_on_free=1"
"page_alloc.shuffle=1"
"randomize_kstack_offset=on"
"vsyscall=none"
"mitigations=auto"
];
boot.kernel.sysctl = {
"kernel.dmesg_restrict" = 1;
"kernel.kptr_restrict" = 2;
"kernel.perf_event_paranoid" = 3;
"kernel.yama.ptrace_scope" = 1;
"kernel.sysrq" = 0;
"kernel.randomize_va_space" = 2;
"kernel.kexec_load_disabled" = 1;
"net.ipv4.conf.all.log_martians" = 1;
"net.ipv4.conf.default.log_martians" = 1;
"net.ipv4.icmp_echo_ignore_broadcasts" = 1;
"net.ipv4.conf.all.accept_redirects" = 0;
"net.ipv4.conf.default.accept_redirects" = 0;
"net.ipv4.conf.all.send_redirects" = 0;
"net.ipv4.conf.default.send_redirects" = 0;
"net.ipv4.conf.all.accept_source_route" = 0;
"net.ipv4.conf.default.accept_source_route" = 0;
"net.ipv4.conf.all.rp_filter" = 1;
"net.ipv4.conf.default.rp_filter" = 1;
"net.ipv4.tcp_syncookies" = 1;
"net.ipv4.tcp_rfc1337" = 1;
"net.ipv4.icmp_ignore_bogus_error_responses" = 1;
"net.ipv6.conf.all.accept_redirects" = 0;
"net.ipv6.conf.default.accept_redirects" = 0;
"net.ipv6.conf.all.accept_source_route" = 0;
"net.ipv6.conf.default.accept_source_route" = 0;
"net.ipv6.conf.all.accept_ra" = 0;
"net.ipv6.conf.default.accept_ra" = 0;
"net.core.rmem_max" = 16777216;
"net.core.wmem_max" = 16777216;
"net.ipv4.tcp_fastopen" = 3;
"net.ipv4.tcp_congestion_control" = "bbr";
"net.core.default_qdisc" = "fq";
"vm.swappiness" = 10;
"vm.vfs_cache_pressure" = 50;
"vm.dirty_ratio" = 10;
"vm.dirty_background_ratio" = 5;
"fs.protected_hardlinks" = 1;
"fs.protected_symlinks" = 1;
"fs.protected_fifos" = 2;
"fs.protected_regular" = 2;
"fs.suid_dumpable" = 0;
};
system.autoUpgrade = {
enable = true;
allowReboot = false;
dates = "04:00";
};
}

View File

@@ -58,5 +58,5 @@
services.avahi.publish.enable = true; services.avahi.publish.enable = true;
services.avahi.publish.userServices = true; services.avahi.publish.userServices = true;
services.gnome.gnome-remote-desktop.enable = true; services.system76-scheduler.enable = true;
} }