unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Git-style aliases in Guix?
@ 2017-02-25 20:58 Alex Griffin
  0 siblings, 0 replies; 10+ messages in thread
From: Alex Griffin @ 2017-02-25 20:58 UTC (permalink / raw)
  To: guix-devel

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

I think it would be cool and useful if Guix had some kind of config file
where users could define new commands or aliases, as in git. I'm sure
many people here already have their own helper code to work witk Guix,
whether that's in shell scripts, bashrc, guile, elisp, etc. And it would
make it easier to experiment with changing the command line syntax
without committing to any change too soon.

I've attached my own Guix wrapper function to show some use cases, like:

# New features
* automatically invoke `./pre-inst-env` when ~/.config/guix/latest
points to a git repo
* `guix make` builds Guix in your git checkout directory
* `guix clean` cleans out your Guix git checkout
* `guix visit <package>` opens a package's homepage in a browser
* `guix ls` lists the files in a Guix package (must be present or built
on your machine)

# Convenience Commands
* `guix search` wraps `guix package -s` with a recutils template
* `guix manifest` -> guix package --manifest=~/.config/guix/profile.scm
* `guix reconfigure` -> sudo guix system reconfigure
~/.config/guix/system.scm
* `guix repl` just invokes `./pre-inst-env guile`, but it should
probably also load some Guix modules.

# Simple Aliases
* `guix add` or `guix install` -> guix package --install
* `guix env` -> guix environment
* `guix try` -> guix environment --ad-hoc
* `guix profile` -> guix package
* `guix show` or `guix info` -> guix package --show=
* `guix remove` or `guix uninstall` -> guix package --remove

What does everyone think? If you like the idea, what would the
implementation/config file look like?
-- 
Alex Griffin

