From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mekeor Melire Subject: Re: Git-style aliases in Guix? Date: Sun, 26 Feb 2017 22:15:10 +0100 Message-ID: <877f4c1wo1.fsf@gmail.com> References: <1488056366.2392643.892804736.71478AA0@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ci6A9-0004A8-Lk for guix-devel@gnu.org; Sun, 26 Feb 2017 16:15:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ci6A8-0004cq-IN for guix-devel@gnu.org; Sun, 26 Feb 2017 16:15:25 -0500 Received: from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]:34963) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ci6A8-0004ZV-Bq for guix-devel@gnu.org; Sun, 26 Feb 2017 16:15:24 -0500 Received: by mail-wr0-x22f.google.com with SMTP id g10so40672868wrg.2 for ; Sun, 26 Feb 2017 13:15:22 -0800 (PST) In-reply-to: <1488056366.2392643.892804736.71478AA0@webmail.messagingengine.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Griffin Cc: guix-devel@gnu.org 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? --