emacs-flake/flake.nix

52 lines
1.5 KiB
Nix
Raw Normal View History

2024-07-20 00:01:43 +00:00
{
description = "My emacs Flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
emacs-overlay.url = "github:nix-community/emacs-overlay";
2024-07-20 15:42:22 +00:00
emacs-config = {
url = "github:larstvei/dot-emacs";
flake = false;
};
emacs-plus = {
url = "github:d12frosted/homebrew-emacs-plus";
flake = false;
};
2024-07-20 00:01:43 +00:00
};
2024-07-20 15:42:22 +00:00
outputs =
{ self, nixpkgs, flake-utils, emacs-overlay, emacs-plus, emacs-config }:
2024-07-20 00:01:43 +00:00
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
2024-07-20 15:42:22 +00:00
overlays =
[ emacs-overlay.overlays.emacs emacs-overlay.overlays.package ];
2024-07-20 00:01:43 +00:00
};
2024-07-20 15:42:22 +00:00
patched-emacs = (pkgs.emacs-git).overrideAttrs (o: {
patches = [
"${emacs-plus}/patches/emacs-31/fix-window-role.patch"
"${emacs-plus}/patches/emacs-31/poll.patch"
"${emacs-plus}/patches/emacs-31/round-undecorated-frame.patch"
"${emacs-plus}/patches/emacs-31/system-appearance.patch"
];
});
2024-07-20 00:01:43 +00:00
in {
defaultPackage = pkgs.emacsWithPackagesFromUsePackage {
2024-07-20 15:42:22 +00:00
config = "${emacs-config}/init.org";
package = patched-emacs;
2024-07-20 00:01:43 +00:00
defaultInitFile = true;
alwaysEnsure = true;
alwaysTangle = true;
2024-07-20 17:56:04 +00:00
extraEmacsPackages = epkgs: [
epkgs.treesit-grammars.with-all-grammars
epkgs.jinx
];
2024-07-20 00:01:43 +00:00
};
2024-07-20 16:02:06 +00:00
devShell = pkgs.mkShell { buildInputs = [ pkgs.jq ]; };
2024-07-20 00:01:43 +00:00
});
}