all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: rczb <rc-zb@outlook.com>
To: Simon Tournier <zimon.toutoune@gmail.com>
Cc: "help-guix@gnu.org" <help-guix@gnu.org>
Subject: Re: Is there any mechanism of Guix analog to, or trick in Guile to imitate Nix flakes?
Date: Tue, 11 Jun 2024 01:54:45 +0800	[thread overview]
Message-ID: <ME3P282MB3920CE3E632464C3AC0D1050F8C62@ME3P282MB3920.AUSP282.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <87a5k0y49u.fsf@gmail.com>

Hi,

I'm sorry that I missed the point that flakes are not so prevalent as it 
looks in some communities. 😔 To be brief, a /flake 
<https://nix.dev/manual/nix/2.22/command-ref/new-cli/nix3-flake>/ is a 
directory or a (sub-dir of some) git repository that contains a 
`flake.nix`, whose content is then an /attribute set/(similar to JSON 
/object/) consisting of

1. An `inputs` attribute that specifies whatever the evaluation of the 
flake might need, loosely or strictly, git repo or not, flake or not. 
And the most typical cases are like

```

|inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";|

|```
|

|where `nixpkgs-unstable` is the branch to use.|

|2. An `outputs` attribute that gives whatever the user might need from 
this flake. Typically some packages (/derivations/), but could also 
contain some shell or system environments.
|

|3. An optional `||nixConfig||` attribute that specifies some behaviors 
of Nix itself during the evaluation.|

|4. And an optional flake description.|

|During evaluation, Nix will generate a JSON file named `flake.lock`, 
which stores the exact revisions of the dependencies, just like the 
output of `guix describe -f channels`. The lock file is not mandatory. 
You can delete it whenever you want an update, and the next invoking of 
`nix build` or something on the flake directory will just generate a new 
one that conforms what's written in `inputs` while being as up-to-date 
as possible to the upstream. This mechanism allows imperative updating a 
program set while not breaking the "rough" specification of 
dependencies, and is especially useful in system management (for that 
/Nix channels <https://nix.dev/manual/nix/2.22/command-ref/nix-channel> 
/and /lookup paths 
<https://nix.dev/manual/nix/2.22/language/constructs/lookup-path> /are 
not needed anymore, and both the reproducibility and the flexibility get 
increased).|

|In comparison to this, Guix rely on `use-modules` of Guile, which 
specifies nothing but some symbols and searches the corresponding 
modules either directly from the environment or from the /time machine/, 
which refer to exact revisions of the channels. Another choice is the 
inferiors. Again, they refer directly to the revisions, not branches, 
let alone arbitrary source urls. Reproducible as they are, the UX is not 
so smooth and simple. So I wonder if there's some approaches that can 
deal with this.|

|rczb/
/|

on 2024/6/5 2:03, Simon Tournier wrote:
> Hi,
>
> On Tue, 28 May 2024 at 00:37, ‪肖 海帆‬<rc-zb@outlook.com>  wrote:
>
>>     So, is there any mechanism of Guix analog to, or trick in Guile to
>>     imitate the functionalities of flakes? Or is there a possibility for
>>     this?
> It’s hard to tell – at least from my understanding – because each time
> people ask for Flakes, they assume we know what it is or they explain
> using the vocabulary of Nix which, for what it is worth, I am not
> familiar.  That’s said, then…
>
> The best step is to describe – using Guix terminology – the Flake
> feature, IMHO. :-)
>
>
> Cheers,
> simon

  parent reply	other threads:[~2024-06-10 18:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 16:37 Is there any mechanism of Guix analog to, or trick in Guile to imitate Nix flakes? ‪肖 海帆‬
2024-06-04 18:03 ` Simon Tournier
2024-06-10  4:41   ` Abbé
2024-06-10 17:54   ` rczb [this message]
2024-06-16 15:00     ` Suhail Singh
  -- strict thread matches above, loose matches on Subject: below --
2024-05-27 16:34 ‪‪SailSXiao‬‬

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ME3P282MB3920CE3E632464C3AC0D1050F8C62@ME3P282MB3920.AUSP282.PROD.OUTLOOK.COM \
    --to=rc-zb@outlook.com \
    --cc=help-guix@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.