d2fa4e7c86
* //ops/modules/depot-inbox: Adapt to upstream option type declaration. See nixpkgs commit b6ed3b8f402893df91a8e21ce993520301c2f076. * //ops/machines/sanduny, //users/tazjin/polyanka: Remove boot.loader.grub.version options (no longer has any effect). * //users/sterni/emacs: reflect rename emacsPgtk -> emacs-pgtk * //3p/overlays: update tdlib to match emacs-overlay * //3p/overlays: give EXWM from depot a separate name * //users/grfn/system/home: disable Slack support in ntfy Change-Id: I03bde088bc70e05b23925f244899807210cb7b20 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8547 Autosubmit: sterni <sternenseemann@systemli.org> Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
110 lines
3.7 KiB
Nix
110 lines
3.7 KiB
Nix
{ depot, pkgs, lib, ... }:
|
|
|
|
let
|
|
inherit (pkgs.stdenv.hostPlatform) is64bit;
|
|
|
|
# Wrap chktex(1) with the flags we want because the chktex flycheck checker
|
|
# ignores tex-chktex-extra-flags and has no other way to set flags. I did
|
|
# not want to mess around with chktexrc because that seems to involve copying
|
|
# around a lot of rules (that would need to be updated?).
|
|
#
|
|
# Warning 8 is about correct dash length. This is really annoying because it'll
|
|
# light up everywhere if you use typographically correct dashes in German text.
|
|
chktexLessWarnings = pkgs.writeShellScript "chktex-less-warnings" ''
|
|
exec chktex -n8 "$@"
|
|
'';
|
|
|
|
# emacsPgtk is defined in emacs-overlay
|
|
emacs = (pkgs.emacsPackagesFor pkgs.emacs-pgtk).withPackages (epkgs: [
|
|
epkgs.bqn-mode
|
|
#epkgs.elpaPackages.ada-mode
|
|
epkgs.elpaPackages.rainbow-mode
|
|
epkgs.elpaPackages.undo-tree
|
|
epkgs.elpaPackages.which-key
|
|
epkgs.melpaPackages.adoc-mode
|
|
epkgs.melpaPackages.cmake-mode
|
|
epkgs.melpaPackages.direnv
|
|
epkgs.melpaPackages.dockerfile-mode
|
|
epkgs.melpaPackages.editorconfig
|
|
epkgs.melpaPackages.elfeed
|
|
epkgs.melpaPackages.evil
|
|
epkgs.melpaPackages.evil-collection
|
|
epkgs.melpaPackages.flycheck
|
|
epkgs.melpaPackages.haskell-mode
|
|
epkgs.melpaPackages.hl-todo
|
|
epkgs.melpaPackages.jq-mode
|
|
epkgs.melpaPackages.lsp-haskell
|
|
epkgs.melpaPackages.lsp-mode
|
|
epkgs.melpaPackages.lsp-ui
|
|
epkgs.melpaPackages.magit
|
|
epkgs.melpaPackages.markdown-mode
|
|
epkgs.melpaPackages.meson-mode
|
|
epkgs.melpaPackages.nix-mode
|
|
epkgs.melpaPackages.org-clock-csv
|
|
epkgs.melpaPackages.paredit
|
|
epkgs.melpaPackages.rainbow-delimiters
|
|
epkgs.melpaPackages.sly
|
|
epkgs.melpaPackages.use-package
|
|
epkgs.melpaPackages.yaml-mode
|
|
epkgs.rust-mode
|
|
epkgs.tvlPackages.tvl
|
|
epkgs.urweb-mode
|
|
] ++ lib.optionals is64bit [
|
|
epkgs.melpaPackages.languagetool
|
|
]);
|
|
|
|
configDirectory = pkgs.symlinkJoin {
|
|
name = "emacs.d";
|
|
paths = [
|
|
./.
|
|
(pkgs.writeTextFile {
|
|
name = "injected-emacs.d";
|
|
destination = "/nix-inject.el";
|
|
text =
|
|
# Java doesn't seem to be available for non 64bit platforms in nixpkgs
|
|
# CBQN doesn't seem to support i686 at least
|
|
lib.optionalString is64bit ''
|
|
;; bqn-mode
|
|
(setq bqn-interpreter-path "${pkgs.cbqn}/bin/BQN")
|
|
|
|
;; languagetool
|
|
(setq languagetool-java-bin "${pkgs.jre}/bin/java"
|
|
languagetool-console-command "${pkgs.languagetool}/share/languagetool-commandline.jar"
|
|
languagetool-server-command "${pkgs.languagetool}/share/languagetool-server.jar")
|
|
'' + ''
|
|
|
|
;; use bash instead of fish from SHELL for some things, as it plays
|
|
;; nicer with TERM=dumb, as I don't need/want vterm anyways.
|
|
;; We want it to source /etc/profile for some extra setup that
|
|
;; kicks in if TERM=dumb, meaning we can't use dash/sh mode.
|
|
(setq shell-file-name "${pkgs.bash}/bin/bash"
|
|
explicit-bash-args '("-l"))
|
|
|
|
;; chktex wrapper that disables warnings I don't want
|
|
(setq flycheck-tex-chktex-executable "${chktexLessWarnings}")
|
|
(setq tex-chktex-program "${chktexLessWarnings}")
|
|
|
|
(provide 'nix-inject)
|
|
'';
|
|
})
|
|
];
|
|
postBuild = ''
|
|
rm "$out/default.nix"
|
|
'';
|
|
};
|
|
in
|
|
|
|
# sadly we can't give an init-file via the command line
|
|
(pkgs.writeShellScriptBin "emacs" ''
|
|
exec ${emacs}/bin/emacs \
|
|
--no-init-file \
|
|
--directory ${configDirectory} \
|
|
--eval "(require 'init)" \
|
|
"$@"
|
|
'').overrideAttrs (super: {
|
|
buildCommand = ''
|
|
${super.buildCommand}
|
|
|
|
ln -s "${emacs}/bin/emacsclient" "$out/bin/emacsclient"
|
|
'';
|
|
})
|