1
0
mirror of https://github.com/ellmau/nixos.git synced 2025-12-19 09:29:36 +01:00

Dap mode (#7)

* Fix dap-mode for emacs
* Fix formatting
* Further fixes
* Fix dap-cpptools config

---------

Co-authored-by: Maximilian Marx <mmarx@wh2.tu-dresden.de>
This commit is contained in:
Stefan Ellmauthaler 2023-03-26 16:05:07 +02:00 committed by GitHub
parent 1034e3fe25
commit 9ce9939eff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 93 additions and 99 deletions

View File

@ -85,6 +85,7 @@
"steam-runtime" "steam-runtime"
"skypeforlinux" "skypeforlinux"
"teams" "teams"
"vscode-extension-ms-vscode-cpptools"
"zoom" "zoom"
]; ];
}; };

View File

@ -2,6 +2,8 @@
;;(setq package-enable-at-startup nil) ;;(setq package-enable-at-startup nil)
;;(package-initialize) ;;(package-initialize)
(require 'local-settings)
;; (load-theme 'spacemacs-dark t) ;; (load-theme 'spacemacs-dark t)
;; (load-theme 'wombat t) ;; (load-theme 'wombat t)
(use-package solarized-theme (use-package solarized-theme
@ -456,14 +458,17 @@
;; dap ;; dap
(use-package dap-mode (use-package dap-mode
:ensure :ensure
:after lsp-mode :after (lsp-mode dap-cpptools)
:requires (dap-cpptools)
:config
(dap-ui-mode)
(dap-ui-controls-mode 1)
:custom :custom
(dap-mode t) (dap-mode t)
(dap-ui-mode t)) (dap-ui-mode t)
(dap-ui-controls-mode t)
(dap-tooltip-mode t))
(use-package dap-cpptools
:custom
(dap-cpptools-debug-path elss/paths/cpptools)
(dap-cpptools-debug-program `(,elss/paths/cpptools-program)))
;; flycheck ;; flycheck
(use-package flycheck (use-package flycheck

View File

@ -1,108 +1,96 @@
{ { config, lib, pkgs, ... }:
config, with lib;
lib, let
pkgs,
...
}:
with lib; let
defaultEl = ./default.el; defaultEl = ./default.el;
environment.systemPackages = [pkgs.gdb]; # use gdb for dap-mode environment.systemPackages = [ pkgs.gdb ]; # use gdb for dap-mode
localsettings = pkgs.writeText "local-settings.el" ''
(defconst elss/paths/cpptools "${pkgs.unstable.vscode-extensions.ms-vscode.cpptools}/share/vscode/extensions/ms-vscode.cpptools")
(defconst elss/paths/cpptools-program "${pkgs.unstable.vscode-extensions.ms-vscode.cpptools}/share/vscode/extensions/ms-vscode.cpptools/debugAdapters/bin/OpenDebugAD7")
(provide 'local-settings)
'';
defaultConfig = pkgs.runCommand "default.el" {} '' defaultConfig = pkgs.runCommand "default.el" { } ''
mkdir -p $out/share/emacs/site-lisp mkdir -p $out/share/emacs/site-lisp
cp ${defaultEl} $out/share/emacs/site-lisp/default.el cp ${defaultEl} $out/share/emacs/site-lisp/default.el
cp ${localsettings} $out/share/emacs/site-lisp/local-settings.el
''; '';
emacsPackage = emacsPackage = (pkgs.emacsPackagesFor pkgs.emacs).emacsWithPackages (epkgs:
(pkgs.emacsPackagesFor pkgs.emacs).emacsWithPackages let
(epkgs: let lpkgs = import ./packages.nix { inherit config lib pkgs epkgs; };
lpkgs = import ./packages.nix {
inherit config lib pkgs epkgs;
};
in
#[ (defaultConfig lpkgs) ] ++ (with pkgs; [ #[ (defaultConfig lpkgs) ] ++ (with pkgs; [
# aspell # aspell
# emacs-all-the-icons-fonts # emacs-all-the-icons-fonts
# gnupg # gnupg
# nixpkgs-fmt # nixpkgs-fmt
#]) #])
[defaultConfig] in [ defaultConfig ]
++ [ ++ [ (with epkgs.elpaPackages; [ auctex org flymake ]) ]
(with epkgs.elpaPackages; [ ++ (with epkgs.melpaStablePackages; [ ]) ++ (with epkgs.melpaPackages;
auctex [
org ac-helm
flymake academic-phrases
]) add-hooks
] alert
++ (with epkgs.melpaStablePackages; []) all-the-icons
++ (with epkgs.melpaPackages; all-the-icons-dired
[ apheleia
ac-helm beacon
academic-phrases bln-mode
add-hooks cargo-mode
alert company
all-the-icons company-auctex
all-the-icons-dired company-bibtex
apheleia company-flx
beacon company-quickhelp
bln-mode company-reftex
cargo-mode cov
company dap-mode
company-auctex diminish
company-bibtex direnv
company-flx dockerfile-mode
company-quickhelp docker-compose-mode
company-reftex flycheck
cov free-keys
dap-mode highlight-indentation
diminish helm
direnv #helm-bbdb
dockerfile-mode helm-company
docker-compose-mode helm-flx
flycheck helm-descbinds
free-keys helm-lsp
highlight-indentation helm-projectile
helm helm-rg
#helm-bbdb json-mode
helm-company less-css-mode
helm-flx lsp-mode
helm-descbinds lsp-ui
helm-lsp magit
helm-projectile markdown-mode
helm-rg moe-theme
json-mode multiple-cursors
less-css-mode nix-mode
lsp-mode nixpkgs-fmt
lsp-ui org-bullets
magit org-roam
markdown-mode #org-roam-server
moe-theme pasp-mode
multiple-cursors pdf-tools
nix-mode projectile
nixpkgs-fmt projectile-ripgrep
org-bullets rustic
org-roam spacemacs-theme
#org-roam-server solarized-theme
pasp-mode sparql-mode
pdf-tools sudo-edit
projectile use-package
projectile-ripgrep #vscode-dark-plus-theme
rustic yaml-mode
spacemacs-theme yasnippet
solarized-theme #zenburn-theme
sparql-mode ] ++ (with lpkgs; [ org-roam-ui ligatures ])));
sudo-edit
use-package
#vscode-dark-plus-theme
yaml-mode
yasnippet
#zenburn-theme
]
++ (with lpkgs; [
org-roam-ui
ligatures
])));
in { in {
options.elss.programs.emacs.enable = mkEnableOption "Setup emacs package and install it"; options.elss.programs.emacs.enable =
mkEnableOption "Setup emacs package and install it";
config = mkIf config.elss.programs.emacs.enable { config = mkIf config.elss.programs.emacs.enable {
services.emacs = { services.emacs = {
enable = true; enable = true;