travisbhartwell / nix-emacs

A set of useful Emacs modes and functions for users of Nix and Nix OS.
225 stars 32 forks source link

Generate sandbox environment script using declare shell command #35

Closed twhitehead closed 8 years ago

twhitehead commented 8 years ago

This closes #34 as it properly handles exported shell functions.

Note that I don't have any emacs package experience (how to build them) so I haven't confirmed that this work beyond manually running the adjusted function in an emacs buffer to see the shell script it generates.

svenkeidel commented 8 years ago

@twhitehead, thank you very much for the contribution. I will test and merge the code, when it works. 👍

twhitehead commented 8 years ago

Thanks. :smile:

FWIW, I created a new emacsPackagesNg in my setup that pulls this new version instead

{
  myEmacs =
    let
      myEmacsPackagesNg = emacsPackagesNg.override (super: self: {
          nix-sandbox = self.melpaBuild {
            pname = "nix-sandbox";
            version = "20160214.418";
            src = fetchFromGitHub {
              owner = "twhitehead";
              repo = "nix-emacs";
              rev = "5f95fb5b8d8dbe04eb5a773a0cde54456d448c97";
              sha256 = "11pcp09z0vy6k81wghqq4rxlkfsc5bpgyacpl7bmxanj3qaa7ga5";
            };
            files = [ "nix-sandbox.el" ];
            packageRequires = [ self.dash self.s ];
            meta = {
              homepage = "http://melpa.org/#/nix-sandbox";
              license = lib.licenses.free;
            };
          };
        }
      );
    in
      myEmacsPackagesNg.emacsWithPackages (epkgs:
        [ epkgs.flycheck
          epkgs.nix-sandbox ]);
}

and it seems to be working okay.