unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* about basic operation of guix sd
@ 2020-04-07 15:16 Satoru KURASHIKI
  2020-04-07 16:27 ` Marius Bakke
  2020-04-07 16:30 ` Julien Lepiller
  0 siblings, 2 replies; 6+ messages in thread
From: Satoru KURASHIKI @ 2020-04-07 15:16 UTC (permalink / raw)
  To: help-guix

hi,

I happen to know Guix SD recently, and trying to tinkering it.

I've just managed to "guix init" on my new box, and have questions
about its operations.
# excuse: I looked over the guix manual, but may be overlooking clues...

Please tell me any of FAQ, Howto, list thread, blog, sample code, or
gist, which would answer:

- How to unify personal substitutes?
  - "guix publish" will serve the substitutes built on that host, and
I want to add substitutes
    of another host's
  - Is this work as expected? : rsync /gnu/store to repository host to
merge substitutes

- The right way of treating guix code (or guile code structure?)
  - I have to clone guix repo into my home directory?
    - Though "guix pull" should have source tree anywhere (in
/gnu/store?), so are there any interfaces
      to access them through guix-daemon?
  - I want to tweak existing code (package definition)
    - I should copy target file to somewhere working directory to edit
      or edit target file in the project tree?

- Emacs setup (to edit guix configuration)
  - I want something like:
    - i.e. M-x guix-describe-variables to view document of guix
keywords and jump to its definition
    - C-x C-e to evaluate variables (to confirm its values)
    - guix keyword completion
    - Some linter (flymake/flycheck thing)
  - emacs-guix seems to be "guix" command wrapper, so I guess
configuring geiser will make it?

regards,
-- 
KURASHIKI Satoru

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: about basic operation of guix sd
  2020-04-07 15:16 about basic operation of guix sd Satoru KURASHIKI
@ 2020-04-07 16:27 ` Marius Bakke
  2020-04-15 14:23   ` Satoru KURASHIKI
  2020-04-07 16:30 ` Julien Lepiller
  1 sibling, 1 reply; 6+ messages in thread
From: Marius Bakke @ 2020-04-07 16:27 UTC (permalink / raw)
  To: Satoru KURASHIKI, help-guix

[-- Attachment #1: Type: text/plain, Size: 2786 bytes --]

Hi Satoru, and welcome to Guix!  I hope you will enjoy your stay.  :-)

Satoru KURASHIKI <lurdan@gmail.com> writes:

> hi,
>
> I happen to know Guix SD recently, and trying to tinkering it.

FYI the 'SD' name has been deprecated in favor of 'Guix System'.

> I've just managed to "guix init" on my new box, and have questions
> about its operations.
> # excuse: I looked over the guix manual, but may be overlooking clues...
>
> Please tell me any of FAQ, Howto, list thread, blog, sample code, or
> gist, which would answer:
>
> - How to unify personal substitutes?
>   - "guix publish" will serve the substitutes built on that host, and
> I want to add substitutes
>     of another host's
>   - Is this work as expected? : rsync /gnu/store to repository host to
> merge substitutes

Syncing /gnu/store will not work without also syncing /var/guix/db.  I
think what you want to do is on host1 run 'guix publish' as you already
found, and on host2 you can then use 'guix install foo
--substitute-urls="https://host1 https://ci.guix.gnu.org"' to get
substitutes from both host1 and the Guix CI infrastructure.

See https://guix.gnu.org/manual/en/guix.html#Invoking-guix-publish for a
more complete explanation.

To do this through the configuration system, you need
'guix-publish-service-type' and adjusting the 'substitute-urls' field of
'guix-service-type'.

> - The right way of treating guix code (or guile code structure?)
>   - I have to clone guix repo into my home directory?
>     - Though "guix pull" should have source tree anywhere (in
> /gnu/store?), so are there any interfaces
>       to access them through guix-daemon?
>   - I want to tweak existing code (package definition)
>     - I should copy target file to somewhere working directory to edit
>       or edit target file in the project tree?

After cloning the Guix repository, you can run Guix directly from the
checkout using the "./pre-inst-env" script: see the Contributing
section of the manual for how to configure a development environment:

https://guix.gnu.org/manual/en/guix.html#Contributing 

Another alternative is to use 'guix pull --url=/your/cloned/repository'.

> - Emacs setup (to edit guix configuration)
>   - I want something like:
>     - i.e. M-x guix-describe-variables to view document of guix
> keywords and jump to its definition
>     - C-x C-e to evaluate variables (to confirm its values)
>     - guix keyword completion
>     - Some linter (flymake/flycheck thing)
>   - emacs-guix seems to be "guix" command wrapper, so I guess
> configuring geiser will make it?

You can get completion and jumping through Geiser, but I don't have
instructions at hand.  Hopefully some of the Emacs gurus can chime in
here.  :-)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: about basic operation of guix sd
  2020-04-07 15:16 about basic operation of guix sd Satoru KURASHIKI
  2020-04-07 16:27 ` Marius Bakke
