hosts/ni: update config

This commit is contained in:
Gabriel Arazas 2022-11-25 21:27:23 +08:00
parent 30e75ebfc7
commit f9751a9510
2 changed files with 22 additions and 18 deletions

View File

@ -1,13 +1,17 @@
{ config, options, lib, pkgs, ... }: { config, options, lib, pkgs, ... }:
let let
inherit (builtins) toString;
domain = "foodogsquared.one"; domain = "foodogsquared.one";
wikiDomain = "wiki.${domain}";
passwordManagerDomain = "vault.${domain}"; passwordManagerDomain = "vault.${domain}";
codeForgeDomain = "forge.${domain}"; codeForgeDomain = "forge.${domain}";
in in
{ {
imports = [ imports = [
./hardware-configuration.nix
(lib.getUser "nixos" "plover") (lib.getUser "nixos" "plover")
(lib.getUser "nixos" "admin")
]; ];
sops.secrets = sops.secrets =
@ -43,26 +47,27 @@ in
recommendedTlsSettings = true; recommendedTlsSettings = true;
virtualHosts = { virtualHosts = {
# These are just websites that are already deployed. # Personal website.
"www.${domain}" = { "${domain}" = {
forceSSL = false;
enableACME = true;
serverAliases = [ "www.${domain}" ];
locations."/" = { locations."/" = {
proxyPass = "https://foodogsquared.netlify.app"; proxyPass = "https://foodogsquared.netlify.app";
}; };
}; };
"wiki.${domain}" = {
# My digital notebook.
"${wikiDomain}" = {
forceSSL = false;
enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "https://foodogsquared-wiki.netlify.app"; proxyPass = "https://foodogsquared-wiki.netlify.app";
}; };
}; };
"search.${domain}" = {
locations."/" = {
proxyPass = "https://search.brave.com";
};
};
# Vaultwarden instance. # Vaultwarden instance.
"${passwordManagerDomain}" = { "${passwordManagerDomain}" = {
http2 = true;
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations = let locations = let
@ -86,11 +91,12 @@ in
}; };
}; };
# Gitea instance.
"${codeForgeDomain}" = { "${codeForgeDomain}" = {
http2 = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:${config.services.gitea.httpPort}"; proxyPass = "http://localhost:${toString config.services.gitea.httpPort}";
}; };
}; };
}; };
@ -102,11 +108,6 @@ in
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
defaults.email = "admin@foodogsquared.one"; defaults.email = "admin@foodogsquared.one";
certs = {
"${passwordManagerDomain}".keyType = "rs2048";
"${codeForgeDomain}" = {};
};
}; };
# Some additional dependencies for this system. # Some additional dependencies for this system.

View File

@ -1,14 +1,17 @@
{ lib, pkgs, modulesPath, ... }: { lib, pkgs, modulesPath, ... }:
# Most of the filesystems listed here are supposed to be overriden to default
# settings of whatever image format configuration this host system will import
# from nixos-generators.
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
fileSystems."/" = { fileSystems."/" = lib.mkOverride 2000 {
label = "nixos"; label = "nixos";
fsType = "ext4"; fsType = "ext4";
autoResize = true; autoResize = true;
}; };
fileSystems."/srv" = { fileSystems."/srv" = lib.mkOverride 2000 {
label = "data"; label = "data";
options = [ options = [
"discard" "discard"