Re: Git-style aliases in Guix?
Mekeor Melire 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’.
Re: Git-style aliases in Guix?
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 writes: > Mekeor Melire 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
Re: Git-style aliases in Guix?
Mekeor Melire 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’.
Re: Git-style aliases in Guix?
John Darrington writes: > On Mon, Feb 27, 2017 at 09:30:07AM +0100, Mekeor Melire wrote: > > John Darrington 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...
Re: Git-style aliases in Guix?
On Mon, Feb 27, 2017 at 09:30:07AM +0100, Mekeor Melire wrote: John Darrington 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. signature.asc Description: Digital signature
Re: Git-style aliases in Guix?
John Darrington 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.
Re: Git-style aliases in Guix?
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. signature.asc Description: Digital signature
Re: Git-style aliases in Guix?
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 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 ` 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? --
Git-style aliases in Guix?
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 ` 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
Git-style aliases in Guix?
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 ` 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 guix-wrapper.sh Description: application/shellscript