@ 2020-04-07 16:30 ` Julien Lepiller
  2020-04-15 14:23   ` Satoru KURASHIKI
  1 sibling, 1 reply; 6+ messages in thread
From: Julien Lepiller @ 2020-04-07 16:30 UTC (permalink / raw)
  To: help-guix, Satoru KURASHIKI

Le 7 avril 2020 11:16:12 GMT-04:00, Satoru KURASHIKI <lurdan@gmail.com> a écrit :
>hi,
>
>I happen to know Guix SD recently, and trying to tinkering it.

Hi, welcome to the guix project :) btw, we call it the Guix System now, not SD anymore ;)

>I've just managed to "guix init" on my new box, and have questions
>about its operations.
># excuse: I looked over the guix manual, but may be overlooking
>clues...

Nice, well done :)

>Please tell me any of FAQ, Howto, list thread, blog, sample code, or
>gist, which would answer:
>
>- How to unify personal substitutes?
>  - "guix publish" will serve the substitutes built on that host, and
>I want to add substitutes
>    of another host's
>  - Is this work as expected? : rsync /gnu/store to repository host to
>merge substitutes

I think this is a bad idea, because it might break assumptions of the mathematical model guix relies on. Not sure how to sync two stores automatically. The "guix copy" command can be used to do that manually. Note that guix publish will publish your whole /gnu/store, independently of how items were obtained.

If you use guix publish for things that were not built on the official build farm, you need to have a look at guix --archive to generate key pairs and authorize your personal substitute server. For items that were built on the official build farm, it is enough to authorize the build farm, because these items will be detected as identical, even if they come from a different source.

>- The right way of treating guix code (or guile code structure?)
>  - I have to clone guix repo into my home directory?
>    - Though "guix pull" should have source tree anywhere (in
>/gnu/store?), so are there any interfaces
>      to access them through guix-daemon?
>  - I want to tweak existing code (package definition)
>    - I should copy target file to somewhere working directory to edit
>      or edit target file in the project tree?

The manual has a section "the perfect setup" that should explain everything if you want to contribute.

Guix pull is indeed more or less a wrapper around git pull. The repository is available in the store, but because of the mathematical model, it is read-only and must not be modified. You can still use "guix edit foo" to open the package definition of foo in your favorite editor.

If this is not for a contribution, the next best thing you can do is create a channel that allows you to share your modifications (or you can keep them private, but share them between your computers). 

Note that the guix-daemon is only there to build and download packages, it doesn't know anything about available packages, etc. Your guix command does. That allows each user on your system to customize the set of available packages.

As a vim user, I will leave the following question unanswered :). I hope I could help a little.

>- Emacs setup (to edit guix configuration)
>  - I want something like:
>    - i.e. M-x guix-describe-variables to view document of guix
>keywords and jump to its definition
>    - C-x C-e to evaluate variables (to confirm its values)
>    - guix keyword completion
>    - Some linter (flymake/flycheck thing)
>  - emacs-guix seems to be "guix" command wrapper, so I guess
>configuring geiser will make it?
>
>regards,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: about basic operation of guix sd
  2020-04-07 16:27 ` Marius Bakke
@ 2020-04-15 14:23   ` Satoru KURASHIKI
  0 siblings, 0 replies; 6+ messages in thread
