From b9def52bffc5920890e426e163967a40eb3e0124 Mon Sep 17 00:00:00 2001 From: xqtc Date: Fri, 25 Oct 2024 13:59:33 +0200 Subject: [PATCH] move caddy config to own file; swap nil_ls with nixd --- home/modules/nixvim.nix | 2 +- hosts/x86_64-linux/beleth/caddy.nix | 119 +++++++++++++++++++ hosts/x86_64-linux/beleth/default.nix | 164 +------------------------- 3 files changed, 121 insertions(+), 164 deletions(-) create mode 100644 hosts/x86_64-linux/beleth/caddy.nix diff --git a/home/modules/nixvim.nix b/home/modules/nixvim.nix index 16e6fe5..6f17349 100644 --- a/home/modules/nixvim.nix +++ b/home/modules/nixvim.nix @@ -204,7 +204,7 @@ typing.autoClosingAngleBrackets.enable = true; }; }; - nil-ls.enable = true; + nixd.enable = true; }; }; dap = { diff --git a/hosts/x86_64-linux/beleth/caddy.nix b/hosts/x86_64-linux/beleth/caddy.nix new file mode 100644 index 0000000..6d11fec --- /dev/null +++ b/hosts/x86_64-linux/beleth/caddy.nix @@ -0,0 +1,119 @@ +{config, lib, pkgs, ...}: { + services.caddy = { + enable = true; + email = "xqtc@tutanota.com"; + virtualHosts = { + "heroin.trade" = { + extraConfig = '' + root * /var/www/website/public/ + handle_errors { + rewrite * /404.html + file_server + } + file_server + ''; + }; + # "matrix.heroin.trade" = { + # extraConfig = '' + # reverse_proxy /_matrix/* 127.0.0.1:${builtins.toString config.services.matrix-conduit.settings.global.port} + # ''; + # }; + "hydra.heroin.trade" = { + extraConfig = '' + reverse_proxy http://localhost:${builtins.toString config.services.hydra.port} + ''; + }; + "cheats-rs.heroin.trade" = { + extraConfig = '' + root * /var/www/cheats-rs/public/ + handle_errors { + rewrite * /404.html + file_server + } + file_server + ''; + }; + "syncthing.heroin.trade" = { + extraConfig = '' + reverse_proxy http://localhost:8384 { + header_up Host {upstream_hostport} + } + ''; + }; + "demos.heroin.trade" = { + extraConfig = '' + root * /var/www/demos/ + file_server browse + ''; + }; + "git.heroin.trade" = { + extraConfig = '' + reverse_proxy http://localhost:3002 + ''; + }; + "jellyfin.heroin.trade" = { + extraConfig = '' + reverse_proxy http://127.0.0.1:8096 + redir /metrics* / + ''; + }; + "calibre.heroin.trade" = { + extraConfig = '' + reverse_proxy http://localhost:3000 + ''; + }; + "grafana.heroin.trade" = { + extraConfig = '' + reverse_proxy http://127.0.0.1:2342 + ''; + }; + "uptime.heroin.trade" = { + extraConfig = '' + reverse_proxy http://127.0.0.1:3001 + ''; + }; + "paperless.heroin.trade" = { + extraConfig = '' + reverse_proxy http://127.0.0.1:28981 + ''; + }; + "radarr.heroin.trade" = { + extraConfig = '' + reverse_proxy http://127.0.0.1:7878 + ''; + }; + "sonarr.heroin.trade" = { + extraConfig = '' + reverse_proxy http://127.0.0.1:8989 + ''; + }; + "prowlarr.heroin.trade" = { + extraConfig = '' + reverse_proxy http://127.0.0.1:9696 + ''; + }; + "qbit.heroin.trade" = { + extraConfig = '' + reverse_proxy http://127.0.0.1:8085 + ''; + }; + "marie.software" = { + extraConfig = '' + root * /var/www/marie-website/ + file_server + ''; + }; + "juvi.likes.graphics" = { + extraConfig = '' + root * /var/www/juvi-website/ + file_server + ''; + }; + "servers" = { + extraConfig = '' + metrics + ''; + }; + }; + }; +} diff --git a/hosts/x86_64-linux/beleth/default.nix b/hosts/x86_64-linux/beleth/default.nix index d152bf2..0dd184a 100644 --- a/hosts/x86_64-linux/beleth/default.nix +++ b/hosts/x86_64-linux/beleth/default.nix @@ -6,9 +6,9 @@ }: with lib; { imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix ./monitoring.nix + ./caddy.nix ./jellyfin.nix ./calibre-web.nix ./transmission.nix @@ -32,124 +32,6 @@ with lib; { services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.interval = "weekly"; - services.caddy = { - enable = true; - email = "xqtc@tutanota.com"; - virtualHosts = { - "heroin.trade" = { - extraConfig = '' - root * /var/www/website/public/ - handle_errors { - rewrite * /404.html - file_server - } - file_server - ''; - }; - # "matrix.heroin.trade" = { - # extraConfig = '' - # reverse_proxy /_matrix/* 127.0.0.1:${builtins.toString config.services.matrix-conduit.settings.global.port} - # ''; - # }; - "hydra.heroin.trade" = { - extraConfig = '' - reverse_proxy http://localhost:${builtins.toString config.services.hydra.port} - ''; - }; - "cheats-rs.heroin.trade" = { - extraConfig = '' - root * /var/www/cheats-rs/public/ - handle_errors { - rewrite * /404.html - file_server - } - file_server - ''; - }; - "syncthing.heroin.trade" = { - extraConfig = '' - reverse_proxy http://localhost:8384 { - header_up Host {upstream_hostport} - } - ''; - }; - "demos.heroin.trade" = { - extraConfig = '' - root * /var/www/demos/ - file_server browse - ''; - }; - "git.heroin.trade" = { - extraConfig = '' - reverse_proxy http://localhost:3002 - ''; - }; - "jellyfin.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:8096 - redir /metrics* / - ''; - }; - "calibre.heroin.trade" = { - extraConfig = '' - reverse_proxy http://localhost:3000 - ''; - }; - "grafana.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:2342 - ''; - }; - "uptime.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:3001 - ''; - }; - "paperless.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:28981 - ''; - }; - "radarr.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:7878 - ''; - }; - "sonarr.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:8989 - ''; - }; - "prowlarr.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:9696 - ''; - }; - "qbit.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:8085 - ''; - }; - "marie.software" = { - extraConfig = '' - root * /var/www/marie-website/ - file_server - ''; - }; - "juvi.likes.graphics" = { - extraConfig = '' - root * /var/www/juvi-website/ - file_server - ''; - }; - "servers" = { - extraConfig = '' - metrics - ''; - }; - }; - }; - services.syncthing.settings.gui.insecureSkipHostcheck = true; nix.settings.experimental-features = ["nix-command" "flakes"]; @@ -189,50 +71,6 @@ with lib; { ]; }; - # users.users.marie = { - # isNormalUser = true; - # packages = with pkgs; [ - # git - # wget - # ]; - # openssh.authorizedKeys.keys = [ - # "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN0mGd4YS4f3Wy+a4PBXbie42C5Qo4H0uWsN7joaK27h marie@titania" - # "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFckmWImlMVsCbu5M1lsLtzxhBxrQhTQHYrKWJYDOHr5 marie@oberon" - # ]; - # }; - # users.users.mo = { - # isNormalUser = true; - # packages = with pkgs; [ - # git - # wget - # ]; - # openssh.authorizedKeys.keys = [ - # "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFjRrLI5mBnoIMcjq2WGPCGuKYLwS7uhgI6F0T5ojp6n moe@martini.moe" - # ]; - # }; - # - # users.users.ellie = { - # isNormalUser = true; - # packages = with pkgs; [ - # git - # wget - # ]; - # openssh.authorizedKeys.keys = [ - # "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKA4+3PkFptATzrWncxdj63SqZ747cDb8TqmdQFugvW7 ellie@card" - # ]; - # }; - # - # users.users.brodo = { - # isNormalUser = true; - # packages = with pkgs; [ - # git - # wget - # ]; - # openssh.authorizedKeys.keys = [ - # "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAZqFlE49ln4iAcVNzUaTXbFW6SA8Wwxl1hiwUkegUfy julian@example.com" - # ]; - # }; - users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJTLJqIVwnqFO64rnc66d234TFOdFXpDS9fJUA4/f4in xqtc@alastor" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN7UkcmSVo+SeB5Obevz3mf3UHruYxn0UHUzoOs2gDBy xqtc@asmodeus"