Skip to content

Instantly share code, notes, and snippets.

@sigma
Last active Oct 12, 2022
Embed
What would you like to do?
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