From: Satoru KURASHIKI @ 2020-04-15 14:23 UTC (permalink / raw)
  To: help-guix

hi, thank you for your reply.

On Wed, Apr 8, 2020 at 1:27 AM Marius Bakke <mbakke@fastmail.com> wrote:
>
> Hi Satoru, and welcome to Guix!  I hope you will enjoy your stay.  :-)
>
> Satoru KURASHIKI <lurdan@gmail.com> writes:
>
> > hi,
> >
> > I happen to know Guix SD recently, and trying to tinkering it.
>
> FYI the 'SD' name has been deprecated in favor of 'Guix System'.

Ah, I see, so there are several bindings...:)

> Syncing /gnu/store will not work without also syncing /var/guix/db.  I
> think what you want to do is on host1 run 'guix publish' as you already
> found, and on host2 you can then use 'guix install foo
> --substitute-urls="https://host1 https://ci.guix.gnu.org"' to get
> substitutes from both host1 and the Guix CI infrastructure.
>
> See https://guix.gnu.org/manual/en/guix.html#Invoking-guix-publish for a
> more complete explanation.
>

hmm...OK, so it's dificult to have a partial mirror on my tiny VPS.
# I thought of pushing to VPS from my desktop, and fetch them from
# old laptop when I'm away from home. (to demonstrate guix to friends)
## mainly for iwlwifi things and so on. kernel demands me one night.

> To do this through the configuration system, you need
> 'guix-publish-service-type' and adjusting the 'substitute-urls' field of
> 'guix-service-type'.
>
> > - The right way of treating guix code (or guile code structure?)
> >   - I have to clone guix repo into my home directory?
> >     - Though "guix pull" should have source tree anywhere (in
> > /gnu/store?), so are there any interfaces
> >       to access them through guix-daemon?
> >   - I want to tweak existing code (package definition)
> >     - I should copy target file to somewhere working directory to edit
> >       or edit target file in the project tree?
>
> After cloning the Guix repository, you can run Guix directly from the
> checkout using the "./pre-inst-env" script: see the Contributing
> section of the manual for how to configure a development environment:
>
> https://guix.gnu.org/manual/en/guix.html#Contributing
>
> Another alternative is to use 'guix pull --url=/your/cloned/repository'.

Hacking guix itself is... difficult for me, so I expect guix command to work
out of the box:
- invoke "current" guix
- it refers current store (readonly), cloned checkout of guix tree (overriding
  current one), and my local package module
would be desirable.

> You can get completion and jumping through Geiser, but I don't have
> instructions at hand.  Hopefully some of the Emacs gurus can chime in
> here.  :-)

I've found setting "geiser-guile-load-path" and Autodoc seems to work.
I will try to build environment on this.

regards,

