From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GO0iBe1gemL3bwEAbAwnHQ (envelope-from ) for ; Tue, 10 May 2022 14:56:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cC0IBe1gemL4wgAAauVa8A (envelope-from ) for ; Tue, 10 May 2022 14:56:13 +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 7E17C11688 for ; Tue, 10 May 2022 14:56:12 +0200 (CEST) Received: from localhost ([::1]:43942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1noPPP-00062e-Hu for larch@yhetil.org; Tue, 10 May 2022 08:56:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noEEQ-0000To-Es for help-guix@gnu.org; Mon, 09 May 2022 21:00:06 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:46854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1noEEO-0003vs-IN for help-guix@gnu.org; Mon, 09 May 2022 21:00:06 -0400 Received: by mail-pg1-x52b.google.com with SMTP id l11so7818465pgt.13 for ; Mon, 09 May 2022 18:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:message-id:in-reply-to:subject:mime-version :content-transfer-encoding; bh=cES7D2k51+yZeQjvfpply4SWTwSCUPqyX8HTcxiW+kY=; b=Gh46uej7C13bv7rV/bs8lIYX0vrW0ZOak7MePDYZkI4PwkYS+4wb4QnZmznojIUBPf gT5xKf/A/qapRYyK8kfWHrm29fI6CRHprFdxouVv+92ks+1s+G7gRAyPzCOQm/UJCum7 NnrgUzNCTetC9PMLtTjxAhAvTWrR/G9uk7lTxTcG539SU7eMRubzpJXX5ECl8j1Ve3Sl 9jsKk2SlsbdviU5qmQtYhzUGhGwFKt8L1E4cjxpHyBJP1xATsxJ775p4tth/3oYcW5Z4 tP851yKUj0UOZG2kqoCb57owE7ELeB55OhvMYCkZLP5eFjkrhtjU/tC3W8iN2H5eOT06 xIKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to:subject :mime-version:content-transfer-encoding; bh=cES7D2k51+yZeQjvfpply4SWTwSCUPqyX8HTcxiW+kY=; b=X5uYHdFO2aulabubTC9+Ngt8i3TGvJSE+q1zL0MvEzYnReeNa4vNu+Tqpz0qFhE9De faO61ilSh69polFvC1vM5YDMikbmSNdcC2qAwD8aCEzbz+CdUKd+XWvAMVEGWTaKvrPu BIlS8PHyH0zNH+ILd4bfN6iEMBarT0cv81qXOJh1ipLVqfb65vTSTZT6rAMZIlFhHgZ8 vw5g4mswtA0KxGaLGQutfduwpiAFBzBcbAFE9Ql6w/1yY1Zt6oOLqqLgMJJP33EH+x25 ysyRw0gROP5iQHB4wDY4vLFDTZd3BVj5gZY9usgzS6JhIveAne7gAVhLFnmSjsAgzRAs ptRg== X-Gm-Message-State: AOAM532DfI5b4Lg3ESalsQW+au/o9MkFJ74zAgo5sUswEXLFYazKd++z BAX8PRsWy3c4RJ5KtuX9XF4V+eRzKTI= X-Google-Smtp-Source: ABdhPJyWk/9UsfVJZGrF5jDPdDtRnUQd9f7wSFtpcZGJEUcN9FO4uFlD3LMB35H6e3QZXqT57p2WLw== X-Received: by 2002:a63:2a04:0:b0:3c4:a041:d71 with SMTP id q4-20020a632a04000000b003c4a0410d71mr14938341pgq.492.1652144402266; Mon, 09 May 2022 18:00:02 -0700 (PDT) Received: from [127.0.0.1] (24-113-171-200.wavecable.com. [24.113.171.200]) by smtp.gmail.com with ESMTPSA id i22-20020a63e916000000b003c14af50643sm9174053pgh.91.2022.05.09.18.00.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 May 2022 18:00:01 -0700 (PDT) Date: Tue, 10 May 2022 01:00:00 +0000 (UTC) From: Antlers To: cassio.ufg@gmail.com Cc: help-guix@gnu.org Message-ID: In-Reply-To: CAJTCCxOT2VG2B3M-sBAxtFXHkGd4f=3xakJBK7YXxnyJw4O5iA@mail.gmail.com Subject: Re: Packaging baby-steps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=autumnalantlers@gmail.com; helo=mail-pg1-x52b.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 10 May 2022 08:55:49 -0400 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: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652187372; 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: in-reply-to:in-reply-to:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cES7D2k51+yZeQjvfpply4SWTwSCUPqyX8HTcxiW+kY=; b=C2dBKk1xQL011D0AtIu+dXn1IJmywv/4eyeGAGiWVTWI1y84naQYxCQ2b32QSfxv2X4yOt YHfDJki19uvK/w7VO3NyLygIfFt8SAvJossFCvuVyN5y2wDcUvZ3R/6qQjHtar8zSu1NhL c7V7zg1NCRQFfEtykru9KNwaFDSdFbJIK2Pt0x6ADNGa85vGwXe5smFwccMAGgHUhAqwU6 RuWhFhzl543Z6TbYkIGak2ZcRtEWariqIFBLcGm+zVqz74vYpj3lXSnavktHHU7luxP46L u0ysy3pXWOsNv8ObeD/QPXcOUA7SHwzzWj7ge2jXwyMgVM6Gq/huRiG4Ut1PGQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652187372; a=rsa-sha256; cv=none; b=fdcUiyz5NXiiK53HHI2daOQRn2mGkkYgLY51whKJ6vKCo/Qx/f9joBm8LzADzKkkeeO9ES SQGE/iwF8v7gGiXAOlsRGm0hoV/09swt2f8QB4zZgsH3n4nnXW7Aia3aMXuI9YbNA21Y9D GQzq92QTD8zqOMwxj3mmuU6g/nKbZKT1MnpDUhG9G2hICFfd9Zt4fQojpVJejWl+IqiReo FweF4J/rq8946XpgxqFu5gJVLte6+LMFjrj3j96/ESjiSwqw9RheoA346N5EC9NBsEt1cM Pim4Qh7x8KV6hbZ6a8wxY/uTJDfXPAJsAcv0ydqw+Yy/7V3ODRTXCg01h6h2sw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Gh46uej7; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Spam-Score: -9.80 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Gh46uej7; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Queue-Id: 7E17C11688 X-Spam-Score: -9.80 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6XnI8i2hwOFs Hi! Sorry for the late bump, but if your still interested, I'd be glad answ= er some questions. Any neovim plugins are likely installed in nearly the same way, and we may = actually be able to extend `guix import` to create packages for arbitrary p= lugins within Guix itself (which likes to be the one and only package manag= er). This is how eg. emacs packages are handled, and packaging a couple of = individual plugins first will still help to make the process clear. =C2=A0=C2=A0 1. *Step one* seems to be just a simple file download to an ap= propriate =C2=A0=C2=A0 directory =E2=80=94 is that assessment correct? Yep, there are dedicated functions in the module (guix git-download) which = will make it a breeze to turn any given repo URL into what's known as an or= igin-- check out the great guix manual pages on package definitions and ori= gins! =C2=A0=C2=A0 2. If so, would it be hard to generalize this so that it can b= e =C2=A0=C2=A0 installed either system-wide or per-user? I guess there is a G= uix idiomatic =C2=A0=C2=A0 way to accomplish what the above git command is doing, right? Installation is a separate concern from downloading, which can kind of be s= een in how each produces a separate object in the store- one containing the= origin (repo), and one containing the "output" files. =C2=A0=C2=A0 3. *Step two*, I imagine, should be easy if there isn't alread= y a ` =C2=A0=C2=A0 *plugin.lua*` file, right? What if there is? It's important to separate the activation and configuration of a plugin fro= m it's installation. When init.vim calls "lua require(" plugin")", neovim l= ooks for a matching file called plugin.lua and loads it, so plugin.lua is a= ctually kinda just part of init.vim that's been modularized out and interpr= eted as lua-- note now that it contains configuration for packer, like what= plugins to install. We could still create this kind of activation / configuration code for the = user, but it would be more of a Guix home kinda thing, beyond the scope of = eg. a system-wide package. As a package manager, it's just Guix's job to get Packer into some sort of = search path, so that when the user runs "return require('packer').startup(w= hatever())", neovim knows where to find the file matching "require('packer'= )", probably "packer.lua" but possibly "packer.vim" (I haven't checked). =C2=A0=C2=A0 4. Is it acceptable if the installation process doesn't look i= nto the =C2=A0=C2=A0 plugins directory-tree to try and automatically create entries= for them in =C2=A0=C2=A0 `*plugin.lua*`? Once again a Guix home issue, but if we were to go there: When each plugin is packaged, it becomes an entry in the store, and when it= 's installed, it's made available in a search path, but still exists primar= ily in the store (/gnu/guix) or worst-case as a symlink in a directory like= plugins/. We could: a.) Create a symlink for each packaged-plugin matching the plugins name, li= ke plugins/packer.lua, pointing to the equivalent file in the store. b.) Create a single file called guix.lua which contains an entry for each p= ackage we wish to install, directly referencing it's oath in he store ("req= uire("/gnu/store/..."). This would be regenerated whenever you run "guix ho= me reconfigure", and achieved via service extensions, but is once again bey= ond the scope of baby steps. A user could import this file and have all the= ir plugins activated. This is complicated by the fact that the import statement isn't the one in = init.vim, but actually part of plugin.lua, and contains configuration in th= e "startup" field!, which we really want to keep seperate from activation i= f we can. I'm not sure if we can seperate these, because I'm not sure why t= hat configuration needs to be part of the "startup" function, so I'd defaul= t to just leaving it to the user to do. =C2=A0=C2=A0 5. Also, in *Step two*, the first line in `*plugin.lua*` is re= quired =C2=A0=C2=A0 only if a certain condition is met. Is it OK to leave it there= if the =C2=A0=C2=A0 condition is not met? Uh, tbh I'm not familiar with what optional plugins are in this context-- i= t's probably okay? I use neovim daily, but don't use any packages =C2=AF\_(= =E3=83=84)_/=C2=AF. I'd say it's a "try and find out, then try it without" = kinda deal, and leave it out if it causes any issues or isn't necessary. =C2=A0=C2=A0 6. The problems in *Step three* seem to be the same as in *Ste= p two*. =C2=A0=C2=A0 Except that maybe it could be assumed that, since `*neovim*` i= s a =C2=A0=C2=A0 dependency, the file `*init.vim*` would necessarily exist? Once again, installing a package is seperate from loading it; not every use= r will want to "require" every package that's installed system-wide, so bar= ring am adventure into Guix home, we can just assume that the user will tak= e responsibility for this step and just worry about where neovim looks for = plugins when a user does try to require something (Somewhere in /usr for sy= stem wide plugins?) =C2=A0=C2=A0 7. From what I could tell from `*packer.nvim*`'s repo, the onl= y =C2=A0=C2=A0 dependency is on neovim version 0.5 or later =E2=80=94 is ther= e anything else I =C2=A0=C2=A0 would need to work on or check out? Nah, if it really requires anything else it'll just not work when isolated = with something like "guix shell -C neovim neovim-packer -- neovim" (putting= aside plugins that packer download into your home directory, which would s= till be in the container), which can be sorted out later -- but it really s= houldn't require anything that neovim doesn't already require at runtime.