2021-11-15 10:02:05 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
2021-11-17 13:35:00 +00:00
|
|
|
let
|
2021-11-17 17:32:56 +00:00
|
|
|
url-overlay = "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nix-repo/archive/master.tar.gz";
|
2021-11-17 13:35:00 +00:00
|
|
|
nix-overlay = (import (builtins.fetchTarball url-overlay));
|
|
|
|
in
|
2021-11-15 10:02:05 +00:00
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
|
|
|
./variables-module.nix
|
|
|
|
./variables.nix
|
|
|
|
./files.nix
|
|
|
|
./users.nix
|
|
|
|
./mailserver/system/mailserver.nix
|
|
|
|
./mailserver/system/alps.nix
|
|
|
|
./vpn/ocserv.nix
|
|
|
|
./api/api.nix
|
|
|
|
./api/api-module.nix
|
|
|
|
./social/pleroma.nix
|
|
|
|
./letsencrypt/acme.nix
|
|
|
|
./letsencrypt/resolve.nix
|
|
|
|
./backup/restic.nix
|
|
|
|
./passmgr/bitwarden.nix
|
|
|
|
./webserver/nginx.nix
|
|
|
|
./webserver/memcached.nix
|
|
|
|
./nextcloud/nextcloud.nix
|
|
|
|
./resources/limits.nix
|
|
|
|
./videomeet/jitsi.nix
|
|
|
|
./git/gitea.nix
|
|
|
|
];
|
|
|
|
|
2021-11-17 13:35:00 +00:00
|
|
|
nixpkgs.overlays = [ (nix-overlay) ];
|
|
|
|
|
2021-11-15 10:02:05 +00:00
|
|
|
boot.cleanTmpDir = true;
|
|
|
|
networking = {
|
|
|
|
hostName = config.services.userdata.hostname;
|
|
|
|
firewall = {
|
|
|
|
allowedTCPPorts = lib.mkForce [ 22 25 80 143 443 465 587 993 8443 ];
|
|
|
|
allowedUDPPorts = lib.mkForce [ 8443 ];
|
|
|
|
};
|
|
|
|
nameservers = [ "1.1.1.1" "1.0.0.1" ];
|
|
|
|
};
|
2021-11-15 10:29:20 +00:00
|
|
|
time.timeZone = config.services.userdata.timezone;
|
2021-11-15 10:02:05 +00:00
|
|
|
i18n.defaultLocale = "en_GB.UTF-8";
|
2021-11-15 13:35:04 +00:00
|
|
|
users.users.root.openssh.authorizedKeys.keys = config.services.userdata.ssh.rootKeys;
|
2021-11-15 10:02:05 +00:00
|
|
|
services.openssh = {
|
2021-11-15 13:35:04 +00:00
|
|
|
enable = config.services.userdata.ssh.enable;
|
|
|
|
passwordAuthentication = config.services.userdata.ssh.passwordAuthentication;
|
2021-11-15 10:02:05 +00:00
|
|
|
permitRootLogin = "yes";
|
|
|
|
openFirewall = false;
|
|
|
|
};
|
|
|
|
programs.ssh = {
|
|
|
|
pubkeyAcceptedKeyTypes = [ "ssh-ed25519" ];
|
|
|
|
hostKeyAlgorithms = [ "ssh-ed25519" ];
|
|
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
git
|
|
|
|
];
|
|
|
|
environment.variables = {
|
|
|
|
DOMAIN = config.services.userdata.domain;
|
|
|
|
};
|
|
|
|
system.autoUpgrade.enable = true;
|
|
|
|
system.autoUpgrade.allowReboot = false;
|
|
|
|
system.autoUpgrade.channel = https://nixos.org/channels/nixos-21.05-small;
|
|
|
|
nix = {
|
|
|
|
optimise.automatic = true;
|
|
|
|
gc = {
|
|
|
|
automatic = true;
|
|
|
|
options = "--delete-older-than 7d";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
boot.kernel.sysctl = {
|
|
|
|
"net.ipv4.ip_forward" = 1;
|
|
|
|
};
|
|
|
|
swapDevices = [
|
|
|
|
{
|
|
|
|
device = "/swapfile";
|
|
|
|
priority = 0;
|
|
|
|
size = 2048;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
security = {
|
|
|
|
sudo = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|