From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id IM2eMkYTUGZ8wAAAe85BDQ:P1 (envelope-from ) for ; Fri, 24 May 2024 06:10:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id IM2eMkYTUGZ8wAAAe85BDQ (envelope-from ) for ; Fri, 24 May 2024 06:10:46 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lease-up.com header.s=2017 header.b=ZMHi9xMG; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716523846; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DN+C9N2FyWzaahbv7DIcYOu2bJn7ooutxutDy7/mVZ4=; b=KaGsoTP5JYzHyIliQCpgOI4Uc1zVBLJ/fmuRKVwwX6yj6KQzSeOyrmJGUx6xyfBt9l3Iua R9eHQ/96slXIY+yaistNyH8kQaMSmqU6gI5Crsvp4hu1Nxiz0PhArsM1/v1G7PovGFpisQ 91OyXfgml9PKGLFng91i6d4NpF49IelUxnCU1t1rH32E9seWeVsOiGN+4dlnvQGH2yh68a U8IZ+gs97s9d6fLmUipYf3msOv9g4bEaxSgZw0f/FWOLzYmLIZIMVv+TU1V/HXb3WfP1JP c64gWLIFDsUA8FIjg/7ECDfofRmPSyjeEo1y48czxyvmeqiL5J/BJm8p8gnB2Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716523846; a=rsa-sha256; cv=none; b=LtRWmO5lUFLh8O/lLIz5XlJd6f1YZNhCjq7krKRtBRKC4nYA7YgOMfYlgevcXVN7aB7XOd IbLCHVQdNOl1FLExjEbxeflvX6kpa1QftJ/Kt1V0hLEQD69BBbPtQCoZjryQRZ98UqH5pG jBlk2mjL1XeT9S+6hU2a7kg+x0Scx1iyrrEroN2OdvYIAWBpU1Lmzl+sYyBmlF7/EKS6/w Ia4+/RpcnmpIpVSQMp/5SiVmbw+ZkqVpaVrMXkjFlJhIlq+5BBlVHVOVBnIBcdXHuaEecd I68c/yBvIP7KCS+BjYCwG0+TMGPeyLvUN/+wIWq3epUPbCMOJz8n9DA3lEmDww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lease-up.com header.s=2017 header.b=ZMHi9xMG; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 570773DFD0 for ; Fri, 24 May 2024 06:10:45 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAMG1-0000f5-F5; Fri, 24 May 2024 00:10:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAMFx-0000eb-6U for help-guix@gnu.org; Fri, 24 May 2024 00:10:13 -0400 Received: from sail-ipv4.us-core.com ([208.82.101.137]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1sAMFt-0008P0-LQ for help-guix@gnu.org; Fri, 24 May 2024 00:10:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=NlTuiOzuKgWvkO7 HfrhDT3YpvUeJSna3QmIVoDz0awU=; h=date:references:in-reply-to:subject: cc:to:from; d=lease-up.com; b=ZMHi9xMGc1Sgl0GTLb+dCPtRrbC/+MiHUg2C1kE3 7UylzPhxSPbXbgHjVbDR3/Fj8k8fz9LaLawlBnhdCC0iqEQyrm9KUSAosYxNgmSSTWT38f eezwRRPL45Cfso9M9KM+w8Z5ZOJxckeqnov3DBexXwk009/lhPm2+hy0OzH2E= Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 0f9190c7 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Fri, 24 May 2024 04:10:02 +0000 (UTC) To: Tristan Kohl , help-guix@gnu.org Cc: Subject: Re: How to configure smartd and send notifications? In-Reply-To: References: <4D873504-6540-477A-A2DB-DE293395CAFC.ref@ymail.com> <4D873504-6540-477A-A2DB-DE293395CAFC@ymail.com> <87seycu3df.fsf@lease-up.com> <87msokttht.fsf@lease-up.com> <0525BF4D-96C2-4F58-BB27-19A88DD8403E@ymail.com> <87jzjot5it.fsf@lease-up.com> <79C29ABD-8FFC-4930-A8E0-798ABF4EEB11@ymail.com> Date: Thu, 23 May 2024 21:10:02 -0700 Message-ID: <87h6ensvdx.fsf@lease-up.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=208.82.101.137; envelope-from=felix.lechner@lease-up.com; helo=sail-ipv4.us-core.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Felix Lechner From: Felix Lechner via Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -2.85 X-Spam-Score: -2.85 X-Migadu-Queue-Id: 570773DFD0 X-Migadu-Scanner: mx11.migadu.com X-TUID: bClR8agWg+UJ Hi Tristan, On Thu, May 23 2024, Tristan Kohl via wrote: > I did not even think about using Guile as the executable :D Congratulations! Maybe you will stop writing shell scripts altogether. > Wrong type to apply: # For me, that error often means an extra pair of parentheses, such as trying to evaluate a constant, but here the issue could be that http-get returns two values. [1] Maybe this works without an error? (use-module (gnu) (guix modules)) (use-package-modules tls) (define smartd-send-ntfy (program-file "smartd-send-ntfy" (with-extensions (list gnutls) (with-imported-modules (source-module-closure '((ice-9 receive) (web client))) #~((use-modules (ice-9 receive) (web client)) (receive (_ body) (http-get "https://example.com") body))))) Instead of the string body, you could return a success value via something like (not (string-null? body)) You can look at the values in the comfort of the Guile REPL, or in Emacs Geiser. Kind regards Felix [1] https://www.gnu.org/software/guile//manual/html_node/Multiple-Values.html