This commit is contained in:
Aleksandr Lebedev 2025-07-25 22:54:52 +02:00
parent 97ca185951
commit 1b0367dca5
2 changed files with 59 additions and 58 deletions

View file

@ -18,44 +18,39 @@
nixpkgs, nixpkgs,
emacs-overlay, emacs-overlay,
nix-org-babel, nix-org-babel,
}: { }: let
packages.x86_64-linux.default = import ./package.nix { systems = ["aarch64-linux" "x86_64-linux"];
pkgs = import nixpkgs { eachSystem = nixpkgs.lib.genAttrs systems;
system = "x86_64-linux"; pkgsFor = eachSystem (system:
overlays = [ import nixpkgs {
emacs-overlay.overlays.default localSystem = system;
nix-org-babel.overlays.default
];
};
};
packages.aarch64-linux.default = import ./package.nix {
pkgs = import nixpkgs {
system = "aarch64-linux";
overlays = [
emacs-overlay.overlays.default
nix-org-babel.overlays.default
];
};
};
packages.x86_64-linux.with-lsps = import ./package.nix {
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ overlays = [
emacs-overlay.overlays.default emacs-overlay.overlays.default
nix-org-babel.overlays.default nix-org-babel.overlays.default
]; ];
});
in {
formatter = eachSystem (
system: let
pkgs = pkgsFor.${system};
in
pkgs.alejandra
);
packages = eachSystem (system: let
pkgs = pkgsFor.${system};
in {
default = import ./package.nix {
inherit pkgs;
}; };
with-lsps = self.packages.${system}.default.override {
withLsps = true; withLsps = true;
}; };
packages.aarch64-linux.with-lsps = import ./package.nix { native = self.packages.${system}.default.override {
pkgs = import nixpkgs { native = true;
system = "aarch64-linux";
overlays = [
emacs-overlay.overlays.default
nix-org-babel.overlays.default
];
}; };
withLsps = true; with-lsps-native = self.packages.${system}.with-lsps.override {
native = true;
}; };
});
}; };
} }

View file

@ -33,11 +33,15 @@
# }; # };
defaultInitFile = true; defaultInitFile = true;
# Package is optional, defaults to pkgs.emacs # Package is optional, defaults to pkgs.emacs
package = if native then pkgs.emacs30-pgtk.overrideAttrs ( package =
if native
then
pkgs.emacs30-pgtk.overrideAttrs (
oldAttrs: { oldAttrs: {
NIX_CFLAGS_COMPILE = builtins.toString oldAttrs.NIX_CFLAGS_COMPILE or "" + "-march=native -O3"; NIX_CFLAGS_COMPILE = builtins.toString oldAttrs.NIX_CFLAGS_COMPILE or "" + "-march=native -O3";
} }
) else pkgs.emacs30-pgtk; )
else pkgs.emacs30-pgtk;
# By default emacsWithPackagesFromUsePackage will only pull in # By default emacsWithPackagesFromUsePackage will only pull in
# packages with `:ensure`, `:ensure t` or `:ensure <package name>`. # packages with `:ensure`, `:ensure t` or `:ensure <package name>`.
@ -60,8 +64,8 @@
# Optionally provide extra packages not in the configuration file. # Optionally provide extra packages not in the configuration file.
# This can also include extra executables to be run by Emacs (linters, # This can also include extra executables to be run by Emacs (linters,
# language servers, formatters, etc) # language servers, formatters, etc)
extraEmacsPackages = epkgs: extraEmacsPackages = epkgs: (with pkgs;
(with pkgs; [ [
#nerd-fonts.jetbrains-mono #nerd-fonts.jetbrains-mono
#jetbrains-mono #jetbrains-mono
unzip unzip
@ -78,12 +82,14 @@
poppler-utils poppler-utils
gzip gzip
gnutar gnutar
] ++ (with epkgs;[ ]
++ (with epkgs; [
tree-sitter tree-sitter
tree-sitter-langs tree-sitter-langs
treesit-grammars.with-all-grammars treesit-grammars.with-all-grammars
el-easydraw el-easydraw
]) ++ lib.optionals (withLsps) [ ])
++ lib.optionals withLsps [
csharp-ls csharp-ls
clang-tools clang-tools
cmake-language-server cmake-language-server