mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
exwm: add module
adapted from nixpkgs's exwm service
This commit is contained in:
committed by
Austin Horstman
parent
2cb4f4db37
commit
1bedcc8740
8
modules/misc/news/2026/05/2026-05-15_09-37-08.nix
Normal file
8
modules/misc/news/2026/05/2026-05-15_09-37-08.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
time = "2026-05-15T13:37:08+00:00";
|
||||
condition = true;
|
||||
message = ''
|
||||
A new module is available: `xsession.windowManager.exwm`. This
|
||||
provides configuration for the Emacs X Window Manager.
|
||||
'';
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
imports = [
|
||||
./awesome.nix
|
||||
./bspwm
|
||||
./exwm.nix
|
||||
./fluxbox.nix
|
||||
./herbstluftwm.nix
|
||||
./hyprland.nix
|
||||
|
||||
62
modules/services/window-managers/exwm.nix
Normal file
62
modules/services/window-managers/exwm.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
meta.maintainers = [ lib.hm.maintainers.garklein ];
|
||||
|
||||
options = {
|
||||
xsession.windowManager.exwm = {
|
||||
enable = lib.mkEnableOption "exwm";
|
||||
|
||||
loadScript = lib.mkOption {
|
||||
default = "(require 'exwm)";
|
||||
type = lib.types.lines;
|
||||
example = ''
|
||||
(require 'exwm)
|
||||
(exwm-enable)
|
||||
'';
|
||||
description = ''
|
||||
Emacs lisp code to be run after loading the user's init
|
||||
file.
|
||||
'';
|
||||
};
|
||||
|
||||
package = lib.mkPackageOption pkgs "emacs" {
|
||||
example = [ "emacs-gtk" ];
|
||||
};
|
||||
|
||||
extraPackages = lib.mkOption {
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = _epkgs: [ ];
|
||||
defaultText = lib.literalExpression "epkgs: []";
|
||||
example = lib.literalExpression ''
|
||||
epkgs: [
|
||||
epkgs.emms
|
||||
epkgs.magit
|
||||
epkgs.proof-general
|
||||
]
|
||||
'';
|
||||
description = ''
|
||||
Extra packages available to Emacs. The value must be a
|
||||
function which receives the attrset defined in
|
||||
{var}`emacs.pkgs` as the sole argument.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
cfg = config.xsession.windowManager.exwm;
|
||||
exwm-emacs = cfg.package.pkgs.withPackages (epkgs: cfg.extraPackages epkgs ++ [ epkgs.exwm ]);
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
home.packages = [ exwm-emacs ];
|
||||
xsession.windowManager.command = ''
|
||||
${exwm-emacs}/bin/emacs -l ${pkgs.writeText "emacs-exwm-load" "${cfg.loadScript}"}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user