From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ePwBG1Ab1mBdIgEAgWs5BA (envelope-from ) for ; Fri, 25 Jun 2021 20:07:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CEqhFlAb1mBbawAAbx9fmQ (envelope-from ) for ; Fri, 25 Jun 2021 18:07:12 +0000 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 9258E2CA33 for ; Fri, 25 Jun 2021 20:07:11 +0200 (CEST) Received: from localhost ([::1]:40776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwqEQ-0004C0-LU for larch@yhetil.org; Fri, 25 Jun 2021 14:07:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56736) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwqEI-0004Bs-CR for bug-guix@gnu.org; Fri, 25 Jun 2021 14:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35223) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwqEI-0005Qm-5J for bug-guix@gnu.org; Fri, 25 Jun 2021 14:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lwqEI-0003ak-0w for bug-guix@gnu.org; Fri, 25 Jun 2021 14:07:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#48974: A possible shepherd bug (it's very minor) Resent-From: Joshua Branson Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 25 Jun 2021 18:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48974 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Leo Prikler Cc: 48974@debbugs.gnu.org Received: via spool by 48974-submit@debbugs.gnu.org id=B48974.162464438713759 (code B ref 48974); Fri, 25 Jun 2021 18:07:01 +0000 Received: (at 48974) by debbugs.gnu.org; 25 Jun 2021 18:06:27 +0000 Received: from localhost ([127.0.0.1]:46769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwqDd-0003Zi-Ka for submit@debbugs.gnu.org; Fri, 25 Jun 2021 14:06:27 -0400 Received: from mx1.dismail.de ([78.46.223.134]:39645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwqDa-0003ZT-AE for 48974@debbugs.gnu.org; Fri, 25 Jun 2021 14:06:19 -0400 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 2c4d7590; Fri, 25 Jun 2021 20:06:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=20190914; bh=2lnnQuoW 36kYZiLwlalja20Yo2Yk9szLd2ZQOytRqv4=; b=YIHdzRqf3bodYZ9GbG6Tul9F Oj5Scp1c0SG7QD59eLTrg0By9+519xjoD9wbWPRbov1l9wQnNU03hIynNacC74Ra 684c70YHtXH120VSrrw3vI7bh24a97Z/g/BObNjM3Uq31c2Fsmwdioq127B4PN0m 1VUAJv2Xi1tqZrrFgH1snceWx48oD7450X6+Vwu0gMKAtrkxEaXio6EM8eI+66X8 xUD/Ii4LeYFIYbhl7y6VGnXogd7NwvE29m2JxTES28+aB6HnJA6EuOtOQoGt9WyX pgR/dNlyTNx6w76HNRip2Ju3tZy/av2O9yFumqMgzOhemP9qd28TtC0bGV9Dsg== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 304dc486; Fri, 25 Jun 2021 20:06:11 +0200 (CEST) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id 4e8564cb; Fri, 25 Jun 2021 20:06:11 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id 251c5ccb (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Fri, 25 Jun 2021 20:06:10 +0200 (CEST) References: <9d5c5334eacfae92ace38329e55bc4a91929e206.camel@student.tugraz.at> <87wnqz43k0.fsf@dismail.de> <3192d62ef790c16fb2dfb894d9ccb160@dismail.de> <13bff20e418f1cec97cdda49ffed51544c5c9402.camel@student.tugraz.at> <87mtre5lzy.fsf@dismail.de> <6254e4d32697986bd61986e10399f341930c5c2e.camel@student.tugraz.at> Date: Fri, 25 Jun 2021 14:06:08 -0400 In-Reply-To: <6254e4d32697986bd61986e10399f341930c5c2e.camel@student.tugraz.at> (Leo Prikler's message of "Fri, 25 Jun 2021 11:56:40 +0200") Message-ID: <875yy1vmy7.fsf@dismail.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" Reply-to: Joshua Branson From: Joshua Branson via Bug reports for GNU Guix X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624644431; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fLkuPueTEJrDXUURhwLNRho2xD4dp95vUHDxTMK7URY=; b=ifKO+qDhRZ/ryTSA/UbC7Cua4yIU1a+Pojll96f1LykSy5HMRC16cMHscgQ0Y5UVln5Eg9 CgDpBV0522T+7o90RASesDmnGnrH6UNvL1YO2t/I5iV4uCz73g1+ozBymOERWmN1SS1jpv V5P/XjnkT2E+wh1Drg37nhRsSt9VAdBoSMeBrs0+l2J2tyB44QyCJaRx2a4kDeZAC6mrft YRIcX6yqJV5sk3+j7dF9IehVEaAz8LJaNtQ8Chvjl+Q3pzbwLgWKM0JfOhxA1xQIjyzOkl 48xFthd70e02RqiVGLSv8z3zDM0NoDU8f3E2+bA5pUWL0tmSCj9k5oHStmdA4w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624644431; a=rsa-sha256; cv=none; b=IkO9DsCuKApf/2JxbJ4Ny3+LPcwR7oGKAzKHOLU15h1bdYbgTZQym6PS1lZtkhs7r5Uoid fr4INJoDazoY7yMYgSeFcYBQgNug17hrHbCOIiAB0paBakrYMHn+NUIURqDITTCIRVatkk N53TwWxXf99376BGrxjriyWXr6WZSPTLXsFi37OTxC1vdq5zZ6jAt7M9zxn1Ok9ClGcixM tD/m/8iGvnLVp4cxSCH0XiSKEfPF2u7RpjFOcjq35yKDL0lyZqXLABgplKMP18Qww2NPac qCkPt7He1Ozq80BQb3btz4FHSRDZFmTjZ0YEUBFDKcZ0vI/kIPIhnUAQjJZUFg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=dismail.de header.s=20190914 header.b=YIHdzRqf; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=dismail.de header.s=20190914 header.b=YIHdzRqf; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 9258E2CA33 X-Spam-Score: -2.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: +6j58OcWwCfj Leo Prikler writes: > Hi, > > Am Freitag, den 25.06.2021, 05:31 -0400 schrieb Joshua Branson: >> Leo Prikler writes: >> >> > Hi, >> > >> > Am Samstag, den 12.06.2021, 20:09 +0000 schrieb jbranso@dismail.de: >> > > June 12, 2021 3:39 PM, "Leo Prikler" < >> > > leo.prikler@student.tugraz.at> >> > > wrote: >> > > >> > > > Am Samstag, den 12.06.2021, 09:26 -0400 schrieb Joshua Branson: >> > > > >> > > > > Hello! >> > > > > >> > > I'll tell you what, why don't we leave this "bug" open for a >> > > week...I'll try to write >> > > the code that does what I want, and I'll email the answer. >> > > >> > > Then I'll edit the manual to provide an example! >> Well, it's been about a week. Here is my current code that doesn't >> work. >> haha. >> >> #+BEGIN_SRC scheme >> (define %my-desktop-services >> (modify-services %desktop-services ;;end of remove services >> (mingetty-service-type config =3D> >> (mingetty-configuration >> (inherit config) >> ;; ERROR at the NEXT LINE >> (auto-login-to-tty-3 config) >> )))) >> >> (define (auto-login-to-tty-3 config) >> (if (string=3D? "3" (mingetty-configuration-tty config)) >> '(auto-login "joshua") >> '(auto-login #f))) >> #+END_SRC >> >> It obviously doesn't work because I am treating modify-services as if >> it were a procedure. In fact, it is a macro. :) > That's not the issue here, the issue is that you're treating mingetty- > configuration as=E2=80=A6 I'm not really sure what exactly, when it is in= fact > a record constructor. Oh!!!! Light bulb! I knew that! I've made quite a few record constructors for endlessh and my almost complete sway service: http://issues.guix.gnu.org/39136 https://notabug.org/jbranso/guix-config/src/master/sway-service.scm > > Try the following: > > #+BEGIN_SRC scheme > (define (auto-login-to-tty tty user) > ;; TODO: you might want to implement this as match-lambda instead I will try that! > (lambda (config) > (if (string=3D? tty (mingetty-configuration-tty mingetty-config)) > (mingetty-configuration > (inherit config) > (auto-login user)) > config))) > > (define %my-desktop-services > (modify-services %desktop-services > > (mingetty-service-type config =3D> > (auto-login- > to-tty "3" "joshua")))) > #+END_SRC > Hmmm. Is that (define (auto-login-to-tty tty user) ...) a closure? I wonder why you need that lambda inside of it...Probably to pass the config variable into the function...hmmm. I still don't understand why it is necessary. I'll think about that a bit later on. > >> #+BEGIN_SRC scheme >> (define (auto-login-to-tty-3 mingetty-service) >> (if (string=3D? "3" (mingetty-configuration-tty config)) >> '(mingetty-configuration >> (auto-login "joshua") >> (tty "3")) >> mingetty-service)) > Don't quote mingetty-configuration et al. They're first-class syntax, > not just weird lists. Yeah that's true. I do actually like (guix records)! I feel like that file should be upstreamed into guile! > >> (define (my-modify-%desktop-services-to-auto-login-on-tty-3 %desktop- >> services) >> ;; to be written >> ;; though I think fold, or map, may be useful functions here. >> >> ;;somehow I will use this function... >> (auto-login-to-tty-3 mingetty-service) >> ) >> >> (define %my-desktop-services >> (my-modify-%desktop-services-to-auto-login-on-tty-3 %desktop- >> services)) > I don't think you need to implement modify-services on your own, rather > just use the existing thing in the "correct" way =E2=80=93 i.e. adhering = to the > expectations given by the already existing procedure (or macro). Thanks again! The current code doesn't quite work for me yet. I'll try using match-lambda to define it. I'll post again when I have a free moment. When i get it working, I'll send a patch to the manual via guix-patches and CC you. Is that ok? Or would you rather that documentation be in the cookbook? >> #+END_SRC > Regards, > Leo > -- Joshua Branson (joshuaBPMan in #guix) Sent from Emacs and Gnus https://gnucode.me https://video.hardlimit.com/accounts/joshua_branson/video-channels https://propernaming.org "You can have whatever you want, as long as you help enough other people get what they want." - Zig Ziglar