Merge pull request 'Nixpkgs Update' (#8) from staging-dev into stable

Reviewed-on: #8
This commit was merged in pull request #8.
This commit is contained in:
2026-06-02 11:32:45 -05:00
6 changed files with 112 additions and 49 deletions
+37 -1
View File
@@ -652,6 +652,37 @@ templates = Jinja2Templates(directory=os.path.join(_BASE_DIR, "templates"))
# ── Static asset cache-busting ──────────────────────────────────── # ── Static asset cache-busting ────────────────────────────────────
def _compute_asset_version() -> str:
"""Return a 16-char asset version from Nix store hash or static/template metadata."""
nix_match = re.search(r"/nix/store/([a-z0-9]{32})-", os.path.realpath(_BASE_DIR))
if nix_match:
return nix_match.group(1)[:16]
hasher = hashlib.sha256()
for root in (
os.path.join(_BASE_DIR, "static"),
os.path.join(_BASE_DIR, "templates"),
):
if not os.path.isdir(root):
continue
for dirpath, dirnames, filenames in os.walk(root):
dirnames.sort()
for filename in sorted(filenames):
path = os.path.join(dirpath, filename)
try:
stat = os.stat(path)
except OSError:
continue
hasher.update(path.encode())
hasher.update(b"\0")
hasher.update(f"{stat.st_mtime_ns}:{stat.st_size}".encode())
hasher.update(b"\0")
return hasher.hexdigest()[:16]
ASSET_VERSION = _compute_asset_version()
def _file_hash(filename: str) -> str: def _file_hash(filename: str) -> str:
"""Return first 8 chars of the MD5 hex digest for a static file.""" """Return first 8 chars of the MD5 hex digest for a static file."""
path = os.path.join(_BASE_DIR, "static", filename) path = os.path.join(_BASE_DIR, "static", filename)
@@ -1894,7 +1925,10 @@ def _verify_support_removed() -> bool:
@app.get("/login", response_class=HTMLResponse) @app.get("/login", response_class=HTMLResponse)
async def login_page(request: Request): async def login_page(request: Request):
return templates.TemplateResponse("login.html", {"request": request}) return templates.TemplateResponse("login.html", {
"request": request,
"asset_version": ASSET_VERSION,
})
@app.get("/auto-login") @app.get("/auto-login")
@@ -1961,6 +1995,7 @@ async def api_logout(request: Request):
async def index(request: Request): async def index(request: Request):
return templates.TemplateResponse("index.html", { return templates.TemplateResponse("index.html", {
"request": request, "request": request,
"asset_version": ASSET_VERSION,
}) })
@@ -1969,6 +2004,7 @@ async def onboarding(request: Request):
_ensure_onboarding_reopened_for_migration() _ensure_onboarding_reopened_for_migration()
return templates.TemplateResponse("onboarding.html", { return templates.TemplateResponse("onboarding.html", {
"request": request, "request": request,
"asset_version": ASSET_VERSION,
"onboarding_js_hash": _ONBOARDING_JS_HASH, "onboarding_js_hash": _ONBOARDING_JS_HASH,
}) })
+22 -22
View File
@@ -4,17 +4,17 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sovran_SystemsOS Hub</title> <title>Sovran_SystemsOS Hub</title>
<link rel="stylesheet" href="/static/css/base.css" /> <link rel="stylesheet" href="/static/css/base.css?v={{ asset_version }}" />
<link rel="stylesheet" href="/static/css/buttons.css" /> <link rel="stylesheet" href="/static/css/buttons.css?v={{ asset_version }}" />
<link rel="stylesheet" href="/static/css/header.css" /> <link rel="stylesheet" href="/static/css/header.css?v={{ asset_version }}" />
<link rel="stylesheet" href="/static/css/layout.css" /> <link rel="stylesheet" href="/static/css/layout.css?v={{ asset_version }}" />
<link rel="stylesheet" href="/static/css/tiles.css" /> <link rel="stylesheet" href="/static/css/tiles.css?v={{ asset_version }}" />
<link rel="stylesheet" href="/static/css/modals.css" /> <link rel="stylesheet" href="/static/css/modals.css?v={{ asset_version }}" />
<link rel="stylesheet" href="/static/css/features.css" /> <link rel="stylesheet" href="/static/css/features.css?v={{ asset_version }}" />
<link rel="stylesheet" href="/static/css/onboarding.css" /> <link rel="stylesheet" href="/static/css/onboarding.css?v={{ asset_version }}" />
<link rel="stylesheet" href="/static/css/support.css" /> <link rel="stylesheet" href="/static/css/support.css?v={{ asset_version }}" />
<link rel="stylesheet" href="/static/css/domain-setup.css" /> <link rel="stylesheet" href="/static/css/domain-setup.css?v={{ asset_version }}" />
<link rel="stylesheet" href="/static/css/security.css" /> <link rel="stylesheet" href="/static/css/security.css?v={{ asset_version }}" />
</head> </head>
<body> <body>
@@ -263,16 +263,16 @@
</div> </div>
</div> </div>
<script src="/static/js/constants.js"></script> <script src="/static/js/constants.js?v={{ asset_version }}"></script>
<script src="/static/js/state.js"></script> <script src="/static/js/state.js?v={{ asset_version }}"></script>
<script src="/static/js/helpers.js"></script> <script src="/static/js/helpers.js?v={{ asset_version }}"></script>
<script src="/static/js/tiles.js"></script> <script src="/static/js/tiles.js?v={{ asset_version }}"></script>
<script src="/static/js/service-detail.js"></script> <script src="/static/js/service-detail.js?v={{ asset_version }}"></script>
<script src="/static/js/support.js"></script> <script src="/static/js/support.js?v={{ asset_version }}"></script>
<script src="/static/js/update.js"></script> <script src="/static/js/update.js?v={{ asset_version }}"></script>
<script src="/static/js/rebuild.js"></script> <script src="/static/js/rebuild.js?v={{ asset_version }}"></script>
<script src="/static/js/features.js"></script> <script src="/static/js/features.js?v={{ asset_version }}"></script>
<script src="/static/js/security.js"></script> <script src="/static/js/security.js?v={{ asset_version }}"></script>
<script src="/static/js/events.js"></script> <script src="/static/js/events.js?v={{ asset_version }}"></script>
</body> </body>
</html> </html>
@@ -4,8 +4,8 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sovran Hub — Login</title> <title>Sovran Hub — Login</title>
<link rel="stylesheet" href="/static/css/base.css" /> <link rel="stylesheet" href="/static/css/base.css?v={{ asset_version }}" />
<link rel="stylesheet" href="/static/css/buttons.css" /> <link rel="stylesheet" href="/static/css/buttons.css?v={{ asset_version }}" />
</head> </head>
<body> <body>
<div class="login-wrapper"> <div class="login-wrapper">
+7 -1
View File
@@ -26,6 +26,13 @@
nix.settings = { nix.settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
download-buffer-size = 524288000; download-buffer-size = 524288000;
# Network resilience for cache.nixos.org (Fastly) flakiness.
connect-timeout = 10; # fail-fast on dead TCP connects (default: 0 = unlimited)
stalled-download-timeout = 90; # default 300s; retry sooner on stalled transfers
download-attempts = 7; # default 5
http-connections = 25; # cap concurrency (helps MTU/middlebox paths)
fallback = true; # build locally if a substitute can't be fetched
}; };
# ── Networking ────────────────────────────────────────────── # ── Networking ──────────────────────────────────────────────
@@ -63,7 +70,6 @@
# ── Desktop ──────────────────────────────────────────────── # ── Desktop ────────────────────────────────────────────────
services.displayManager.gdm.enable = true; services.displayManager.gdm.enable = true;
services.displayManager.gdm.autoSuspend = false; services.displayManager.gdm.autoSuspend = false;
services.displayManager.gdm.wayland = true;
services.desktopManager.gnome.enable = true; services.desktopManager.gnome.enable = true;
services.printing.enable = true; services.printing.enable = true;
systemd.enableEmergencyMode = false; systemd.enableEmergencyMode = false;
Generated
+19 -18
View File
@@ -23,11 +23,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1779373552, "lastModified": 1780397635,
"narHash": "sha256-9FCY5+WZmoZi4zN0xbdq3lNcPudvYjONpv21/9ddV/0=", "narHash": "sha256-6WH7LKD6i91VLWoz4mEpoULtqVinCEZxG7ZjJPMSi3k=",
"owner": "emmanuelrosa", "owner": "emmanuelrosa",
"repo": "btc-clients-nix", "repo": "btc-clients-nix",
"rev": "94797b5b75bbc021b0ceb83473110bcb58683542", "rev": "feacd7684dc6bfcd49c57764944a2049bbd71924",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -190,11 +190,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1777728799, "lastModified": 1780218263,
"narHash": "sha256-z7jjYQqhkFKab92VQ3duB7QVO7f7Y62qTFrJYXO/lyo=", "narHash": "sha256-T/f0pPDrH3Qc1VXyQXbK7yfHWRn90l3xwplc/nsxin4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4b2287113c2f9a2331c04899b2e2e5ab92dea9c5", "rev": "7fc393d1b46fa000d48ff14e8b6a3c9985f03af0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -221,11 +221,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1778869304, "lastModified": 1780243769,
"narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", "narHash": "sha256-x5UQuRsH3MqI0U9afaXSNqzTPSeZlRLvFAav2Ux1pNw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d233902339c02a9c334e7e593de68855ad26c4cb", "rev": "331800de5053fcebacf6813adb5db9c9dca22a0c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -237,11 +237,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1779259093, "lastModified": 1780030872,
"narHash": "sha256-7DKWmH23hL2eYdkxCKeqj2i+yljTKuU+3Nk1UPHOnxc=", "narHash": "sha256-u6WU/yd/o8iYQrHX3RAwO1hYa3LkoSL+WNQD0rJfJZQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d99b013d5d1931ad77fe3912ed218170dec5d9a4", "rev": "e9a7635a57597d9754eccebdfc7045e6c8600e6b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -258,11 +258,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1779399125, "lastModified": 1780235872,
"narHash": "sha256-MWvSXTl1xUJsf74f1wD9mCWWsYN4uR1iAJNmUEnknqw=", "narHash": "sha256-/TTVFhJQ5StCOrRFO+5NfSkYPSbAAekwymovcQzxNgE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "7f6f92a3c9f5e1d61d417bf761b4934ac5acc401", "rev": "e5c7b40dc569f5c97ba2182d409f0fb54c02d7c1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -298,15 +298,16 @@
}, },
"systems_2": { "systems_2": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1774449309,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-brhZ8DmuGtzkCYHJg4HEd602amKm89Y9ytsFZ5uWD1w=",
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "rev": "c29398b59d2048c4ab79345812849c9bd15e9150",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-systems", "owner": "nix-systems",
"ref": "future-26.11",
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
+25 -5
View File
@@ -138,7 +138,11 @@ let
RC=0 RC=0
echo " Step 1/3: nix flake update " echo " Step 1/3: nix flake update "
if ! nix flake update --flake /etc/nixos --print-build-logs 2>&1; then if ! nix flake update --flake /etc/nixos --print-build-logs \
--option connect-timeout 10 \
--option stalled-download-timeout 90 \
--option download-attempts 7 \
--option fallback true 2>&1; then
echo "[ERROR] nix flake update failed" echo "[ERROR] nix flake update failed"
RC=1 RC=1
fi fi
@@ -146,7 +150,11 @@ let
if [ "$RC" -eq 0 ]; then if [ "$RC" -eq 0 ]; then
echo " Step 2/3: nixos-rebuild " echo " Step 2/3: nixos-rebuild "
SWITCH_OUT=$(nixos-rebuild switch --flake /etc/nixos --print-build-logs 2>&1) SWITCH_OUT=$(nixos-rebuild switch --flake /etc/nixos --print-build-logs \
--option connect-timeout 10 \
--option stalled-download-timeout 90 \
--option download-attempts 7 \
--option fallback true 2>&1)
SWITCH_RC=$? SWITCH_RC=$?
echo "$SWITCH_OUT" echo "$SWITCH_OUT"
if [ "$SWITCH_RC" -eq 0 ]; then if [ "$SWITCH_RC" -eq 0 ]; then
@@ -155,7 +163,11 @@ let
echo "" echo ""
echo " Build succeeded a reboot is required to apply this update" echo " Build succeeded a reboot is required to apply this update"
echo " (Critical system components changed; running nixos-rebuild boot instead)" echo " (Critical system components changed; running nixos-rebuild boot instead)"
if nixos-rebuild boot --flake /etc/nixos --print-build-logs 2>&1; then if nixos-rebuild boot --flake /etc/nixos --print-build-logs \
--option connect-timeout 10 \
--option stalled-download-timeout 90 \
--option download-attempts 7 \
--option fallback true 2>&1; then
echo "REBOOT_REQUIRED" > "$STATUS" echo "REBOOT_REQUIRED" > "$STATUS"
exit 0 exit 0
else else
@@ -209,7 +221,11 @@ let
echo "" echo ""
echo "" echo ""
echo " Rebuilding system configuration " echo " Rebuilding system configuration "
SWITCH_OUT=$(nixos-rebuild switch --flake /etc/nixos --print-build-logs 2>&1) SWITCH_OUT=$(nixos-rebuild switch --flake /etc/nixos --print-build-logs \
--option connect-timeout 10 \
--option stalled-download-timeout 90 \
--option download-attempts 7 \
--option fallback true 2>&1)
SWITCH_RC=$? SWITCH_RC=$?
echo "$SWITCH_OUT" echo "$SWITCH_OUT"
if [ "$SWITCH_RC" -eq 0 ]; then if [ "$SWITCH_RC" -eq 0 ]; then
@@ -222,7 +238,11 @@ let
echo "" echo ""
echo " Build succeeded a reboot is required to apply this rebuild" echo " Build succeeded a reboot is required to apply this rebuild"
echo " (Critical system components changed; running nixos-rebuild boot instead)" echo " (Critical system components changed; running nixos-rebuild boot instead)"
if nixos-rebuild boot --flake /etc/nixos --print-build-logs 2>&1; then if nixos-rebuild boot --flake /etc/nixos --print-build-logs \
--option connect-timeout 10 \
--option stalled-download-timeout 90 \
--option download-attempts 7 \
--option fallback true 2>&1; then
echo "REBOOT_REQUIRED" > "$STATUS" echo "REBOOT_REQUIRED" > "$STATUS"
else else
echo "[ERROR] nixos-rebuild boot also failed" echo "[ERROR] nixos-rebuild boot also failed"