Introduce a plainmacs emacs install flavor.
This commit is contained in:
parent
3f945f8ae3
commit
d3ea8b3667
@ -28,4 +28,5 @@
|
|||||||
|
|
||||||
me.kodi.enable = true;
|
me.kodi.enable = true;
|
||||||
me.bluetooth.enable = true;
|
me.bluetooth.enable = true;
|
||||||
|
me.emacs_flavor = "plainmacs";
|
||||||
}
|
}
|
||||||
|
@ -34,4 +34,5 @@
|
|||||||
|
|
||||||
me.sway.enable = true;
|
me.sway.enable = true;
|
||||||
me.ansible.enable = true;
|
me.ansible.enable = true;
|
||||||
|
me.emacs_flavor = "full";
|
||||||
}
|
}
|
||||||
|
@ -39,69 +39,113 @@ let
|
|||||||
e_shorthand = pkgs.writeShellScriptBin "e" ''
|
e_shorthand = pkgs.writeShellScriptBin "e" ''
|
||||||
exec ${pkgs.emacs_full}/bin/emacs "''${@}"
|
exec ${pkgs.emacs_full}/bin/emacs "''${@}"
|
||||||
'';
|
'';
|
||||||
|
plain_e_shorthand = pkgs.writeShellScriptBin "e" ''
|
||||||
|
exec ${pkgs.emacs29-pgtk}/bin/emacs "''${@}"
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
config = lib.mkMerge [
|
options.me.emacs_flavor = lib.mkOption {
|
||||||
{
|
type = lib.types.nullOr (
|
||||||
environment.systemPackages = with pkgs; [
|
lib.types.enum [
|
||||||
plainmacs
|
"full"
|
||||||
e_shorthand
|
"plainmacs"
|
||||||
emacs_full
|
]
|
||||||
];
|
);
|
||||||
|
default = null;
|
||||||
|
example = "full";
|
||||||
|
description = "What flavor of emacs to set up.";
|
||||||
|
};
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
config =
|
||||||
(final: prev: {
|
lib.mkIf config.me.emacs_flavor != null (
|
||||||
emacs_full = pkgs.symlinkJoin {
|
lib.mkMerge [
|
||||||
name = "emacs_full";
|
(lib.mkIf (config.me.emacs_flavor == "full") {
|
||||||
paths = [ pkgs.emacs29-pgtk ];
|
environment.systemPackages = with pkgs; [
|
||||||
buildInputs = [ pkgs.makeWrapper ];
|
plainmacs
|
||||||
postBuild = ''
|
e_shorthand
|
||||||
wrapProgram $out/bin/emacs --prefix PATH : ${
|
emacs_full
|
||||||
lib.makeBinPath [
|
];
|
||||||
(pkgs.aspellWithDicts (
|
|
||||||
dicts: with dicts; [
|
nixpkgs.overlays = [
|
||||||
en
|
(final: prev: {
|
||||||
en-computers
|
emacs_full = pkgs.symlinkJoin {
|
||||||
|
name = "emacs_full";
|
||||||
|
paths = [ pkgs.emacs29-pgtk ];
|
||||||
|
buildInputs = [ pkgs.makeWrapper ];
|
||||||
|
postBuild = ''
|
||||||
|
wrapProgram $out/bin/emacs --prefix PATH : ${
|
||||||
|
lib.makeBinPath [
|
||||||
|
(pkgs.aspellWithDicts (
|
||||||
|
dicts: with dicts; [
|
||||||
|
en
|
||||||
|
en-computers
|
||||||
|
]
|
||||||
|
))
|
||||||
|
pkgs.nixd # nix language server
|
||||||
|
pkgs.nixfmt-rfc-style # auto-formatting nix files through nixd
|
||||||
|
pkgs.clang # To compile tree-sitter grammars
|
||||||
|
pkgs.shellcheck
|
||||||
]
|
]
|
||||||
))
|
}
|
||||||
pkgs.nixd # nix language server
|
'';
|
||||||
pkgs.nixfmt-rfc-style # auto-formatting nix files through nixd
|
};
|
||||||
pkgs.clang # To compile tree-sitter grammars
|
})
|
||||||
]
|
];
|
||||||
}
|
|
||||||
'';
|
home-manager.users.talexander =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.file.".config/emacs" = {
|
||||||
|
source = ./files/emacs;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
||||||
|
hideMounts = true;
|
||||||
|
users.talexander = {
|
||||||
|
directories = [
|
||||||
|
".config/emacs/eln-cache" # Installed packages
|
||||||
|
".config/emacs/elpa" # Installed packages
|
||||||
|
".config/emacs/private" # For recentf
|
||||||
|
".config/emacs/tree-sitter" # Compiled tree-sitter grammars
|
||||||
|
];
|
||||||
|
files = [
|
||||||
|
".config/emacs/history" # For savehist
|
||||||
|
".config/emacs/.last-package-update-day" # For use-package
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.variables.EDITOR = "${plainmacs}/bin/plainmacs";
|
||||||
})
|
})
|
||||||
];
|
(lib.mkIf (config.me.emacs_flavor == "plainmacs") {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
emacs29-pgtk
|
||||||
|
plainmacs
|
||||||
|
plain_e_shorthand
|
||||||
|
];
|
||||||
|
|
||||||
home-manager.users.talexander =
|
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
||||||
{ pkgs, ... }:
|
hideMounts = true;
|
||||||
{
|
users.talexander = {
|
||||||
home.file.".config/emacs" = {
|
directories = [
|
||||||
source = ./files/emacs;
|
".config/emacs/eln-cache" # Installed packages
|
||||||
recursive = true;
|
".config/emacs/elpa" # Installed packages
|
||||||
|
".config/emacs/private" # For recentf
|
||||||
|
".config/emacs/tree-sitter" # Compiled tree-sitter grammars
|
||||||
|
];
|
||||||
|
files = [
|
||||||
|
".config/emacs/history" # For savehist
|
||||||
|
".config/emacs/.last-package-update-day" # For use-package
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
environment.variables.EDITOR = "${plainmacs}/bin/plainmacs";
|
||||||
hideMounts = true;
|
})
|
||||||
users.talexander = {
|
]
|
||||||
directories = [
|
);
|
||||||
".config/emacs/eln-cache" # Installed packages
|
|
||||||
".config/emacs/elpa" # Installed packages
|
|
||||||
".config/emacs/private" # For recentf
|
|
||||||
".config/emacs/tree-sitter" # Compiled tree-sitter grammars
|
|
||||||
];
|
|
||||||
files = [
|
|
||||||
".config/emacs/history" # For savehist
|
|
||||||
".config/emacs/.last-package-update-day" # For use-package
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.variables.EDITOR = "${plainmacs}/bin/plainmacs";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user