Use --init-directory in Emacs 29+ (#191)

* Use `--init-directory` in Emacs 29+

This will allow a few advantages:
- We can load `early-init.el` file properly, fixing Flash Of Unstyled
Contents (FOUC) issues and improving the performance slightly
- Eventually we can drop `default.el` file loading in Home-Manager
module. Not done here since this would complicate the code without
necessity, however this can be done once Emacs 29+ is default

* Fix build in Emacs <29

* Add #checks.<arch>.init-example-el-emacsGit

* Add .#checks.x86_64-linux.init-example-el-emacsGit to CI

* Fix review issues

* Move config files to share/emacs.d

* Separate tests in two steps

* Add TODOS

* Simplify emacs-dir generation
This commit is contained in:
Thiago Kenji Okada
2022-07-10 18:46:49 +01:00
committed by GitHub
parent a59295c11e
commit 9111d480a8
4 changed files with 101 additions and 26 deletions

View File

@@ -87,7 +87,7 @@
flake-compat.flake = false;
};
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
outputs = { self, nixpkgs, flake-utils, emacs-overlay, ... }@inputs:
let inherit (flake-utils.lib) eachDefaultSystem eachSystem;
in eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
@@ -100,12 +100,27 @@
pkgs.callPackage self
(args // { dependencyOverrides = (inputs // dependencyOverrides); });
}) // eachSystem [ "x86_64-linux" "aarch64-darwin" ] (system: {
checks = {
init-example-el = self.outputs.package.${system} {
doomPrivateDir = ./test/doom.d;
dependencyOverrides = inputs;
};
};
checks =
let
pkgs = import nixpkgs {
inherit system;
# we are not using emacs-overlay's flake.nix here,
# to avoid unnecessary inputs to be added to flake.lock;
# this means we need to import the overlay in a hack-ish way
overlays = [ (import emacs-overlay) ];
};
in
{
init-example-el = self.outputs.package.${system} {
doomPrivateDir = ./test/doom.d;
dependencyOverrides = inputs;
};
init-example-el-emacsGit = self.outputs.package.${system} {
doomPrivateDir = ./test/doom.d;
dependencyOverrides = inputs;
emacsPackages = with pkgs; emacsPackagesFor emacsGit;
};
};
}) // {
hmModule = import ./modules/home-manager.nix inputs;
};