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:
import nixpkgs {
localSystem = system;
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 {
packages.aarch64-linux.default = import ./package.nix { withLsps = true;
pkgs = import nixpkgs {
system = "aarch64-linux";
overlays = [
emacs-overlay.overlays.default
nix-org-babel.overlays.default
];
}; };
}; native = self.packages.${system}.default.override {
packages.x86_64-linux.with-lsps = import ./package.nix { native = true;
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [
emacs-overlay.overlays.default
nix-org-babel.overlays.default
];
}; };
withLsps = true; with-lsps-native = self.packages.${system}.with-lsps.override {
}; native = true;
packages.aarch64-linux.with-lsps = import ./package.nix {
pkgs = import nixpkgs {
system = "aarch64-linux";
overlays = [
emacs-overlay.overlays.default
nix-org-babel.overlays.default
];
}; };
withLsps = true; });
};
}; };
} }

View file

@ -5,10 +5,10 @@
... ...
}: let }: let
preTangledFile = pkgs.writeText "config.org" '' preTangledFile = pkgs.writeText "config.org" ''
${builtins.readFile ./config.org} ${builtins.readFile ./config.org}
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq dashboard-startup-banner "${./nixmacs.xpm}") (setq dashboard-startup-banner "${./nixmacs.xpm}")
#+end_src #+end_src
''; '';
configFile = pkgs.tangleOrgBabelFile "default.el" preTangledFile { configFile = pkgs.tangleOrgBabelFile "default.el" preTangledFile {
languages = ["emacs-lisp"]; languages = ["emacs-lisp"];
@ -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 =
oldAttrs: { if native
NIX_CFLAGS_COMPILE = builtins.toString oldAttrs.NIX_CFLAGS_COMPILE or "" + "-march=native -O3"; then
} pkgs.emacs30-pgtk.overrideAttrs (
) else pkgs.emacs30-pgtk; oldAttrs: {
NIX_CFLAGS_COMPILE = builtins.toString oldAttrs.NIX_CFLAGS_COMPILE or "" + "-march=native -O3";
}
)
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
@ -69,25 +73,27 @@
imagemagick imagemagick
fontconfig fontconfig
freetype freetype
ripgrep ripgrep
vips vips
ffmpegthumbnailer ffmpegthumbnailer
mediainfo mediainfo
p7zip p7zip
epub-thumbnailer epub-thumbnailer
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) [ ])
csharp-ls ++ lib.optionals withLsps [
clang-tools csharp-ls
cmake-language-server clang-tools
nil cmake-language-server
nil
]); ]);
# Optionally override derivations. # Optionally override derivations.