From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QH4/IEKq1WDPTgAAgWs5BA (envelope-from ) for ; Fri, 25 Jun 2021 12:04:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 8CTyG0Kq1WDlSgAAB5/wlQ (envelope-from ) for ; Fri, 25 Jun 2021 10:04:50 +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 AE2642424F for ; Fri, 25 Jun 2021 12:04:49 +0200 (CEST) Received: from localhost ([::1]:36998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwihc-0004Y8-Of for larch@yhetil.org; Fri, 25 Jun 2021 06:04:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwia6-0004rr-J2 for bug-guix@gnu.org; Fri, 25 Jun 2021 05:57:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33350) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwia6-0001A9-8g for bug-guix@gnu.org; Fri, 25 Jun 2021 05:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lwia6-0002mb-5I for bug-guix@gnu.org; Fri, 25 Jun 2021 05:57:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#48974: A possible shepherd bug (it's very minor) Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 25 Jun 2021 09:57:02 +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: Joshua Branson Received: via spool by 48974-submit@debbugs.gnu.org id=B48974.162461501010678 (code B ref 48974); Fri, 25 Jun 2021 09:57:02 +0000 Received: (at 48974) by debbugs.gnu.org; 25 Jun 2021 09:56:50 +0000 Received: from localhost ([127.0.0.1]:44896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwiZu-0002m9-5w for submit@debbugs.gnu.org; Fri, 25 Jun 2021 05:56:50 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:17082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwiZo-0002lv-EG for 48974@debbugs.gnu.org; Fri, 25 Jun 2021 05:56:48 -0400 Received: from nijino.local (62-116-34-49.adsl.highway.telekom.at [62.116.34.49]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4GBC890w1xz3xCP; Fri, 25 Jun 2021 11:56:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1624615001; bh=M2CeKDUNePxoFwUcd0WPo7bS7hlmp7S/gmfV/ZotY/w=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=PlV9YGDR9ivrT+56PmDghLodOyoRnNb6wEVHBedF+Y88vTs000+cu/t8FTjm9X+sG CmbHFWop1xjqJK8QfcM4N5fc0ulDJEerBtGos/Ey+fq+AjdH2qjj3lDncTL0B1bi2l EM9NeMoUKfl6l2zBH0JlCWfir/26U13aSFyw+v6E= Message-ID: <6254e4d32697986bd61986e10399f341930c5c2e.camel@student.tugraz.at> From: Leo Prikler Date: Fri, 25 Jun 2021 11:56:40 +0200 In-Reply-To: <87mtre5lzy.fsf@dismail.de> References: <9d5c5334eacfae92ace38329e55bc4a91929e206.camel@student.tugraz.at> <87wnqz43k0.fsf@dismail.de> <3192d62ef790c16fb2dfb894d9ccb160@dismail.de> <13bff20e418f1cec97cdda49ffed51544c5c9402.camel@student.tugraz.at> <87mtre5lzy.fsf@dismail.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 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: , Cc: 48974@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624615490; h=from:from:sender:sender: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=M2CeKDUNePxoFwUcd0WPo7bS7hlmp7S/gmfV/ZotY/w=; b=IunG/uDJD8a4OmJ1NHymzkhZLaAG3Ir6llnN/xeASWUTriiS6W2sxGcs06BP6eqd5AOgcm 4bqOKo5d86j8ypj+2THjwqwvgPJRh6mfhSF0zPVutK40GyRFu242SmD26HnTX08fIXUJZg ON1YuHDu447oZWivMB9xU8FD4DPqW67Iy3Ie614iMzKBqB495ykTOITfuux9A5NqsZ/r1P DQ5fD34L+RoYRbGFzr94d2Y47hIe2TVDOBeU7G02trOfg4pkYAWOSIzOlGLwRPN/WfAnPn yJphyNXEJvBuFVovqHUFys2TjV7fzQKYg204htC20uIoRolthXO5q9FagiWOtw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624615490; a=rsa-sha256; cv=none; b=Tc8J1zJwzIebK5GPB4ZowW11H1vokJuwCp3U74fmB8mdgOBZK5j2P8cOrQ7SM4QuHh22F5 5foRi3vhUIgN9gqf6GFtvCusV5I/yUSKBakDFmsqWXe3SjlAGf6PhIc4yPOnelBK1sQ4hl uQuQNvogbKuoTgp/amlfJm+r9htcdzJRIfLoufSw2bY5x4HRWfoSDM9Aul7DnIsfzbHdNQ n4Im5pSaKRl/fzMl7RExrS7j4XkMkCwt4ed0qBif7M9cvXkEgx/46qlrMD70jQdrn5uV9Y Cil265pHnorfBKNHosU9587mLOfVMtZgNBmC/bI1mZXACyTuWhWuTszNjv+8Vw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=PlV9YGDR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (policy=none); 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: -1.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=PlV9YGDR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (policy=none); 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: AE2642424F X-Spam-Score: -1.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: SKBPWhAuG3cl 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! > > I'm pretty sure that the actual bug also exists, just not sure > > whether > > that's on your config or on shepherd. Using TTY1 for graphical > > stuff > > is also somewhat rare in Guix land, I presume. (Or rather, I can't > > think of it as anything but a container for debug output spam :D) > > > > As for getting this to work only on TTY1, you do get the config > > object, > > so you can do stuff like > > (if (is-tty1? config) (inherit+autologin config) config) > > Note of course, that is-tty1? is not a procedure that's ready-made, > > but > > one that you'd need to build from primitives such as record > > accessors. > > > > 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 => > (mingetty-configuration > (inherit config) > ;; ERROR at the NEXT LINE > (auto-login-to-tty-3 config) > )))) > > (define (auto-login-to-tty-3 config) > (if (string=? "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… I'm not really sure what exactly, when it is in fact a record constructor. Try the following: #+BEGIN_SRC scheme (define (auto-login-to-tty tty user) ;; TODO: you might want to implement this as match-lambda instead (lambda (config) (if (string=? 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 => (auto-login- to-tty "3" "joshua")))) #+END_SRC > #+BEGIN_SRC scheme > (define (auto-login-to-tty-3 mingetty-service) > (if (string=? "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. > (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 – i.e. adhering to the expectations given by the already existing procedure (or macro). > #+END_SRC Regards, Leo