2023-05-27 16:11:03 +00:00
|
|
|
|
{ modulesPath, pkgs, lib, ... }: {
|
2022-12-21 19:29:15 +00:00
|
|
|
|
imports =
|
2023-04-14 20:47:57 +00:00
|
|
|
|
lib.optional (builtins.pathExists ./do-userdata.nix) ./do-userdata.nix ++ [
|
|
|
|
|
(modulesPath + "/virtualisation/digital-ocean-config.nix")
|
|
|
|
|
|
|
|
|
|
./services
|
|
|
|
|
];
|
2022-12-20 10:33:21 +00:00
|
|
|
|
|
|
|
|
|
networking = {
|
2023-05-27 16:11:03 +00:00
|
|
|
|
hostName = "hydrogen";
|
2022-12-20 10:33:21 +00:00
|
|
|
|
domain = "fainsin.bzh";
|
2022-12-26 19:06:05 +00:00
|
|
|
|
firewall = {
|
|
|
|
|
allowedTCPPorts = [
|
|
|
|
|
22 # ssh
|
|
|
|
|
80 # http
|
|
|
|
|
443 # https
|
|
|
|
|
];
|
|
|
|
|
};
|
2022-12-20 10:33:21 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.fail2ban = {
|
|
|
|
|
enable = true;
|
|
|
|
|
maxretry = 5;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
users.mutableUsers = false;
|
|
|
|
|
users.users.root.openssh.authorizedKeys.keys = [
|
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINTvwXCT99s1EwOCeGQ28jyCAH/RBoLZza9k5I7wWdEu"
|
|
|
|
|
];
|
|
|
|
|
|
2022-12-21 19:29:15 +00:00
|
|
|
|
environment.systemPackages = with pkgs; [ htop ];
|
2022-12-20 10:33:21 +00:00
|
|
|
|
|
|
|
|
|
services.nginx = {
|
|
|
|
|
enable = true;
|
|
|
|
|
|
2022-12-20 15:26:09 +00:00
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
|
recommendedProxySettings = true;
|
2022-12-20 10:33:21 +00:00
|
|
|
|
|
|
|
|
|
virtualHosts = {
|
2022-12-20 15:26:09 +00:00
|
|
|
|
"fainsin.bzh" = {
|
|
|
|
|
enableACME = true;
|
|
|
|
|
forceSSL = true;
|
2022-12-21 19:29:15 +00:00
|
|
|
|
locations."/".return =
|
|
|
|
|
''301 "$scheme://laurent.fainsin.bzh$request_uri"'';
|
2022-12-20 15:26:09 +00:00
|
|
|
|
};
|
|
|
|
|
"laurent.fainsin.bzh" = {
|
|
|
|
|
enableACME = true;
|
|
|
|
|
forceSSL = true;
|
|
|
|
|
root = "/srv/www/";
|
|
|
|
|
};
|
|
|
|
|
default = {
|
|
|
|
|
default = true;
|
2022-12-21 19:29:15 +00:00
|
|
|
|
locations."/".return = ''301 "$scheme://fainsin.bzh" '';
|
2022-12-20 15:26:09 +00:00
|
|
|
|
};
|
2022-12-20 10:33:21 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
security.acme = {
|
|
|
|
|
acceptTerms = true;
|
2022-12-26 14:40:56 +00:00
|
|
|
|
defaults.email = "acme@fainsin.bzh";
|
2022-12-20 10:33:21 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "22.11"; # Did you read the comment?
|
2022-12-21 19:29:15 +00:00
|
|
|
|
}
|