refactorings

This commit is contained in:
Ingolf Wagner 2024-04-12 20:56:42 +02:00
parent fe9efe5852
commit 6645f02a72
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
7 changed files with 257 additions and 266 deletions

View file

@ -6,7 +6,13 @@ with lib;
default = config.components.network.enable;
};
config = mkIf (config.components.network.nginx.enable) {
options.components.network.nginx.landingpage.enable = mkOption {
type = lib.types.bool;
default = config.components.network.nginx.enable;
};
config = mkMerge [
(mkIf (config.components.network.nginx.enable) {
environment.systemPackages = [
pkgs.nginx-config-formatter
@ -49,6 +55,11 @@ with lib;
};
services.nginx.package = pkgs.nginxMainline;
})
(mkIf (config.components.network.nginx.landingpage.enable) {
services.nginx.virtualHosts."${config.networking.hostName}.private" = {
default = lib.mkDefault true;
locations."/" = {
@ -249,5 +260,6 @@ with lib;
};
};
};
};
})
];
}

View file

@ -29,6 +29,11 @@ with lib;
tree
killall
nix-tree
unstable.vulnix
(writers.writeBashBin "vulnix-system" ''
${unstable.vulnix}/bin/vulnix --profile /nix/var/nix/profiles/system
'')
];
programs.btop.enable = true;

View file

@ -13,11 +13,11 @@
#./borg.nix
#./codimd.nix
#./gitea.nix
#./packages.nix
#./taskserver.nix
#./vaultwarden.nix
#./nginx.nix
#./nginx-wkd.nix
./nginx-ingolf-wagner-de.nix
./nginx-wkd.nix
./network-tinc.nix
./network-wireguard.nix
@ -53,6 +53,7 @@
components.mainUser.enable = true;
components.gui.enable = false;
components.network.enable = true;
components.network.nginx.landingpage.enable = false;
components.network.wifi.enable = false;
security.acme.acceptTerms = true;

View file

@ -55,6 +55,9 @@ in
services.openssh.enable = true;
services.sshguard.enable = true;
environment.systemPackages = [
pkgs.ipset # for sshguard
];
boot.tmp.useTmpfs = true; # make /tmp a tmpfs (performance!)

View file

@ -107,7 +107,6 @@ in
};
};
};
"travel.ingolf-wagner.de" = {
forceSSL = true;
enableACME = true;
@ -138,21 +137,6 @@ in
};
} // error.locations;
};
"terranix.org" = {
forceSSL = true;
enableACME = true;
extraConfig = error.extraConfig;
locations = {
"/" = {
root = "/srv/www/terranix";
extraConfig = ''
if (-d $request_filename) {
rewrite [^/]$ $scheme://$http_host$request_uri/ permanent;
}
'';
};
} // error.locations;
};
};
};
}

View file

@ -1,14 +0,0 @@
{ config, pkgs, ... }: {
environment.systemPackages = with pkgs; [
mosh
mediainfo
youtube-dl
ipset # for sshguard
unstable.vulnix
(pkgs.writers.writeBashBin "vulnix-system" ''
${pkgs.unstable.vulnix}/bin/vulnix --profile /nix/var/nix/profiles/system
'')
];
}

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: {
imports = [
# ../../system/all/nginx.nix
# ../../system/all/nginx-ingolf-wagner-de.nix
../../system/all/defaults.nix
../../components
@ -16,8 +16,8 @@
./packages.nix
./taskserver.nix
./vaultwarden.nix
./nginx.nix
./nginx-wkd.nix
#./nginx.nix
#./nginx-wkd.nix
./network-tinc.nix
#./network-wireguard.nix