--
KURASHIKI Satoru

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: about basic operation of guix sd
  2020-04-07 16:30 ` Julien Lepiller
@ 2020-04-15 14:23   ` Satoru KURASHIKI
  2020-04-15 17:06     ` Julien Lepiller
  0 siblings, 1 reply; 6+ messages in thread
From: Satoru KURASHIKI @ 2020-04-15 14:23 UTC (permalink / raw)
  To: help-guix

hi, thank you for your reply.

On Wed, Apr 8, 2020 at 1:30 AM Julien Lepiller <julien@lepiller.eu> wrote:
> I think this is a bad idea, because it might break assumptions of the mathematical model guix relies on. Not sure how to sync two stores automatically. The "guix copy" command can be used to do that manually. Note that guix publish will publish your whole /gnu/store, independently of how items were obtained.
>
> If you use guix publish for things that were not built on the official build farm, you need to have a look at guix --archive to generate key pairs and authorize your personal substitute server. For items that were built on the official build farm, it is enough to authorize the build farm, because these items will be detected as identical, even if they come from a different source.

Thanks, lazy evaluating "Invoking guix copy", it seems to be handy for
each target package!

> The manual has a section "the perfect setup" that should explain everything if you want to contribute.
>
> Guix pull is indeed more or less a wrapper around git pull. The repository is available in the store, but because of the mathematical model, it is read-only and must not be modified. You can still use "guix edit foo" to open the package definition of foo in your favorite editor.

OK, I wil read that section throughly when time come.
For now I have to used to its daily administration...

>> If this is not for a contribution, the next best thing you can do is create a channel that allows you to share your modifications (or you can keep them private, but share them between your computers).
>
> Note that the guix-daemon is only there to build and download packages, it doesn't know anything about available packages, etc. Your guix command does. That allows each user on your system to customize the set of available packages.

Anyway, I use GUIX_PACKAGE_PATH and have managed to build small font
package recipe.
With some more, I will try it migrating to channel.

regards,
--
KURASHIKI Satoru

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: about basic operation of guix sd
  2020-04-15 14:23   ` Satoru KURASHIKI
@ 2020-04-15 17:06     ` Julien Lepiller
  0 siblings, 0 replies; 6+ messages in thread
From: Julien Lepiller @ 2020-04-15 17:06 UTC (permalink / raw)
  To: help-guix, Satoru KURASHIKI

Le 15 avril 2020 10:23:40 GMT-04:00, Satoru KURASHIKI <lurdan@gmail.com> a écrit :
>hi, thank you for your reply.
>
>On Wed, Apr 8, 2020 at 1:30 AM Julien Lepiller <julien@lepiller.eu>
>wrote:
>> I think this is a bad idea, because it might break assumptions of the
>mathematical model guix relies on. Not sure how to sync two stores
>automatically. The "guix copy" command can be used to do that manually.
>Note that guix publish will publish your whole /gnu/store,
>independently of how items were obtained.
>>
>> If you use guix publish for things that were not built on the
>official build farm, you need to have a look at guix --archive to
>generate key pairs and authorize your personal substitute server. For
>items that were built on the official build farm, it is enough to
>authorize the build farm, because these items will be detected as
>identical, even if they come from a different source.
>
>Thanks, lazy evaluating "Invoking guix copy", it seems to be handy for
>each target package!
>
>> The manual has a section "the perfect setup" that should explain
>everything if you want to contribute.
>>
>> Guix pull is indeed more or less a wrapper around git pull. The
>repository is available in the store, but because of the mathematical
>model, it is read-only and must not be modified. You can still use
>"guix edit foo" to open the package definition of foo in your favorite
>editor.
>
>OK, I wil read that section throughly when time come.
>For now I have to used to its daily administration...
>
>>> If this is not for a contribution, the next best thing you can do is
>create a channel that allows you to share your modifications (or you
>can keep them private, but share them between your computers).
>>
>> Note that the guix-daemon is only there to build and download
>packages, it doesn't know anything about available packages, etc. Your
>guix command does. That allows each user on your system to customize
>the set of available packages.
>
>Anyway, I use GUIX_PACKAGE_PATH and have managed to build small font
>package recipe.
>With some more, I will try it migrating to channel.

GUIX_PACKAGE_PATH is the deprecated way to use a channel (introduced before tge notion of channels). If you have a working dehinition with it, you can simply do "git init" and push it as a new repo somewhere. Then, set up your ~/.config/guix/channels.scm to use it.

To test changes in your channel you can use "-L path/to/channel/root" (same as what you pass to GUIX_PACKAGE_PATH) with any guix command.

>
>regards,
>--
>KURASHIKI Satoru

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-15 17:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 15:16 about basic operation of guix sd Satoru KURASHIKI
2020-04-07 16:27 ` Marius Bakke
2020-04-15 14:23   ` Satoru KURASHIKI
2020-04-07 16:30 ` Julien Lepiller
2020-04-15 14:23   ` Satoru KURASHIKI
2020-04-15 17:06     ` Julien Lepiller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).