This commit is contained in:
Sridhar Ratnakumar 2021-09-06 12:44:38 -04:00
parent 2477aad59a
commit 8c472ce800
5 changed files with 26 additions and 22 deletions

View file

@ -2,5 +2,4 @@
environment.systemPackages = with pkgs; [
nodejs-14_x # Need this for https://nixos.wiki/wiki/Vscode
];
}

View file

@ -0,0 +1,22 @@
{ pkgs, ... }: {
networking.firewall.enable = true;
security.sudo.execWheelOnly = true;
security.auditd.enable = true;
security.audit.enable = true;
services = {
openssh = {
enable = true;
permitRootLogin = "prohibit-password"; # distributed-build.nix requires it
passwordAuthentication = false;
allowSFTP = false;
};
fail2ban = {
enable = true;
ignoreIP = [
# quebec
"70.53.187.43"
];
};
};
}

View file

@ -82,7 +82,8 @@
nixosConfigurations.ryzen9 = mkHomeMachine
./hosts/ryzen9.nix
[
./features/devserver-mode.nix
./features/server/harden.nix
./features/server/devserver.nix
];
};

View file

@ -106,25 +106,12 @@
extraOptions = ''
experimental-features = nix-command flakes
'';
allowedUsers = [ "root" "srid" ];
trustedUsers = [ "root" "srid" ];
};
services = {
openssh = {
enable = true;
permitRootLogin = "prohibit-password"; # distributed-build.nix requires it
passwordAuthentication = false;
};
fail2ban = {
enable = true;
ignoreIP = [
# quebec
"70.53.187.43"
];
};
netdata.enable = true;
};
services.netdata.enable = true;
programs = {
mosh.enable = true;
@ -139,11 +126,6 @@
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "adbusers" "audio" ];
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions