Introduce a plainmacs emacs install flavor.
This commit is contained in:
parent
3f945f8ae3
commit
d3ea8b3667
@ -28,4 +28,5 @@
|
||||
|
||||
me.kodi.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
me.emacs_flavor = "plainmacs";
|
||||
}
|
||||
|
@ -34,4 +34,5 @@
|
||||
|
||||
me.sway.enable = true;
|
||||
me.ansible.enable = true;
|
||||
me.emacs_flavor = "full";
|
||||
}
|
||||
|
@ -39,69 +39,113 @@ let
|
||||
e_shorthand = pkgs.writeShellScriptBin "e" ''
|
||||
exec ${pkgs.emacs_full}/bin/emacs "''${@}"
|
||||
'';
|
||||
plain_e_shorthand = pkgs.writeShellScriptBin "e" ''
|
||||
exec ${pkgs.emacs29-pgtk}/bin/emacs "''${@}"
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
plainmacs
|
||||
e_shorthand
|
||||
emacs_full
|
||||
];
|
||||
options.me.emacs_flavor = lib.mkOption {
|
||||
type = lib.types.nullOr (
|
||||
lib.types.enum [
|
||||
"full"
|
||||
"plainmacs"
|
||||
]
|
||||
);
|
||||
default = null;
|
||||
example = "full";
|
||||
description = "What flavor of emacs to set up.";
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
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
|
||||
config =
|
||||
lib.mkIf config.me.emacs_flavor != null (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf (config.me.emacs_flavor == "full") {
|
||||
environment.systemPackages = with pkgs; [
|
||||
plainmacs
|
||||
e_shorthand
|
||||
emacs_full
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
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 =
|
||||
{ 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.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";
|
||||
}
|
||||
];
|
||||
environment.variables.EDITOR = "${plainmacs}/bin/plainmacs";
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user