From d1852c03e9255e7799319ad89036f4b82b992bff Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Fri, 7 Nov 2025 16:14:42 +0100 Subject: [PATCH] feat(upfast): service for removing payloads. --- modules/servers/odin/upfast-cleaner.sh | 4 +--- modules/servers/odin/upfast.nix | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/servers/odin/upfast-cleaner.sh b/modules/servers/odin/upfast-cleaner.sh index c735f54..f56bbec 100755 --- a/modules/servers/odin/upfast-cleaner.sh +++ b/modules/servers/odin/upfast-cleaner.sh @@ -1,6 +1,4 @@ -#!/usr/bin/env sh - -instance="$*" +instance="http://127.0.0.1:8383" files=$(curl -s "$instance"/files/) diff --git a/modules/servers/odin/upfast.nix b/modules/servers/odin/upfast.nix index b4deaf7..486c6cc 100644 --- a/modules/servers/odin/upfast.nix +++ b/modules/servers/odin/upfast.nix @@ -1,4 +1,15 @@ -{inputs, ...}: { +{ + inputs, + pkgs, + lib, + ... +}: let + upfast-cleaner = pkgs.writeShellApplication { + name = "upfast-cleaner"; + runtimeInputs = with pkgs; [curl]; + text = ./upfast-cleaner.sh; + }; +in { fileSystems."/var/lib/upfast" = { device = "/root/10gb"; fsType = "ext4"; @@ -51,7 +62,7 @@ WorkingDirectory = "/var/lib/upfast"; }; - script = "${./upfast-cleaner.sh} 'http://localhost:8383'"; + script = "${lib.getExe upfast-cleaner}; 'http://localhost:8383'"; }; systemd.timers.upfast-cleaner = {