Skip to content

Instantly share code, notes, and snippets.

@sigma
Last active October 12, 2022 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sigma/0a662ad9905e85f673ad42164a59bfbb to your computer and use it in GitHub Desktop.
Save sigma/0a662ad9905e85f673ad42164a59bfbb to your computer and use it in GitHub Desktop.
sample flake.nix for emacs projects
use flake
eval "$shellHook"
{
description = "codex dev environment";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/21.11;
flake-utils.url = github:numtide/flake-utils;
multi-emacs.url = github:sigma/multi-emacs;
multi-emacs.inputs.nixpkgs.follows = "nixpkgs";
multi-emacs.inputs.flake-utils.follows = "flake-utils";
};
outputs = { self, nixpkgs, flake-utils, multi-emacs }:
flake-utils.lib.eachDefaultSystem (system: {
devShell =
let
pkgs = import nixpkgs {
inherit system;
overlays = [
multi-emacs.overlay
];
};
in
pkgs.devshell.mkShell {
packages = [
(pkgs.multiEmacs {
wrapper = emacs: pkgs.emacsWithPackagesFromPackageRequires {
package = emacs;
packageElisp = builtins.readFile ./codex.el;
};
flavors = [
pkgs.emacs-25-1 pkgs.emacs-25-2 pkgs.emacs-25-3
pkgs.emacs-26-1 pkgs.emacs-26-2 pkgs.emacs-26-3
pkgs.emacs-27-1 pkgs.emacs-27-2
pkgs.emacs-snapshot
];
})
];
};
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment