From fc019d789523ce5f89436b8dbc458cf3b79abf43 Mon Sep 17 00:00:00 2001 From: aristote Date: Tue, 29 Jul 2025 15:25:11 +0200 Subject: reformat everything with nixfmt --- modules/devenv/integrations/emacs.nix | 38 ++++++++++++++++------------------- 1 file changed, 17 insertions(+), 21 deletions(-) (limited to 'modules/devenv/integrations/emacs.nix') diff --git a/modules/devenv/integrations/emacs.nix b/modules/devenv/integrations/emacs.nix index 347132f..ed20734 100644 --- a/modules/devenv/integrations/emacs.nix +++ b/modules/devenv/integrations/emacs.nix @@ -2,33 +2,31 @@ config, lib, ... -}: let +}: +let cfg = config.emacs; - attrs2alist = value: - if lib.isAttrs value - then "(${lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "(${name} . ${attrs2alist value})") value)})" + attrs2alist = + value: + if lib.isAttrs value then + "(${ + lib.concatStringsSep "\n" ( + lib.mapAttrsToList (name: value: "(${name} . ${attrs2alist value})") value + ) + })" else ( - if lib.isList value - then "(${lib.concatStringsSep " " value})" + if lib.isList value then + "(${lib.concatStringsSep " " value})" else - ( - if lib.isBool value - then - ( - if value - then "t" - else "nil" - ) - else builtins.toString value - ) + (if lib.isBool value then (if value then "t" else "nil") else builtins.toString value) ); -in { +in +{ options.emacs = { enable = lib.mkEnableOption "emacs integration"; dirLocals = lib.mkOption { type = with lib.types; attrsOf (attrsOf anything); - default = {}; + default = { }; example = # the first example from https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html { @@ -46,7 +44,5 @@ in { }; }; - config.dotfiles.".dir-locals.el".text = - lib.mkIf (cfg.dirLocals != {}) - (attrs2alist cfg.dirLocals); + config.dotfiles.".dir-locals.el".text = lib.mkIf (cfg.dirLocals != { }) (attrs2alist cfg.dirLocals); } -- cgit v1.2.3