From 1142c6acac6d51f964f66f1212eaf70a79fdbab6 Mon Sep 17 00:00:00 2001 From: Vivian Date: Tue, 2 Jan 2024 16:55:47 +0100 Subject: [PATCH] minor updates --- flake.lock | 6 +++--- nixos/common/modules/dns.nix | 8 ++++---- nixos/hosts/hades/jellyfin/configuration.nix | 2 +- nixos/hosts/hades/storage/configuration.nix | 8 +++----- nixos/hosts/olympus/nginx/configuration.nix | 19 ++++++++++++------- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/flake.lock b/flake.lock index 67853f33..27801f6a 100644 --- a/flake.lock +++ b/flake.lock @@ -254,11 +254,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1703864604, - "narHash": "sha256-XAqPLb7H5rcQMC9OeKlnUNVr8hte+1L1GeZC0ZR7akc=", + "lastModified": 1704204809, + "narHash": "sha256-O76nB41RyfedpCfcO4GU5i2Ng7ZUMbZnF+Ceq0e8LIs=", "owner": "jdonszelmann", "repo": "essentials", - "rev": "2da99cdc27364844a887ea1c6ed3146c84c15041", + "rev": "8209683dc3c5edd747efccd187f512771d8f3a0c", "type": "github" }, "original": { diff --git a/nixos/common/modules/dns.nix b/nixos/common/modules/dns.nix index 0b9ed85e..056ea3aa 100644 --- a/nixos/common/modules/dns.nix +++ b/nixos/common/modules/dns.nix @@ -15,8 +15,7 @@ let ptr6Data = { hostname, realm, ip6, ... }: ''"${ip6} ${hostname}.${realm}"''; cfg = config.services.v.dns; -in -{ +in { options.services.v.dns = { enable = mkEnableOption "v.dns"; @@ -38,7 +37,7 @@ in }; mode = mkOption { - type = types.strMatching "^(server|laptop)$"; + type = enum [ "server" "laptop" ]; default = "laptop"; description = '' Whether to configure the DNS in server mode (listen on all interfaces) or laptop mode (just on localhost) @@ -60,7 +59,8 @@ in services.unbound = { enable = true; package = pkgs.v.unbound; - localControlSocketPath = mkIf cfg.enableMetrics "/run/unbound/unbound.socket"; + localControlSocketPath = + mkIf cfg.enableMetrics "/run/unbound/unbound.socket"; settings = { server = mkMerge [ { diff --git a/nixos/hosts/hades/jellyfin/configuration.nix b/nixos/hosts/hades/jellyfin/configuration.nix index 275521cb..46cc88d2 100644 --- a/nixos/hosts/hades/jellyfin/configuration.nix +++ b/nixos/hosts/hades/jellyfin/configuration.nix @@ -39,7 +39,6 @@ systemd.tmpfiles.rules = [ "d '/var/lib/watchstate' 0755 watchstate watchstate -" ]; - networking.firewall.allowedTCPPorts = [ 8080 ]; # Managed imperatively through its CLI @@ -51,6 +50,7 @@ WS_TZ = "Europe/Amsterdam"; WS_CRON_IMPORT = "1"; WS_CRON_EXPORT = "1"; + WS_CRON_PROGRESS = "1"; }; ports = [ "8080:8080" ]; volumes = [ "/var/lib/watchstate:/config:rw" ]; diff --git a/nixos/hosts/hades/storage/configuration.nix b/nixos/hosts/hades/storage/configuration.nix index fc4506fb..e2be5846 100644 --- a/nixos/hosts/hades/storage/configuration.nix +++ b/nixos/hosts/hades/storage/configuration.nix @@ -6,11 +6,12 @@ ./fs.nix ]; + boot.loader.systemd-boot.enable = true; services = { # Enable the OpenSSH daemon. - openssh.enable = true; # Did you read the comment? + openssh.enable = true; nfs.server = { enable = true; @@ -22,10 +23,7 @@ snapraid = { enable = true; parityFiles = - [ - "/mnt/parity1/snapraid.parity" - "/mnt/parity2/snapraid.parity" - ]; + [ "/mnt/parity1/snapraid.parity" "/mnt/parity2/snapraid.parity" ]; dataDisks = { d1 = "/mnt/disk1"; d2 = "/mnt/disk2"; diff --git a/nixos/hosts/olympus/nginx/configuration.nix b/nixos/hosts/olympus/nginx/configuration.nix index 36e58712..b4f68c39 100644 --- a/nixos/hosts/olympus/nginx/configuration.nix +++ b/nixos/hosts/olympus/nginx/configuration.nix @@ -13,8 +13,7 @@ let add_header Access-Control-Allow-Origin *; return 200 '${builtins.toJSON data}'; ''; -in -{ +in { # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave @@ -40,9 +39,15 @@ in package = pkgs.nginxMainline; + commonHttpConfig = '' + types { + application/javascript mjs; + } + ''; + # Templated virtualHosts = { - "pass.0x76.dev" = { + "pass.0x76.dev" = { enableACME = true; forceSSL = true; locations = { @@ -66,8 +71,8 @@ in forceSSL = true; locations."/".extraConfig = '' - add_header Content-Type 'text/html; charset=UTF-8'; - return 200 '

Under Construction

'; + add_header Content-Type 'text/html; charset=UTF-8'; + return 200 '

Under Construction

'; ''; }; @@ -76,8 +81,8 @@ in forceSSL = true; locations."/".extraConfig = '' - add_header Content-Type 'text/html; charset=UTF-8'; - return 200 '

Under Construction

'; + add_header Content-Type 'text/html; charset=UTF-8'; + return 200 '

Under Construction

'; ''; };