[emacs] Modularize more and better pkg
Attempts to select the right emacs package based on whether the machine is x11 only or not.
This commit is contained in:
@@ -4,6 +4,29 @@ with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.desktop;
|
||||
|
||||
basePackages = with pkgs; [
|
||||
|
||||
];
|
||||
|
||||
x11BasePackages = with pkgs; [
|
||||
|
||||
];
|
||||
|
||||
x11OnlyPackages = with pkgs; [
|
||||
emacs
|
||||
];
|
||||
|
||||
waylandBasePackages = with pkgs; [
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
mako
|
||||
];
|
||||
|
||||
waylandOnlyPackages = with pkgs; [
|
||||
emacs-gtk
|
||||
];
|
||||
in
|
||||
{
|
||||
options.roles.desktop = {
|
||||
@@ -40,12 +63,6 @@ in
|
||||
programs.dconf.enable = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; mkIf (!cfg.x11Only) [
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
mako
|
||||
];
|
||||
programs.sway = mkIf (!cfg.x11Only) {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
@@ -73,6 +90,15 @@ in
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
users.extraGroups.docker.members = [ "johno" ];
|
||||
|
||||
environment.systemPackages = with pkgs; mkMerge [
|
||||
basePackages
|
||||
x11BasePackages
|
||||
(mkIf cfg.x11Only x11OnlyPackages)
|
||||
# TODO: Do we need a "wayland only" mode?
|
||||
(mkIf (!cfg.x11Only) waylandBasePackages)
|
||||
(mkIf (!cfg.x11Only) waylandOnlyPackages)
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user