🚚 (hydrogen) move around a lot of code
This commit is contained in:
parent
c66cbd96b4
commit
7c64621be1
|
@ -1,72 +1,17 @@
|
||||||
{ modulesPath, pkgs, lib, ... }: {
|
{ modulesPath, lib, ... }: {
|
||||||
imports =
|
imports =
|
||||||
lib.optional (builtins.pathExists ./do-userdata.nix) ./do-userdata.nix ++ [
|
lib.optional (builtins.pathExists ./do-userdata.nix) ./do-userdata.nix ++ [
|
||||||
(modulesPath + "/virtualisation/digital-ocean-config.nix")
|
(modulesPath + "/virtualisation/digital-ocean-config.nix")
|
||||||
|
|
||||||
./services
|
./services
|
||||||
|
./system
|
||||||
];
|
];
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "hydrogen";
|
|
||||||
domain = "fainsin.bzh";
|
|
||||||
firewall = {
|
|
||||||
allowedTCPPorts = [
|
|
||||||
22 # ssh
|
|
||||||
80 # http
|
|
||||||
443 # https
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.fail2ban = {
|
|
||||||
enable = true;
|
|
||||||
maxretry = 5;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.mutableUsers = false;
|
|
||||||
users.users.root.openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINTvwXCT99s1EwOCeGQ28jyCAH/RBoLZza9k5I7wWdEu"
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ htop ];
|
|
||||||
|
|
||||||
services.nginx = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
recommendedTlsSettings = true;
|
|
||||||
recommendedOptimisation = true;
|
|
||||||
recommendedGzipSettings = true;
|
|
||||||
recommendedProxySettings = true;
|
|
||||||
|
|
||||||
virtualHosts = {
|
|
||||||
"fainsin.bzh" = {
|
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
locations."/".return =
|
|
||||||
''301 "$scheme://laurent.fainsin.bzh$request_uri"'';
|
|
||||||
};
|
|
||||||
"laurent.fainsin.bzh" = {
|
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
root = "/srv/www/";
|
|
||||||
};
|
|
||||||
default = {
|
|
||||||
default = true;
|
|
||||||
locations."/".return = ''301 "$scheme://fainsin.bzh" '';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
security.acme = {
|
|
||||||
acceptTerms = true;
|
|
||||||
defaults.email = "acme@fainsin.bzh";
|
|
||||||
};
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
# 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.
|
# this value at the release version of the first install of this system.
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
system.stateVersion = "23.05"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|
6
hosts/hydrogen/services/acme/default.nix
Normal file
6
hosts/hydrogen/services/acme/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ ... }: {
|
||||||
|
security.acme = {
|
||||||
|
acceptTerms = true;
|
||||||
|
defaults.email = "acme@fainsin.bzh";
|
||||||
|
};
|
||||||
|
}
|
|
@ -1 +1,3 @@
|
||||||
{ imports = [ ./atuin ./blocky ./gitea ./wireguard ]; }
|
{ ... }: {
|
||||||
|
imports = [ ./acme ./atuin ./blocky ./fail2ban ./gitea ./nginx ./wireguard ];
|
||||||
|
}
|
||||||
|
|
6
hosts/hydrogen/services/fail2ban/default.nix
Normal file
6
hosts/hydrogen/services/fail2ban/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ ... }: {
|
||||||
|
services.fail2ban = {
|
||||||
|
enable = true;
|
||||||
|
maxretry = 5;
|
||||||
|
};
|
||||||
|
}
|
12
hosts/hydrogen/services/nginx/default.nix
Normal file
12
hosts/hydrogen/services/nginx/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ ... }: {
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
imports = [ ./personal-websites.nix ];
|
||||||
|
}
|
21
hosts/hydrogen/services/nginx/personal-websites.nix
Normal file
21
hosts/hydrogen/services/nginx/personal-websites.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ ... }: {
|
||||||
|
services.nginx.virtualHosts = {
|
||||||
|
|
||||||
|
"fainsin.bzh" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/".return =
|
||||||
|
''301 "$scheme://laurent.fainsin.bzh$request_uri"'';
|
||||||
|
};
|
||||||
|
"laurent.fainsin.bzh" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
root = "/srv/www/";
|
||||||
|
};
|
||||||
|
default = {
|
||||||
|
default = true;
|
||||||
|
locations."/".return = ''301 "$scheme://fainsin.bzh" '';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
1
hosts/hydrogen/system/default.nix
Normal file
1
hosts/hydrogen/system/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{ ... }: { imports = [ ./networking ./packages ./users ]; }
|
13
hosts/hydrogen/system/networking/default.nix
Normal file
13
hosts/hydrogen/system/networking/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ ... }: {
|
||||||
|
networking = {
|
||||||
|
hostName = "hydrogen";
|
||||||
|
domain = "fainsin.bzh";
|
||||||
|
firewall = {
|
||||||
|
allowedTCPPorts = [
|
||||||
|
22 # ssh
|
||||||
|
80 # http
|
||||||
|
443 # https
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
1
hosts/hydrogen/system/packages/default.nix
Normal file
1
hosts/hydrogen/system/packages/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{ pkgs, ... }: { environment.systemPackages = with pkgs; [ htop ]; }
|
6
hosts/hydrogen/system/users/default.nix
Normal file
6
hosts/hydrogen/system/users/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ ... }: {
|
||||||
|
users.mutableUsers = false;
|
||||||
|
users.users.root.openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINTvwXCT99s1EwOCeGQ28jyCAH/RBoLZza9k5I7wWdEu"
|
||||||
|
];
|
||||||
|
}
|
Loading…
Reference in a new issue