38 lines
1.3 KiB
Nix
38 lines
1.3 KiB
Nix
{
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
inputs.emacs-overlay.url = "github:nix-community/emacs-overlay";
|
|
inputs.emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
outputs = { self, nixpkgs, flake-utils, emacs-overlay }: let
|
|
mkEmacs = pkgs: v: wayland: pkgs.emacsWithPackagesFromUsePackage {
|
|
config = ./main.org;
|
|
package = (pkgs."${v}${if pkgs.stdenv.isDarwin then "-macport" else (if wayland then "-pgtk" else "")}").overrideAttrs (old: {
|
|
passthru = old.passthru // {
|
|
treeSitter = true;
|
|
};
|
|
});
|
|
extraEmacsPackages = epkgs: with epkgs; [
|
|
treesit-grammars.with-all-grammars
|
|
];
|
|
};
|
|
in (flake-utils.lib.eachDefaultSystem (system: let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [
|
|
emacs-overlay.overlays.default
|
|
];
|
|
};
|
|
in {
|
|
packages = {
|
|
me-emacs = mkEmacs pkgs "emacs" false;
|
|
me-emacs-wayland = mkEmacs pkgs "emacs" true;
|
|
};
|
|
})) // {
|
|
overlays.default = final: prev: (emacs-overlay.overlays.default final prev) // {
|
|
me-emacs = mkEmacs final "emacs" false;
|
|
me-emacs-wayland = mkEmacs final "emacs" true;
|
|
};
|
|
};
|
|
}
|