[-- Attachment #2: guix-wrapper.sh --]
[-- Type: application/x-shellscript, Size: 1677 bytes --]

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

* Git-style aliases in Guix?
@ 2017-02-25 20:59 Alex Griffin
  2017-02-26 21:15 ` Mekeor Melire
  0 siblings, 1 reply; 10+ messages in thread
From: Alex Griffin @ 2017-02-25 20:59 UTC (permalink / raw)
  To: guix-devel

I think it would be cool and useful if Guix had some kind of config file
where users could define new commands or aliases, as in git. I'm sure
many people here already have their own helper code to work witk Guix,
whether that's in shell scripts, bashrc, guile, elisp, etc. And it would
make it easier to experiment with changing the command line syntax
without committing to any change too soon.

I've attached my own Guix wrapper function to show some use cases, like:

# New features
* automatically invoke `./pre-inst-env` when ~/.config/guix/latest
points to a git repo
* `guix make` builds Guix in your git checkout directory
* `guix clean` cleans out your Guix git checkout
* `guix visit <package>` opens a package's homepage in a browser
* `guix ls` lists the files in a Guix package (must be present or built
on your machine)

# Convenience Commands
* `guix search` wraps `guix package -s` with a recutils template
* `guix manifest` -> guix package --manifest=~/.config/guix/profile.scm
* `guix reconfigure` -> sudo guix system reconfigure
~/.config/guix/system.scm
* `guix repl` just invokes `./pre-inst-env guile`, but it should
probably also load some Guix modules.

# Simple Aliases
* `guix add` or `guix install` -> guix package --install
* `guix env` -> guix environment
* `guix try` -> guix environment --ad-hoc
* `guix profile` -> guix package
* `guix show` or `guix info` -> guix package --show=
* `guix remove` or `guix uninstall` -> guix package --remove

What does everyone think? If you like the idea, what would the
implementation/config file look like?
-- 
Alex Griffin

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

* Re: Git-style aliases in Guix?
  2017-02-25 20:59 Git-style aliases in Guix? Alex Griffin
@ 2017-02-26 21:15 ` Mekeor Melire
  2017-02-27  5:54   ` John Darrington
  0 siblings, 1 reply; 10+ messages in thread
From: Mekeor Melire @ 2017-02-26 21:15 UTC (permalink / raw)
  To: Alex Griffin; +Cc: guix-devel


I'd also like to have some Guix aliases. In Git, you can define aliases
like so:

     # define new alias
     $ git config --global alias.i init
     # use new alias
     $ git i

Personally, I'd prefer to type `guix p -i` for `guix package -i`.
Anyway.


Concerning how to implement this alias feature within Guix, I'd first
like to pose a much broader question. So, on GuixSD you have a
configuration, written in Scheme, for your operating system. Couldn't we
make Guix have a scheme-configuration file for itself, as well?


Alex Griffin <a@ajgrf.com> writes:

> I think it would be cool and useful if Guix had some kind of config file
> where users could define new commands or aliases, as in git. I'm sure
> many people here already have their own helper code to work witk Guix,
> whether that's in shell scripts, bashrc, guile, elisp, etc. And it would
> make it easier to experiment with changing the command line syntax
> without committing to any change too soon.
>
> I've attached my own Guix wrapper function to show some use cases, like:
>
> # New features
> * automatically invoke `./pre-inst-env` when ~/.config/guix/latest
> points to a git repo
> * `guix make` builds Guix in your git checkout directory
> * `guix clean` cleans out your Guix git checkout
> * `guix visit <package>` opens a package's homepage in a browser
> * `guix ls` lists the files in a Guix package (must be present or built
> on your machine)
>
> # Convenience Commands
> * `guix search` wraps `guix package -s` with a recutils template
> * `guix manifest` -> guix package --manifest=~/.config/guix/profile.scm
> * `guix reconfigure` -> sudo guix system reconfigure
> ~/.config/guix/system.scm
> * `guix repl` just invokes `./pre-inst-env guile`, but it should
> probably also load some Guix modules.
>
> # Simple Aliases
> * `guix add` or `guix install` -> guix package --install
> * `guix env` -> guix environment
> * `guix try` -> guix environment --ad-hoc
> * `guix profile` -> guix package
> * `guix show` or `guix info` -> guix package --show=
> * `guix remove` or `guix uninstall` -> guix package --remove
>
> What does everyone think? If you like the idea, what would the
> implementation/config file look like?


--

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

* Re: Git-style aliases in Guix?
  2017-02-26 21:15 ` Mekeor Melire
@ 2017-02-27  5:54   ` John Darrington
  2017-02-27  8:30     ` Mekeor Melire
  0 siblings, 1 reply; 10+ messages in thread
From: John Darrington @ 2017-02-27  5:54 UTC (permalink / raw)
  To: Mekeor Melire; +Cc: guix-devel

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

On Sun, Feb 26, 2017 at 10:15:10PM +0100, Mekeor Melire wrote:

     Concerning how to implement this alias feature within Guix, I'd first
     like to pose a much broader question. So, on GuixSD you have a
     configuration, written in Scheme, for your operating system. Couldn't we
     make Guix have a scheme-configuration file for itself, as well?
     

We do.  guix/config.scm

-- 
Avoid eavesdropping.  Send strong encrypted email.
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: Git-style aliases in Guix?
  2017-02-27  5:54   ` John Darrington
@ 2017-02-27  8:30     ` Mekeor Melire
  2017-02-27 15:15       ` John Darrington
  0 siblings, 1 reply; 10+ messages in thread
From: Mekeor Melire @ 2017-02-27  8:30 UTC (permalink / raw)
  To: John Darrington; +Cc: guix-devel


John Darrington <john@darrington.wattle.id.au> writes:

> On Sun, Feb 26, 2017 at 10:15:10PM +0100, Mekeor Melire wrote:
>
>      Concerning how to implement this alias feature within Guix, I'd first
>      like to pose a much broader question. So, on GuixSD you have a
>      configuration, written in Scheme, for your operating system. Couldn't we
>      make Guix have a scheme-configuration file for itself, as well?
>      
> We do.  guix/config.scm

How can you configure Guix itself in your config.scm? I'm only aware of
the operating-system declaration which is used to configure the OS, not
Guix itself.

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

* Re: Git-style aliases in Guix?
  2017-02-27  8:30     ` Mekeor Melire
@ 2017-02-27 15:15       ` John Darrington
  2017-02-27 19:01         ` Mekeor Melire
  0 siblings, 1 reply; 10+ messages in thread
From: John Darrington @ 2017-02-27 15:15 UTC (permalink / raw)
  To: Mekeor Melire; +Cc: guix-devel

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

On Mon, Feb 27, 2017 at 09:30:07AM +0100, Mekeor Melire wrote:
     
     John Darrington <john@darrington.wattle.id.au> writes:
     
     > On Sun, Feb 26, 2017 at 10:15:10PM +0100, Mekeor Melire wrote:
     >
     >      Concerning how to implement this alias feature within Guix, I'd first
     >      like to pose a much broader question. So, on GuixSD you have a
     >      configuration, written in Scheme, for your operating system. Couldn't we
     >      make Guix have a scheme-configuration file for itself, as well?
     >      
     > We do.  guix/config.scm
     
     How can you configure Guix itself in your config.scm? I'm only aware of
     the operating-system declaration which is used to configure the OS, not
     Guix itself.

What kind of configuration had you in mind?

-- 
Avoid eavesdropping.  Send strong encrypted email.
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: Git-style aliases in Guix?
  2017-02-27 15:15       ` John Darrington
@ 2017-02-27 19:01         ` Mekeor Melire
  2017-03-08  8:53           ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Mekeor Melire @ 2017-02-27 19:01 UTC (permalink / raw)
  To: John Darrington; +Cc: guix-devel

John Darrington <john@darrington.wattle.id.au> writes:

> On Mon, Feb 27, 2017 at 09:30:07AM +0100, Mekeor Melire wrote:
>
>      John Darrington <john@darrington.wattle.id.au> writes:
>
>      > On Sun, Feb 26, 2017 at 10:15:10PM +0100, Mekeor Melire wrote:
>      >
>      >      Concerning how to implement this alias feature within Guix, I'd first
>      >      like to pose a much broader question. So, on GuixSD you have a
>      >      configuration, written in Scheme, for your operating system. Couldn't we
>      >      make Guix have a scheme-configuration file for itself, as well?
>      >
>      > We do.  guix/config.scm
>
>      How can you configure Guix itself in your config.scm? I'm only aware of
>      the operating-system declaration which is used to configure the OS, not
>      Guix itself.
>
> What kind of configuration had you in mind?

So, `operating-system` let's you declare an operating system. What if
there was a Scheme function called `guix` or so which allowed you to
configure Guix itself?

Then, defining Guix aliases could look as follows; maybe saved in a file
called guix.scm:

      (guix
        (aliases '(
          ("p" . "package")
          ("s" . "package -s")
          ("m" . "package -m"))))

