Personal-use NixOS configuration

Finish work on Zipline instance

+132 -8
hosts/index/config/web/deerzip.png

This is a binary file and will not be displayed.

+35
hosts/index/config/web/deerzip_latte.theme.json
··· 1 + { 2 + "name": "deerzip (Latte)", 3 + "id": "deerzip_latte", 4 + "colorScheme": "light", 5 + "colors": { 6 + "mauve": [ 7 + "#8839ef", 8 + "#8839ef", 9 + "#8839ef", 10 + "#8839ef", 11 + "#8839ef", 12 + "#8839ef", 13 + "#8839ef", 14 + "#8839ef", 15 + "#8839ef", 16 + "#8839ef" 17 + ], 18 + "gray": [ 19 + "#ccd0da", 20 + "#ccd0da", 21 + "#9ca0b0", 22 + "#ccd0da", 23 + "#acb0be", 24 + "#bcc0cc", 25 + "#5c5f77", 26 + "#eff1f5", 27 + "#e6e9ef", 28 + "#dce0e8" 29 + ] 30 + }, 31 + "white": "#eff1f5", 32 + "primaryColor": "mauve", 33 + "mainBackgroundColor": "#e6e9ef", 34 + "extraCss": "header h1 { font-family: 'Overpass' !important; font-style: italic; margin-top: 4px !important; } @font-face { font-family: 'Overpass'; font-style: italic; font-display: swap; font-weight: 700; src: url(https://cdn.jsdelivr.net/fontsource/fonts/overpass@latest/latin-700-italic.woff2) format('woff2'); }" 35 + }
+34
hosts/index/config/web/deerzip_macchiato.theme.json
··· 1 + { 2 + "name": "deerzip (Macchiato)", 3 + "id": "deerzip_macchiato", 4 + "colorScheme": "dark", 5 + "colors": { 6 + "mauve": [ 7 + "#c6a0f6", 8 + "#c6a0f6", 9 + "#c6a0f6", 10 + "#c6a0f6", 11 + "#c6a0f6", 12 + "#c6a0f6", 13 + "#c6a0f6", 14 + "#c6a0f6", 15 + "#c6a0f6", 16 + "#c6a0f6" 17 + ], 18 + "dark": [ 19 + "#cad3f5", 20 + "#8087a2", 21 + "#8087a2", 22 + "#6e738d", 23 + "#5b6078", 24 + "#494d64", 25 + "#363a4f", 26 + "#24273a", 27 + "#1e2030", 28 + "#181926" 29 + ] 30 + }, 31 + "primaryColor": "mauve", 32 + "mainBackgroundColor": "var(--mantine-color-dark-9)", 33 + "extraCss": "header h1 { font-family: 'Overpass' !important; font-style: italic; margin-top: 4px !important; } @font-face { font-family: 'Overpass'; font-style: italic; font-display: swap; font-weight: 700; src: url(https://cdn.jsdelivr.net/fontsource/fonts/overpass@latest/latin-700-italic.woff2) format('woff2'); }" 34 + }
+53 -2
hosts/index/config/web/zipline.nix
··· 1 - { flakeRoot, ... }: 1 + { flakeRoot, pkgs, lib, ... }: 2 2 3 3 let 4 + title = "deerzip"; 5 + logo = ./deerzip.png; 6 + 4 7 host = "deer.zip"; 5 8 9 + dataDirectory = "/mnt/data/zipline"; 10 + 11 + ziplinePackage = pkgs.zipline.overrideAttrs (old: { 12 + postInstall = '' 13 + mkdir -p $out/share/zipline/themes 14 + 15 + cp ${./deerzip_macchiato.theme.json} $out/share/zipline/themes/deerzip_macchiato.theme.json 16 + cp ${./deerzip_latte.theme.json} $out/share/zipline/themes/deerzip_latte.theme.json 17 + ''; 18 + }); 19 + 6 20 ziplineModule = import (flakeRoot + /packages/server/web/zipline.nix) { 7 21 hosts = [ 8 22 { 9 23 name = host; 10 24 ssl = "cloudflare"; 25 + 26 + extraConfig = '' 27 + @favicon path /favicon.png 28 + 29 + handle @favicon { 30 + rewrite * ${logo} 31 + file_server 32 + } 33 + ''; 11 34 } 12 35 ]; 13 36 }; ··· 21 44 environmentFiles = [ "/mnt/apps/zipline/.env" ]; 22 45 23 46 settings = { 47 + WEBSITE_TITLE = title; 48 + WEBSITE_TITLE_LOGO = "https://${host}/favicon.png"; 49 + 50 + WEBSITE_TOS = toString (pkgs.writeText "tos.md" '' 51 + be gay, don't do crimes 52 + ''); 53 + 54 + WEBSITE_EXTERNAL_LINKS = "[]"; 55 + 56 + WEBSITE_THEME_DARK = "deerzip_macchiato"; 57 + WEBSITE_THEME_LIGHT = "deerzip_latte"; 58 + 59 + MFA_TOTP_ISSUER = title; 60 + 61 + MFA_PASSKEYS_ENABLED = "true"; 62 + MFA_PASSKEYS_RP_ID = host; 63 + MFA_PASSKEYS_ORIGIN = "https://${host}"; 64 + 24 65 CORE_DEFAULT_DOMAIN = host; 25 66 26 - DATASOURCE_LOCAL_DIRECTORY = "/mnt/data/zipline/"; 67 + DATASOURCE_LOCAL_DIRECTORY = dataDirectory; 27 68 }; 69 + 70 + package = ziplinePackage; 71 + }; 72 + 73 + systemd.services.zipline.serviceConfig = { 74 + ProtectSystem = lib.mkForce "full"; 75 + 76 + ReadWritePaths = [ 77 + dataDirectory 78 + ]; 28 79 }; 29 80 }
+10 -6
packages/server/web/zipline.nix
··· 9 9 enable = true; 10 10 11 11 settings = { 12 + FILES_DEFAULT_EXPIRATION = "30d"; 13 + FILES_REMOVE_GPS_METADATA = "true"; 14 + 12 15 URLS_ROUTE = "/"; 13 16 FILES_ROUTE = "/"; 14 17 ··· 16 19 FILES_LENGTH = 3; 17 20 18 21 FILES_MAX_FILE_SIZE = "500mb"; 22 + FILES_DISABLED_EXTENSIONS = "exe,dmg,bat,bash,sh,html,htmx,html5"; 19 23 20 24 CORE_PORT = 3030; 21 25 22 - FEATURES_USER_REGISTRATION = false; 23 - FEATURES_OAUTH_REGISTRATION = false; 26 + MFA_TOTP_ENABLED = "true"; 24 27 25 - FEATURES_METRICS_ENABLED = false; 28 + FEATURES_USER_REGISTRATION = "false"; 29 + FEATURES_OAUTH_REGISTRATION = "false"; 26 30 27 - FEATURES_VERSION_CHECKING = false; 31 + FEATURES_HEALTHCHECK = "false"; 32 + FEATURES_METRICS_ENABLED = "false"; 28 33 29 - # https://zipline.diced.sh/docs/config/settings#variables-9 30 - # https://zipline.diced.sh/docs/config/settings#pwa 34 + FEATURES_VERSION_CHECKING = "false"; 31 35 }; 32 36 }; 33 37