materusPC: plasma-manager and emacs updates

This commit is contained in:
Mateusz Słodkowicz 2024-10-28 16:31:39 +01:00
parent a69b24ac89
commit 1154c45291
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
8 changed files with 131 additions and 141 deletions

View File

@ -17,7 +17,7 @@
enableTerminal = lib.mkDefault true; enableTerminal = lib.mkDefault true;
enableTerminalExtra = lib.mkDefault true; enableTerminalExtra = lib.mkDefault true;
enableNixDevel = lib.mkDefault true; enableNixDevel = lib.mkDefault true;
editor.emacs.enable = false; editor.emacs.enable = true;
editor.code.fhs.enable = true; editor.code.fhs.enable = true;
editor.code.fhs.packages = (ps: with ps; let llvmpkgs = llvmPackages_18; in [ editor.code.fhs.packages = (ps: with ps; let llvmpkgs = llvmPackages_18; in [
llvmpkgs.clang llvmpkgs.clang

View File

@ -44,6 +44,7 @@
shortcuts = { shortcuts = {
"kwin"."Grid View" = "Meta+Alt+Tab"; "kwin"."Grid View" = "Meta+Alt+Tab";
"kwin"."Overview" = "Meta+Tab"; "kwin"."Overview" = "Meta+Tab";
"services/org.kde.kcalc.desktop"."_launch" = [ ];
}; };
spectacle.shortcuts = { spectacle.shortcuts = {
captureActiveWindow = "Meta+Print"; captureActiveWindow = "Meta+Print";

View File

@ -26,6 +26,7 @@
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
kdePackages.ark kdePackages.ark
kdePackages.kcalc
]; ];
programs.kdeconnect.enable = true; programs.kdeconnect.enable = true;
materus.profile.steam.extraPkgs = [ pkgs.kdePackages.breeze pkgs.kdePackages.breeze-gtk pkgs.kdePackages.dolphin pkgs.vlc pkgs.vkbasalt-cli ]; materus.profile.steam.extraPkgs = [ pkgs.kdePackages.breeze pkgs.kdePackages.breeze-gtk pkgs.kdePackages.dolphin pkgs.vlc pkgs.vkbasalt-cli ];

View File

@ -2,127 +2,122 @@
let let
configPath = "${materusArg.cfg.path}" + "/extraFiles/config/emacs/"; configPath = "${materusArg.cfg.path}" + "/extraFiles/config/emacs/";
inits = import ./init.nix { path = configPath; inherit pkgs; }; inits = import ./init.nix {
packages = epkgs: with epkgs; [ path = configPath;
load-relative inherit pkgs;
elcord };
persp-mode packages = epkgs:
dashboard with epkgs; [
magit load-relative
helm elcord
avy persp-mode
corfu dashboard
vterm magit
centaur-tabs helm
projectile avy
company corfu
clipetty vterm
centaur-tabs
projectile
company
clipetty
treemacs treemacs
treemacs-nerd-icons treemacs-nerd-icons
treemacs-perspective treemacs-perspective
treemacs-icons-dired treemacs-icons-dired
treemacs-magit treemacs-magit
treemacs-projectile treemacs-projectile
tree-edit tree-edit
vertico vertico
nerd-icons nerd-icons
nerd-icons-completion nerd-icons-completion
perspective perspective
minions minions
telephone-line telephone-line
rainbow-delimiters rainbow-delimiters
use-package use-package
cmake-mode cmake-mode
lsp-mode lsp-mode
lsp-java lsp-java
lsp-jedi lsp-jedi
lsp-haskell lsp-haskell
lsp-ui lsp-ui
lsp-treemacs lsp-treemacs
dap-mode dap-mode
d-mode d-mode
multiple-cursors multiple-cursors
org org
org-rainbow-tags org-rainbow-tags
org-roam org-roam
org-roam-ui org-roam-ui
org-review org-review
markdown-mode markdown-mode
json-mode json-mode
nix-mode nix-mode
no-littering
minimap
moe-theme
doom-themes
];
moe-theme
doom-themes
];
default-config = '' default-config = ''
(defvar materus/nix-packages t) ${setNixInit}
(defvar materus/init-from-home nil) ${inits.initText}
(unless materus/init-from-home
(message "Config loading not from homeDir, need \"materus/init-from-home\" variable in init.el")
${setNixInit}
${inits.initText}
)
''; '';
emacsPkgs = with pkgs;[ emacsPkgs = with pkgs; [ python3 lua multimarkdown git ];
python3
lua
multimarkdown
git
];
cfg = config.materus.profile.editor.emacs; cfg = config.materus.profile.editor.emacs;
setNixInit = '' setNixInit = ''
(setenv "PATH" (concat (getenv "PATH") ":${lib.makeBinPath emacsPkgs}")) (setenv "PATH" (concat (getenv "PATH") ":${lib.makeBinPath emacsPkgs}"))
${builtins.concatStringsSep "\n" (builtins.map (x: "(setq exec-path (append exec-path '(\""+x+"/bin\")))" ) emacsPkgs)} ${builtins.concatStringsSep "\n" (builtins.map
(call-process-shell-command "${pkgs.xorg.xmodmap}/bin/xmodmap -e \"keycode 66 = Hyper_L\" -e \"remove Mod4 = Hyper_L\" -e \"add Mod3 = Hyper_L\" &" nil 0) (x: ''(setq exec-path (append exec-path '("'' + x + ''/bin")))'')
emacsPkgs)}
(call-process-shell-command "${pkgs.xorg.xmodmap}/bin/xmodmap -e \"keycode 148 = Hyper_L\" -e \"remove Mod4 = Hyper_L\" -e \"add Mod3 = Hyper_L\" &" nil 0)
''; '';
in in {
{ options.materus.profile.editor.emacs.enable =
options.materus.profile.editor.emacs.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable emacs with materus cfg"; materusArg.pkgs.lib.mkBoolOpt false "Enable emacs with materus cfg";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.activation.emacsCompile = lib.hm.dag.entryAfter [ "linkGeneration" ] '' home.activation.emacsCompile = lib.hm.dag.entryAfter [ "linkGeneration" ] ''
mkdir -p ${config.xdg.configHome}/emacs/var/backups
mkdir -p ${config.xdg.configHome}/emacs/var/recovery
mkdir -p ${config.xdg.configHome}/emacs/etc
run ${config.programs.emacs.finalPackage}/bin/emacs --batch \ run ${config.programs.emacs.finalPackage}/bin/emacs --batch \
--eval '(setq warning-minimum-log-level :error)' \ --eval '(setq warning-minimum-log-level :error)' \
--eval '(byte-compile-file "${config.xdg.configHome}/emacs/early-init.el")' \ --eval '(byte-compile-file "${config.xdg.configHome}/emacs/early-init.el")' \
--eval '(byte-compile-file "${config.xdg.configHome}/emacs/init.el")' --eval '(byte-compile-file "${config.xdg.configHome}/emacs/init.el")'
''; '';
xdg.configFile."emacs/init.el".text = ''
(defvar materus/nix-packages nil)
(defvar materus/init-from-home t)
(setq-default materus/init-from-home t)
${setNixInit}
${inits.initText}
'';
xdg.configFile."emacs/early-init.el".text = '' xdg.configFile."emacs/early-init.el".text = ''
${inits.earlyInitText} ${inits.earlyInitText}
''; '';
xdg.configFile."emacs/init.el".text =''
(require 'recentf)
(require 'no-littering)
(add-to-list 'recentf-exclude
(recentf-expand-file-name no-littering-var-directory))
(add-to-list 'recentf-exclude
(recentf-expand-file-name no-littering-etc-directory))
'';
programs.emacs = { programs.emacs = {
enable = true; enable = true;
package = with pkgs; lib.mkDefault (pkgs.emacs29.override { package = with pkgs;
withSQLite3 = true; lib.mkDefault (pkgs.emacs29.override {
withWebP = true; withSQLite3 = true;
withX = true; withWebP = true;
withGTK3 = true; withX = true;
withAlsaLib = true; withGTK3 = true;
withGconf = true; withAlsaLib = true;
withImageMagick = true; withGconf = true;
withXwidgets = true; withImageMagick = true;
}); withXwidgets = true;
});
extraPackages = epkgs: ((packages epkgs)); extraPackages = epkgs: ((packages epkgs));
extraConfig = default-config; extraConfig = default-config;
}; };

View File

@ -5,13 +5,8 @@
${builtins.readFile (path + "early-init.el")} ${builtins.readFile (path + "early-init.el")}
''; '';
initText = '' initText = ''
(defvar materus/init-from-home nil) (require 'doom-themes nil 'noerror)
(when materus/init-from-home ${builtins.readFile (path + "init.el")}
(setq-default inhibit-defaul-init 1)
)
(setq-default materus/nix-packages (require 'doom-themes nil 'noerror))
${builtins.readFile (path + "packages.el")}
${builtins.readFile (path + "init.el")}
''; '';
} }

View File

@ -26,3 +26,10 @@
) )
) )
) )
(when (and (fboundp 'startup-redirect-eln-cache)
(fboundp 'native-comp-available-p)
(native-comp-available-p))
(startup-redirect-eln-cache
(convert-standard-filename
(expand-file-name "var/eln-cache/" user-emacs-directory))))

View File

@ -26,16 +26,30 @@
) )
) )
) )
(setq auto-save-list-file-prefix (concat user-emacs-directory "backups/"))
(setq backup-directory-alist
`(("." . ,(concat user-emacs-directory "backups/"))))
(setq custom-file (concat user-emacs-directory "etc/custom.el"))
(setq auto-save-default nil)
(setq backup-directory-alist
`((".*" . ,(concat user-emacs-directory "var/backups/"))))
(setq auto-save-file-name-transforms
`((".*" ,(concat user-emacs-directory "var/recovery/") t)))
; Load packages
(require 'telephone-line) (require 'telephone-line)
(require 'elcord) (require 'elcord)
(require 'dashboard) (require 'dashboard)
(require 'minions) (require 'minions)
(require 'doom-themes) (require 'doom-themes)
(require 'nerd-icons)
(require 'centaur-tabs)
(require 'projectile)
(require 'treemacs)
(require 'treemacs-projectile)
(require 'treemacs-nerd-icons)
;Graphical ;Graphical
(setq frame-resize-pixelwise t) (setq frame-resize-pixelwise t)
@ -46,7 +60,6 @@
(setq read-process-output-max (* 1024 1024 3)) (setq read-process-output-max (* 1024 1024 3))
(setq custom-file (concat user-emacs-directory "custom.el"))
(when (or (not (display-graphic-p)) (daemonp)) (when (or (not (display-graphic-p)) (daemonp))
(xterm-mouse-mode 1) (xterm-mouse-mode 1)
) )
@ -79,18 +92,29 @@
;Enable dashboard ;Enable dashboard
(setq dashboard-center-content t) (setq dashboard-center-content t)
(setq dashboard-display-icons-p t)
(setq dashboard-icon-type 'nerd-icons)
(dashboard-setup-startup-hook) (dashboard-setup-startup-hook)
(when (daemonp) (when (daemonp)
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))) ; Show dashboard when emacs is running as daemon (setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))) ; Show dashboard when emacs is running as daemon
) )
;Enable Centaur tabs
(centaur-tabs-mode t)
(setq centaur-tabs-set-bar 'over)
(setq centaur-tabs-set-modified-marker t)
;(setq centaur-tabs-modified-marker "*")
;Enable treemacs
(global-set-key (kbd "C-H-t") 'treemacs)
;CUA ;CUA
(cua-mode 1) (cua-mode 1)
(global-set-key (kbd "C-y") 'undo-redo) (global-set-key (kbd "C-y") 'undo-redo)
;(define-key key-translation-map [8711] 'event-apply-hyper-modifier )
(define-key key-translation-map (kbd "<XF86Calculator>") 'event-apply-hyper-modifier )
(define-key key-translation-map (kbd "<Calculator>") 'event-apply-hyper-modifier )
;(global-set-key (kbd "C-∇") (kbd "C-H")) ;(global-set-key (kbd "C-∇") (kbd "C-H"))
;(global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207))) ;(global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207)))

View File

@ -1,33 +0,0 @@
(defvar materus/nix-packages nil)
(when (not materus/nix-packages)
(message "Not using config from nix packages, using straight")
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 6))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(declare-function straight-use-package "straight" (&optional ARG))
(straight-use-package 'load-relative)
(straight-use-package 'use-package)
(straight-use-package 'telephone-line)
(straight-use-package 'elcord)
(straight-use-package 'dashboard)
(straight-use-package 'minions)
(straight-use-package 'lsp-mode)
(straight-use-package 'lsp-ui)
(straight-use-package 'moe-theme)
(straight-use-package 'doom-themes)
)