And similar to `operating-system`, there would be many other
configuration fields...

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

* Re: Git-style aliases in Guix?
  2017-02-27 19:01         ` Mekeor Melire
@ 2017-03-08  8:53           ` Ludovic Courtès
  2017-03-09  3:27             ` Mekeor Melire
  0 siblings, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2017-03-08  8:53 UTC (permalink / raw)
  To: Mekeor Melire; +Cc: guix-devel

Mekeor Melire <mekeor.melire@gmail.com> skribis:

> So, `operating-system` let's you declare an operating system. What if
> there was a Scheme function called `guix` or so which allowed you to
> configure Guix itself?
>
> Then, defining Guix aliases could look as follows; maybe saved in a file
> called guix.scm:
>
>       (guix
>         (aliases '(
>           ("p" . "package")
>           ("s" . "package -s")
>           ("m" . "package -m"))))
>
> And similar to `operating-system`, there would be many other
> configuration fields...

I think that would be pretty cool.

There’ve been discussions in the past about adding aliases:

  https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00325.html

Ludo’.

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

* Re: Git-style aliases in Guix?
  2017-03-08  8:53           ` Ludovic Courtès
@ 2017-03-09  3:27             ` Mekeor Melire
  2017-03-09 10:53               ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Mekeor Melire @ 2017-03-09  3:27 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


What I really mean to say is, that it'd be a shame, if Guix had a
configuration file like Git which uses this syntax:

    [user]
            name = example
            email = example@example.example
    [alias]
            i = init
            z = stash
            s = status

I mean, all the files Guix reads are written in Scheme (config.scm,
manifest.scm, any package.scm). So, how could it work that Guix was
configured in Scheme?

Is there any way we could make config.scm include a similar data-type as
`operating-system`, maybe called `guix-configuration` or whatever, which
has a field called `aliases`?

I mean, implementing aliases isn't per-se difficult. But I'd love to
have a much broader approach to configure Guix (and Guix' CLI).


Ludovic Courtès <ludo@gnu.org> writes:

> Mekeor Melire <mekeor.melire@gmail.com> skribis:
>
>> So, `operating-system` let's you declare an operating system. What if
>> there was a Scheme function called `guix` or so which allowed you to
>> configure Guix itself?
>>
>> Then, defining Guix aliases could look as follows; maybe saved in a file
>> called guix.scm:
>>
>>       (guix
>>         (aliases '(
>>           ("p" . "package")
>>           ("s" . "package -s")
>>           ("m" . "package -m"))))
>>
>> And similar to `operating-system`, there would be many other
>> configuration fields...
>
> I think that would be pretty cool.
>
> There’ve been discussions in the past about adding aliases:
>
>   https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00325.html
>
> Ludo’.


--
mekeor ~ EDD3 DFFA 76F6 11C0 145F 9A99 AC85 BAD8 A2F8 C868

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

* Re: Git-style aliases in Guix?
  2017-03-09  3:27             ` Mekeor Melire
@ 2017-03-09 10:53               ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2017-03-09 10:53 UTC (permalink / raw)
  To: Mekeor Melire; +Cc: guix-devel

Mekeor Melire <mekeor.melire@gmail.com> skribis:

> What I really mean to say is, that it'd be a shame, if Guix had a
> configuration file like Git which uses this syntax:
>
>     [user]
>             name = example
>             email = example@example.example
>     [alias]
>             i = init
>             z = stash
>             s = status
>
> I mean, all the files Guix reads are written in Scheme (config.scm,
> manifest.scm, any package.scm). So, how could it work that Guix was
> configured in Scheme?
>
> Is there any way we could make config.scm include a similar data-type as
> `operating-system`, maybe called `guix-configuration` or whatever, which
> has a field called `aliases`?
>
> I mean, implementing aliases isn't per-se difficult. But I'd love to
> have a much broader approach to configure Guix (and Guix' CLI).

Sure, that’d be a Schemey config file and not a Git-style config file,
no argument here.  :-)

Ludo’.

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

end of thread, other threads:[~2017-03-09 10:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-25 20:59 Git-style aliases in Guix? Alex Griffin
2017-02-26 21:15 ` Mekeor Melire
2017-02-27  5:54   ` John Darrington
2017-02-27  8:30     ` Mekeor Melire
2017-02-27 15:15       ` John Darrington
2017-02-27 19:01         ` Mekeor Melire
2017-03-08  8:53           ` Ludovic Courtès
2017-03-09  3:27             ` Mekeor Melire
2017-03-09 10:53               ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2017-02-25 20:58 Alex Griffin

Code repositories for project(s) associated with this public inbox

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

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).