96 lines
2.9 KiB
Nix
96 lines
2.9 KiB
Nix
# Edit this configuration file to define what should be installed on
|
|
# your system. Help is available in the configuration.nix(5) man page, on
|
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
|
|
imports = [
|
|
./server.nix
|
|
private/junk.nix
|
|
];
|
|
|
|
# Use the GRUB 2 boot loader.
|
|
boot.loader.grub.enable = true;
|
|
# boot.loader.grub.efiSupport = true;
|
|
# boot.loader.grub.efiInstallAsRemovable = true;
|
|
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
|
# Define on which hard drive you want to install Grub.
|
|
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
|
|
boot.kernel.sysctl = {
|
|
"net.ipv6.conf.all.forwarding" = 1;
|
|
"net.ipv4.ip_forward" = 1;
|
|
};
|
|
|
|
networking.hostName = "junk"; # Define your hostname.
|
|
|
|
services.taskserver = {
|
|
openFirewall = true;
|
|
listenHost = "::";
|
|
enable = true;
|
|
};
|
|
|
|
services.fail2ban.enable = true;
|
|
|
|
containers."jumphost" = {
|
|
autoStart = true;
|
|
privateNetwork = true;
|
|
hostBridge = "br0";
|
|
config = {config, pkgs, lib, ... }: {
|
|
networking.useDHCP = lib.mkForce true;
|
|
services.endlessh = {
|
|
enable = true;
|
|
port = 22;
|
|
openFirewall = true;
|
|
};
|
|
services.openssh = {
|
|
enable = true;
|
|
ports = [ 2022 ];
|
|
settings.PasswordAuthentication = false;
|
|
};
|
|
users.users."jump" = {
|
|
name = "jump";
|
|
isNormalUser = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
|
|
# Open ports in the firewall.
|
|
networking.firewall.allowedTCPPorts = [ 53589 ];
|
|
networking.firewall.allowedUDPPorts = [ 9200 ];
|
|
# Or disable the firewall altogether.
|
|
networking.firewall.enable = true;
|
|
|
|
networking = {
|
|
bridges.br0.interfaces = [ "ens3" ];
|
|
useDHCP = false;
|
|
interfaces."br0".useDHCP = true;
|
|
};
|
|
|
|
# Copy the NixOS configuration file and link it from the resulting system
|
|
# (/run/current-system/configuration.nix). This is useful in case you
|
|
# accidentally delete configuration.nix.
|
|
# system.copySystemConfiguration = true;
|
|
|
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
|
#
|
|
# Most users should NEVER change this value after the initial install, for any reason,
|
|
# even if you've upgraded your system to a new NixOS release.
|
|
#
|
|
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
|
# so changing it will NOT upgrade your system.
|
|
#
|
|
# This value being lower than the current NixOS release does NOT mean your system is
|
|
# out of date, out of support, or vulnerable.
|
|
#
|
|
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
|
# and migrated your data accordingly.
|
|
#
|
|
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
|
|
|
}
|
|
|