Reformat emacs config

This commit is contained in:
Julian Mutter 2024-06-15 19:33:19 +02:00
parent 5839002d3c
commit 0197faa345

View File

@ -1,22 +1,23 @@
{
# Snowfall Lib provides a customized `lib` instance with access to your flake's library
# as well as the libraries available from your flake's inputs.
lib,
# An instance of `pkgs` with your overlays and packages applied is also available.
pkgs,
# You also have access to your flake's inputs.
inputs,
# Snowfall Lib provides a customized `lib` instance with access to your flake's library
# as well as the libraries available from your flake's inputs.
lib,
# An instance of `pkgs` with your overlays and packages applied is also available.
pkgs,
# You also have access to your flake's inputs.
inputs,
# Additional metadata is provided by Snowfall Lib.
system, # The system architecture for this host (eg. `x86_64-linux`).
target, # The Snowfall Lib target for this system (eg. `x86_64-iso`).
format, # A normalized name for the system target (eg. `iso`).
virtual
, # A boolean to determine whether this system is a virtual target using nixos-generators.
systems, # An attribute map of your defined hosts.
# Additional metadata is provided by Snowfall Lib.
system, # The system architecture for this host (eg. `x86_64-linux`).
target, # The Snowfall Lib target for this system (eg. `x86_64-iso`).
format, # A normalized name for the system target (eg. `iso`).
virtual, # A boolean to determine whether this system is a virtual target using nixos-generators.
systems, # An attribute map of your defined hosts.
# All other arguments come from the module system.
config, ... }:
# All other arguments come from the module system.
config,
...
}:
with lib;
@ -24,10 +25,15 @@ let
cfg = config.modules.emacs;
doomRepoUrl = "https://github.com/doomemacs/doomemacs";
configRepoUrl = "https://gitlab.julian-mutter.de/julian/emacs-config";
in {
options.modules.emacs = { enable = mkOption { default = false; }; };
in
{
options.modules.emacs = {
enable = mkOption { default = false; };
};
config = mkIf cfg.enable {
home.sessionPath = [ "/home/julian/.config/emacs/bin" ];
home.packages = with pkgs; [
emacs
binutils # native-comp needs 'as', provided by this
@ -42,7 +48,14 @@ in {
zstd # for undo-fu-session/undo-tree compression
## Module dependencies
(aspellWithDicts (ds: with ds; [ en en-computers en-science de ]))
(aspellWithDicts (
ds: with ds; [
en
en-computers
en-science
de
]
))
sqlite
# Code formatters for use with doom emacs
@ -60,14 +73,13 @@ in {
emacs-all-the-icons-fonts
];
home.activation.installDoomEmacs =
lib.home-manager.hm.dag.entryAfter [ "writeBoundary" ] ''
if [ ! -d "/home/julian/.config/emacs" ]; then
$DRY_RUN_CMD ${pkgs.git}/bin/git clone --depth=1 --single-branch "${doomRepoUrl}" "/home/julian/.config/emacs"
fi
if [ ! -d "/home/julian/.config/doom" ]; then
$DRY_RUN_CMD ${pkgs.git}/bin/git clone "${configRepoUrl}" "/home/julian/.config/doom"
fi
'';
home.activation.installDoomEmacs = lib.home-manager.hm.dag.entryAfter [ "writeBoundary" ] ''
if [ ! -d "/home/julian/.config/emacs" ]; then
$DRY_RUN_CMD ${pkgs.git}/bin/git clone --depth=1 --single-branch "${doomRepoUrl}" "/home/julian/.config/emacs"
fi
if [ ! -d "/home/julian/.config/doom" ]; then
$DRY_RUN_CMD ${pkgs.git}/bin/git clone "${configRepoUrl}" "/home/julian/.config/doom"
fi
'';
};
}