Compare commits

..

2 commits

Author SHA1 Message Date
Update Bot a2141e6ccf
flake.lock: Update
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/67dc29be3036cc888f0b9d4f0a788ee0f6768700' (2024-09-26)
  → 'github:nix-community/disko/6c5ba9ec9d470c1ca29e7735762c9c366e28f7f5' (2024-10-01)
• Updated input 'nixos-hardware':
    'github:nixos/nixos-hardware/d830ad47cc992b4a46b342bbc79694cbd0e980b2' (2024-09-27)
  → 'github:nixos/nixos-hardware/11c43c830e533dad1be527ecce379fcf994fbbb5' (2024-09-30)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/1925c603f17fc89f4c8f6bf6f631a802ad85d784' (2024-09-26)
  → 'github:nixos/nixpkgs/06cf0e1da4208d3766d898b7fdab6513366d45b9' (2024-09-29)
• Updated input 'nixvim':
    'github:nix-community/nixvim/b5c19b6abb0fb0156b1cb76793b363e430e2cb47' (2024-09-27)
  → 'github:nix-community/nixvim/5f4a4b47597d3b9ac26c41ff4e8da28fa662f200' (2024-09-29)
• Updated input 'nixvim/git-hooks':
    'github:cachix/git-hooks.nix/4e743a6920eab45e8ba0fbe49dc459f1423a4b74' (2024-09-19)
  → 'github:cachix/git-hooks.nix/85f7a7177c678de68224af3402ab8ee1bcee25c8' (2024-09-28)
• Updated input 'nixvim/nix-darwin':
    'github:lnl7/nix-darwin/bd7d1e3912d40f799c5c0f7e5820ec950f1e0b3d' (2024-09-22)
  → 'github:lnl7/nix-darwin/f2e1c4aa29fc211947c3a7113cba1dd707433b70' (2024-09-28)
• Updated input 'nixvim/nuschtosSearch':
    'github:NuschtOS/search/3b7dd61b365ca45380707453758a45f2e9977be3' (2024-09-22)
  → 'github:NuschtOS/search/9f7426e532ef8dfc839c4a3fcc567b13a20a70d3' (2024-09-27)
• Updated input 'nixvim/treefmt-nix':
    'github:numtide/treefmt-nix/1bff2ba6ec22bc90e9ad3f7e94cca0d37870afa3' (2024-09-25)
  → 'github:numtide/treefmt-nix/879b29ae9a0378904fbbefe0dadaed43c8905754' (2024-09-27)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/127a96f49ddc377be6ba76964411bab11ae27803' (2024-09-27)
  → 'github:Mic92/sops-nix/3198a242e547939c5e659353551b0668ec150268' (2024-09-30)
• Updated input 'stylix':
    'github:danth/stylix/e3eb7fdf8d129ff3676dfbc84ee1262322ca6fb4' (2024-09-26)
  → 'github:danth/stylix/e7e97059776da7e34b739415a7bc8f80f606b803' (2024-09-30)
2024-10-02 12:55:04 +02:00
emily a74c1d8585
librespeed: Fixes 2024-10-02 12:54:44 +02:00
2 changed files with 9 additions and 29 deletions

View file

@ -187,7 +187,6 @@
enable = true;
sources.diagnostics = {
pylint.enable = true;
statix.enable = true;
};
sources.formatting = {
nixfmt.enable = true;

View file

@ -238,33 +238,14 @@ in
services.nginx.virtualHosts = lib.mkIf (cfg.frontend.enable && cfg.frontend.useNginx) {
${cfg.domain} = {
locations."/".root = librespeedAssets;
locations."/backend/" = {
proxyPass = "http://${cfg.settings.bind_address}:${toString cfg.settings.listen_port}/backend/";
extraConfig = ''
# add_header Cache-Control 'no-store, no-cache, max-age=0, no-transform';
# add_header Last-Modified $date_gmt;
if_modified_since off;
expires off;
etag off;
access_log off;
gzip off;
log_not_found off;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
sendfile on;
client_max_body_size 50M;
proxy_read_timeout 999;
proxy_buffers 16 128k;
'';
};
locations."= /servers.json".return = "200 '${builtins.toJSON cfg.frontend.servers}'";
locations."/backend/".return = "301 https://$host:${toString cfg.settings.listen_port}$request_uri";
enableACME = true;
forceSSL = true;
};
};
security.acme.certs = lib.mkIf (cfg.domain != null) {
${cfg.domain} = lib.mkIf (!cfg.frontend.useNginx) {
${cfg.domain} = {
reloadServices = [ "librespeed.service" ];
webroot = "/var/lib/acme/acme-challenge";
};
@ -273,7 +254,7 @@ in
services.librespeed.frontend.servers = lib.mkIf (cfg.frontend.enable && (cfg.domain != null)) [
{
name = cfg.domain;
server = "//${cfg.domain}${lib.optionalString (!cfg.frontend.useNginx) ":${toString cfg.settings.listen_port}"}";
server = "//${cfg.domain}:${toString cfg.settings.listen_port}";
}
];
@ -288,7 +269,7 @@ in
else
pkgs.writeTextDir "index.html" "";
bind_address = mkDefault "127.0.0.1";
bind_address = mkDefault "::";
listen_port = mkDefault 8989;
base_url = mkDefault "backend";
worker_threads = mkDefault "auto";
@ -300,17 +281,17 @@ in
ipinfo_api_key = mkIf (!cfg.secrets ? "ipinfo_api_key") "";
stats_password = mkIf (!cfg.secrets ? "stats_password") "";
tls_cert_file =
if (cfg.domain != null && !cfg.frontend.useNginx) then
if (cfg.domain != null) then
(mkDefault "/run/credentials/librespeed.service/cert.pem")
else
(mkDefault "");
tls_key_file =
if (cfg.domain != null && !cfg.frontend.useNginx) then
if (cfg.domain != null) then
(mkDefault "/run/credentials/librespeed.service/key.pem")
else
(mkDefault "");
enable_tls = mkDefault (cfg.domain != null && !cfg.frontend.useNginx);
enable_tls = mkDefault (cfg.domain != null);
};
systemd.services =
@ -381,7 +362,7 @@ in
DynamicUser = true;
LoadCredential = lib.mkIf (cfg.domain != null && !cfg.frontend.useNginx) [
LoadCredential = lib.mkIf (cfg.domain != null) [
"cert.pem:${config.security.acme.certs.${cfg.domain}.directory}/cert.pem"
"key.pem:${config.security.acme.certs.${cfg.domain}.directory}/key.pem"
];