emacs-flake/flake.nix
larstvei 8e643d23c2
Some checks failed
Build and Cache with Cachix / build (push) Has been cancelled
emacs-unstable is emacs-30
2025-08-24 16:37:02 +02:00

66 lines
1.6 KiB
Nix

{
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";
emacs-config = {
url = "github:larstvei/dot-emacs";
flake = false;
};
emacs-plus = {
url = "github:d12frosted/homebrew-emacs-plus";
flake = false;
};
};
outputs =
{
self,
nixpkgs,
flake-utils,
emacs-overlay,
emacs-plus,
emacs-config,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
emacs-overlay.overlays.emacs
emacs-overlay.overlays.package
];
};
emacsDarwin = (pkgs.emacs-unstable).overrideAttrs (_: {
patches = [
"${emacs-plus}/patches/emacs-30/round-undecorated-frame.patch"
"${emacs-plus}/patches/emacs-30/system-appearance.patch"
];
});
emacsLinux = pkgs.emacs-unstable-pgtk;
emacsPkg = if pkgs.stdenv.isDarwin then emacsDarwin else emacsLinux;
in
{
defaultPackage = pkgs.emacsWithPackagesFromUsePackage {
config = "${emacs-config}/init.org";
package = emacsPkg;
defaultInitFile = true;
alwaysEnsure = true;
alwaysTangle = true;
extraEmacsPackages = epkgs: [
epkgs.treesit-grammars.with-all-grammars
epkgs.jinx
];
};
devShell = pkgs.mkShell { buildInputs = [ pkgs.jq ]; };
}
);
}