From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mLKjIKs/UGNPWQEAbAwnHQ (envelope-from ) for ; Wed, 19 Oct 2022 20:19:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id EMixIKs/UGMseQAAauVa8A (envelope-from ) for ; Wed, 19 Oct 2022 20:19:23 +0200 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 441A329573 for ; Wed, 19 Oct 2022 20:19:23 +0200 (CEST) Received: from localhost ([::1]:60188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olDf0-0008ME-GG for larch@yhetil.org; Wed, 19 Oct 2022 14:19:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olDem-0008Lx-Qu for guix-devel@gnu.org; Wed, 19 Oct 2022 14:19:09 -0400 Received: from mx1.dismail.de ([78.46.223.134]:48078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olDeh-0006Pa-J1 for guix-devel@gnu.org; Wed, 19 Oct 2022 14:19:07 -0400 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id c5fbdd99; Wed, 19 Oct 2022 20:18:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h= mime-version:date:content-type:content-transfer-encoding:from :message-id:subject:to:in-reply-to:references; s=20190914; bh=9q aPDij9tzAHbt+wIWdWerSNdSI7r3IP2fseHWZ9tHU=; b=NsXhvSmcEhuTOVT2/3 N3Tf0xxAV1tsYAPN6GWeV9mQvI+k+GVn5ExbRRCjqbCCZOT92O0s+dk1itABV3yD YddcfREpcZj1J/8UiO0jQZW2k0DD/u8MCZDzRw+GhsFjeFdIWc+TbaTYrX039z9u jDGUTIAH6cq7QtO44riUT9rM+hyB7PjsUamCzwHC4E5df4U79Wc8+uwtPts1jquM wZEr9xAcVVpHSyZ2LNLIHdRJ3Y0+xMsmVJ7tDiwT2XPbkpkqBobrMmD/Xviyk3Cj AfYGa7MO4jiHY08knDVEgxBDwyd+krQMGqXPvWe41pL73B5aM/DCT98N3CrCOEzi sY1A== Received: from smtp1.dismail.de ( [10.240.26.11]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 4be57aa9; Wed, 19 Oct 2022 20:18:57 +0200 (CEST) Received: from smtp1.dismail.de (localhost [127.0.0.1]) by smtp1.dismail.de (OpenSMTPD) with ESMTP id 420caf30; Wed, 19 Oct 2022 20:18:57 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id d849f191 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 19 Oct 2022 20:18:56 +0200 (CEST) MIME-Version: 1.0 Date: Wed, 19 Oct 2022 18:18:55 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: RainLoop/1.16.0a From: jbranso@dismail.de Message-ID: <3cf810d64c1ca5697bee6eaf39d8dd7b@dismail.de> Subject: Re: Creating an Emacs Home Configuration Service To: "Zain Jabbar" , guix-devel@gnu.org In-Reply-To: References: <331c0017d7a4842fd2919b330a3d3894@dismail.de> <8b00165ff49030fdd11708cb1fd4a5b9@dismail.de> Received-SPF: pass client-ip=78.46.223.134; envelope-from=jbranso@dismail.de; helo=mx1.dismail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666203563; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=SFj0ozK++JViutcdCDN0tBUjBeZmI9l0g72Yyh7JD0c=; b=V1geoa6nvIyDtubdrQC7utqzUGiOiBsy+HH97ZK/rOrlHfris3HQzWmSvU4qf4lPOuoCsG a5c/BTU6vO556A1Zg5FFI0yv/JAXIO3CE0dWLWwqZfH5cTwbmphaBXicCfrosu1PxuJMsg 9EjZW5xiPLCBKHeOLFo6Hqny1VyTZXhyrNOTmiVdu4QncwZwsbjkmrtwQHZP5hMtGyZAts CckxHiQNN7momr8wWwV4z7kOtRjWe+lkCV6rkM9QJxEH0UAvrrmrNIWfCjX1f1fbZC5Kb0 5lqFxnY+cD38YwZUDzMECNAacWa1vcpCuewPt+4BI5Y/6dhOm+7eunXAi90ZUQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666203563; a=rsa-sha256; cv=none; b=tHYihxnWa0zFQ+kwh9aTA0OKYuG1av+r8qsopdRw9I9edz2Kcu8mhkCSe+TcRTHT9pee1B +m8IrRajqITJpCfTOtmkdZCr1x/WN7D8DuIk8gY/NDlAvsoyieAfi4ptvMZzKiPWpaPOmt 8+gcxfdO5Njq2q50zRbmlJZ1ixzIpO1qDCOHlaTBd7CBX/CAh3ldcQkIjEnkB78hfTprSf su/Jtu+FomvDbvyEslQ6D6M8FOqTJw+/WcyYMOxhvbkZ9HCd+bV/2rPT1s+8DJOvOWxv7Y pE1H7gLZBaOTAY+NpQmBdxA48h+d8D0sNk+XQwuOHuHFsEpIbilyqpHk48hiaw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b=NsXhvSmc; dmarc=pass (policy=reject) header.from=dismail.de; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.83 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b=NsXhvSmc; dmarc=pass (policy=reject) header.from=dismail.de; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 441A329573 X-Spam-Score: -4.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: nFi8nKldAZzF October 18, 2022 3:42 PM, "Zain Jabbar" wrote: > Here is a minimal reproducible(-ish needs change in module name) > example configuration which installs =3Demacs-debbugs=3D (and not much > else). Cool I am CC-ing guix devel. > #+BEGIN_SRC scheme > (define-module (zaijab minimal-working-example) > #:use-module (srfi srfi-1) > #:use-module (ice-9 pretty-print) > #:use-module (gnu home) > #:use-module (gnu packages) > #:use-module (gnu services) > #:use-module (gnu home services) > #:use-module (gnu services) > #:use-module (gnu services configuration) > #:use-module (guix gexp) > #:use-module (guix transformations)) >=20 >=20(define file-likes? (list-of file-like?)) >=20 >=20(define-configuration/no-serialization emacs-configuration > (emacs-packages > (file-likes (list (specification->package "emacs-next"))) "Files") > (early-init > (list '()) "Early-Init") > (init > (list '()) "Init")) >=20 >=20(define debuggs-configuration > (emacs-configuration > (emacs-packages (list (specification->package "emacs-debbugs"))))) >=20 >=20(define-public total-emacs-configuration > (fold (lambda (config-1 config-2) (emacs-configuration > (init (append (emacs-configuration-init config-1) > (emacs-configuration-init config-2))) > (early-init (append (emacs-configuration-early-init config-1) > (emacs-configuration-early-init config-2))) > (emacs-packages (append (emacs-configuration-emacs-packages config-1) > (emacs-configuration-emacs-packages config-2))))) > (emacs-configuration) >=20 >=20(filter emacs-configuration? > (map variable-ref > (filter variable-bound? > (hash-map->list (lambda (x y) y) (struct-ref (current-module) 0))))))) >=20 >=20(define-public emacs-configuration-service > (service-type (name (symbol-append 'emacs-configuration)) > (extensions > (list (service-extension > home-profile-service-type > (lambda (config) (emacs-configuration-emacs-packages config))) > (service-extension > home-xdg-configuration-files-service-type > (lambda (config) > (list > `("emacs/init.el" ,(scheme-file "init.el" > (emacs-configuration-init config) > #:splice? #:t)) > `("emacs/early-init.el" ,(scheme-file "early-init.el" > (emacs-configuration-early-init config) > #:splice? #:t))))))) > (default-value (emacs-configuration)) > (description "Configures Emacs init.el"))) >=20 >=20(define-public minimal-home-environment > (home-environment > (services (list (service emacs-configuration-service > total-emacs-configuration))))) >=20 >=20minimal-home-environment > #+END_SRC I wonder why you do the define total-emacs-configuration...is it possible to define an emacs-configuration something like this? Forgive the possibly wrong syntax, I don't use guix home (services (service emacs-configuration-service (emacs-configuration (packages (list emacs-debbugs emacs-evil emacs-paredit emacs-anzu)) (init (text-file "init-file.el" "(evil-mode 1)\n ;; other configuration stuff"))))) > I tested this using =3Dguix home container -N > minimal-working-example.scm=3D. Typing =3DM-x debbugs-gnu=3D gives a me= nu of > bugs. I made sure the debbugs configuration is necessary by commenting > it out, re-running =3Dguix home container=3D and seeing that =3DM-x deb= b > [TAB]=3D pulls up nothing. I think it works. Woo-hoo! When I tested the home container via terminal foot I get a weird error: warning: XDG_RUNTIME_DIR doesn't exists, on-first-login script won't execute anything. You can check if xdg runtime directory exists, XDG_RUNTIME_DIR variable is set to appropriate value and manually execute= the script by running '$HOME/.guix-home/on-first-login'-bash-5.1$ emacs emacs: Terminal type foot is not defined. If that is not the actual type of terminal you have, use the Bourne shell command 'TERM=3D...; export TERM' (C-shell: 'setenv TERM ...') to specify the correct type. It may be necessary to do 'unset TERMINFO' (C-shell: 'unsetenv TERMINFO') as well. That's probably just foot being weird. In lxterminal, emacs started fine. However, doing a M-x info RET m Debbugs RET I get this error in emacs: "Creating file with prefx: No such file or directory /tmp/jka-com" Anyway, definitely go ahead and send it to guix-patches! > Thank you for telling me about the =3D,build=3D meta command. It looks > very useful! I will need to figure out how to use it from =3DM-x > geiser-guile=3D. I have built this code by doing the following: > - open VTerm > - guix repl > - ,use (guix) > - ,use (MODULE-NAME) ;; in my case this was (zaijab minimal-working-exa= mple) > - ,build minimal-home-environment Once you get geiser set up and clone the git repo, and compile everything= ... inside the guix-src code...whatever file you are currently working on C-c C-a opens up that file in the repl. It's super awesome to be able to= =20 throw=20in some code evaluate it on the fly. https://video.hardlimit.com/c/the_gnu_guy/videos > I will be learning how to use the Git patching system soon. I will add > more documentation when I submit the patch. I'll be sure to CC you as > well. Thank you for your assistance. >=20 >=20On Tue, Oct 18, 2022 at 8:42 AM wrote: >=20 >>=20October 18, 2022 1:55 PM, "Zain Jabbar" wrote= : >>=20 >>=20Aloha Guix Development Team, >>=20 >>=20Thank you for your email. I attribute my successes to the fantastic >> documentation and my failures (as you will see in this email) to my >> own inability to read the documentation. >>=20 >>=20I meant to mention, have you tried using ",build" in a geiser repl? >> It lets you build derivations/gexps and shows you the output in >> the store. I have found that super helpful when building my only >> guix service (not merged yet). >>=20 >>=20From what I can tell, yes. Emacs does find the packages you install >> using this mechanism and loading them behaves as though you installed >> from a manifest. Let me know if you have a package you wish to test. I >> can email the results. >>=20 >>=20emacs-debbugs. If it works, then that is awesome! Well done! >>=20 >>=20But I would need more guidance to answer this question fully. There >> are some points of confusion I have relating to profiles and package >> availability. I will try to give my best answer using the >> documentation, source code, then a demo. >>=20 >>=20One thing I can say for sure is that the packages are installed usin= g >> the =3Dhome-profile-service-type=3D. According to the documentation at >> 13.3.1 Essential Home Services the =3Dhome-profile-service-type=3D can= be >> "extended with a list of packages if you want to install additional >> packages into your profile". >>=20 >>=20According to the source code in guix/gnu/home/services.scm >> #+BEGIN_SRC scheme >> ;; [In the big comment block line 76] >> ;;; home-profile-service-type is almost the same as >> profile-service-type, at least >> ;;; for now. >> .... ;; [Within the definition for home-profile-service-type (line 161= )] >> (description >> "This is the @dfn{home profile} and can be found in >> @file{~/.guix-home/profile}. It contains packages and >> configuration files that the user has declared in their >> @code{home-environment} record.")) >> #+END_SRC >>=20 >>=20It appears that using this configuration it installs it into the >> =3D~/.guix-home/profile=3D. Here is where I get a bit confused, when >> running =3Dguix package --list-profiles=3D I get >> =3D/home/zjabbar/.config/guix/current=3D and >> =3D/home/zjabbar/.guix-profile=3D, neither of which are my home profil= e. >>=20 >>=20Here is a demo. >>=20 >>=20I do not have the =3Demacs-suneater-theme=3D package installed using= my manifest. >>=20 >>=20=3Dguix package -I suneater=3D returns nothing when run in the termi= nal. >>=20 >>=20After saving this configuration in the module: >> #+BEGIN_SRC scheme >> (define theme-configuration >> (emacs-configuration >> (emacs-packages (list (specification->package "emacs-suneater-theme"))= ) >> (init '((load-theme 'suneater t))))) >> #+END_SRC >>=20 >>=20I find that Guix downloads and builds the package. After restarting >> Emacs, it comes up with the new theme and =3DM-x describe-theme=3D fin= ds >> it and everything. That being said, =3Dguix package=20-I suneater=3D *= still* >> returns nothing when run in the terminal. I suppose it's because the >> theme was installed without using the =3Dguix install=3D command >> specifically. >>=20 >>=20=3Dguix package -A suneater=3D does show me that suneater is availab= le. >> However after deleting or commenting out the configuration in that >> source block, Emacs does not load the theme and Emacs cannot find the >> theme using =3DM-x describe-theme=3D. But =3Dguix package -A suneater= =3D still >> shows me that suneater is available. So it was removed according to >> Emacs but not to guix. I am likely not looking at the right =3Dguix >> package=3D options. >>=20 >>=20It sounds like you have created the home-emacs service is a way that= works. >> I think your next move would be submit it guix-patches@gnu.org. >> Feel free to CC me in the email. >>=20 >>=20https://git-send-email.io >>=20 >>=20Thanks, >>=20 >>=20Joshua >=20 >=20-- > Thank you, > Zain Jabbar >=20 >=20On Tue, Oct 18, 2022 at 8:42 AM wrote: >=20 >>=20October 18, 2022 1:55 PM, "Zain Jabbar" wrote= : >>=20 >>=20Aloha Guix Development Team, >>=20 >>=20Thank you for your email. I attribute my successes to the fantastic >> documentation and my failures (as you will see in this email) to my >> own inability to read the documentation. >>=20 >>=20I meant to mention, have you tried using ",build" in a geiser repl? >> It lets you build derivations/gexps and shows you the output in >> the store. I have found that super helpful when building my only >> guix service (not merged yet). >>=20 >>=20From what I can tell, yes. Emacs does find the packages you install >> using this mechanism and loading them behaves as though you installed >> from a manifest. Let me know if you have a package you wish to test. I >> can email the results. >>=20 >>=20emacs-debbugs. If it works, then that is awesome! Well done! >>=20 >>=20But I would need more guidance to answer this question fully. There >> are some points of confusion I have relating to profiles and package >> availability. I will try to give my best answer using the >> documentation, source code, then a demo. >>=20 >>=20One thing I can say for sure is that the packages are installed usin= g >> the =3Dhome-profile-service-type=3D. According to the documentation at >> 13.3.1 Essential Home Services the =3Dhome-profile-service-type=3D can= be >> "extended with a list of packages if you want to install additional >> packages into your profile". >>=20 >>=20According to the source code in guix/gnu/home/services.scm >> #+BEGIN_SRC scheme >> ;; [In the big comment block line 76] >> ;;; home-profile-service-type is almost the same as >> profile-service-type, at least >> ;;; for now. >> .... ;; [Within the definition for home-profile-service-type (line 161= )] >> (description >> "This is the @dfn{home profile} and can be found in >> @file{~/.guix-home/profile}. It contains packages and >> configuration files that the user has declared in their >> @code{home-environment} record.")) >> #+END_SRC >>=20 >>=20It appears that using this configuration it installs it into the >> =3D~/.guix-home/profile=3D. Here is where I get a bit confused, when >> running =3Dguix package --list-profiles=3D I get >> =3D/home/zjabbar/.config/guix/current=3D and >> =3D/home/zjabbar/.guix-profile=3D, neither of which are my home profil= e. >>=20 >>=20Here is a demo. >>=20 >>=20I do not have the =3Demacs-suneater-theme=3D package installed using= my manifest. >>=20 >>=20=3Dguix package -I suneater=3D returns nothing when run in the termi= nal. >>=20 >>=20After saving this configuration in the module: >> #+BEGIN_SRC scheme >> (define theme-configuration >> (emacs-configuration >> (emacs-packages (list (specification->package "emacs-suneater-theme"))= ) >> (init '((load-theme 'suneater t))))) >> #+END_SRC >>=20 >>=20I find that Guix downloads and builds the package. After restarting >> Emacs, it comes up with the new theme and =3DM-x describe-theme=3D fin= ds >> it and everything. That being said, =3Dguix package -I suneater=3D *st= ill* >> returns nothing when run in the terminal. I suppose it's because the >> theme was installed without using the =3Dguix install=3D command >> specifically. >>=20 >>=20=3Dguix package -A suneater=3D does show me that suneater is availab= le. >> However after deleting or commenting out the configuration in that >> source block, Emacs does not load the theme and Emacs cannot find the >> theme using =3DM-x describe-theme=3D. But =3Dguix package -A suneater= =3D still >> shows me that suneater is available. So it was removed according to >> Emacs but not to guix. I am likely not looking at the right =3Dguix >> package=3D options. >>=20 >>=20It sounds like you have created the home-emacs service is a way that= works. >> I think your next move would be submit it guix-patches@gnu.org. >> Feel free to CC me in the email. >>=20 >>=20https://git-send-email.io >>=20 >>=20Thanks, >>=20 >>=20Joshua >=20 >=20-- > Thank you, > Zain Jabbar