mirror of
https://github.com/materusPL/nixos-config
synced 2026-07-02 12:46:42 +00:00
configuration: changes to emacs and others
This commit is contained in:
@@ -32,8 +32,21 @@
|
||||
# keyMap = "pl";
|
||||
useXkbConfig = true; # use xkbOptions in tty.
|
||||
};
|
||||
services.xserver.layout = "pl";
|
||||
services.xserver.extraLayouts.hyper-pl = {
|
||||
description = "PL, hyper mod3";
|
||||
languages = [ "pol" ];
|
||||
symbolsFile = pkgs.writeText "hyper-pl" ''
|
||||
xkb_symbols "hyper-pl"
|
||||
{
|
||||
include "pl(basic)"
|
||||
name[Group1]="Polish HYPR";
|
||||
|
||||
modifier_map Mod3 { <HYPR> };
|
||||
};'';
|
||||
};
|
||||
|
||||
services.xserver.layout = "hyper-pl";
|
||||
services.xserver.xkbOptions = "caps:hyper";
|
||||
services.xserver.enable = true;
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
services.dbus.enable = true;
|
||||
@@ -52,7 +65,7 @@
|
||||
xdg.portal.wlr.enable = true;
|
||||
xdg.portal.xdgOpenUsePortal = true;
|
||||
|
||||
services.xserver.exportConfiguration = true;
|
||||
services.xserver.exportConfiguration = false;
|
||||
services.xserver.extraConfig = pkgs.lib.mkDefault ''
|
||||
Section "OutputClass"
|
||||
Identifier "amd-options"
|
||||
@@ -117,6 +130,7 @@
|
||||
XDG_CONFIG_HOME = "\${HOME}/.config";
|
||||
XDG_BIN_HOME = "\${HOME}/.local/bin";
|
||||
XDG_DATA_HOME = "\${HOME}/.local/share";
|
||||
QT_XKB_CONFIG_ROOT = "\${XKB_CONFIG_ROOT}";
|
||||
GTK_IM_MODULE="fcitx";
|
||||
QT_IM_MODULE="fcitx";
|
||||
XMODIFIERS="@im=fcitx";
|
||||
@@ -193,6 +207,7 @@
|
||||
};*/
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
firefox
|
||||
gamescope
|
||||
#(pkgs.lutris.override { extraLibraries = pkgs: with pkgs; [ pkgs.samba pkgs.jansson pkgs.tdb pkgs.libunwind pkgs.libusb1 pkgs.gnutls pkgs.gtk3 pkgs.pango ]; })
|
||||
@@ -204,7 +219,6 @@
|
||||
gtk4
|
||||
gsettings-desktop-schemas
|
||||
libsForQt5.dolphin
|
||||
|
||||
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
|
||||
patchelf
|
||||
|
||||
@@ -1,20 +1,7 @@
|
||||
{ config, lib, pkgs, materusArg, ... }:
|
||||
let
|
||||
cfg = config.materus.profile.editor.emacs;
|
||||
configPath = "${materusArg.cfg.path}" + "/extraFiles/config/emacs/";
|
||||
emacsPkgs = with pkgs;[
|
||||
python3
|
||||
lua
|
||||
];
|
||||
in
|
||||
{
|
||||
options.materus.profile.editor.emacs.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable emacs with materus cfg";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.emacs = {
|
||||
enable = true;
|
||||
package = with pkgs; lib.mkDefault (if pkgs ? emacs-pgtk then emacs-pgtk else emacs29-gtk);
|
||||
extraPackages = epkgs: with epkgs; [
|
||||
packages = epkgs: with epkgs; [
|
||||
load-relative
|
||||
elcord
|
||||
persp-mode
|
||||
dashboard
|
||||
@@ -25,6 +12,8 @@ in
|
||||
vterm
|
||||
centaur-tabs
|
||||
projectile
|
||||
company
|
||||
clipetty
|
||||
|
||||
treemacs
|
||||
treemacs-nerd-icons
|
||||
@@ -39,11 +28,16 @@ in
|
||||
perspective
|
||||
minions
|
||||
telephone-line
|
||||
rainbow-delimiters
|
||||
use-package
|
||||
|
||||
lsp-mode
|
||||
lsp-bridge
|
||||
dap-mode
|
||||
d-mode
|
||||
|
||||
multiple-cursors
|
||||
org
|
||||
org-rainbow-tags
|
||||
markdown-mode
|
||||
json-mode
|
||||
nix-mode
|
||||
@@ -51,18 +45,95 @@ in
|
||||
minimap
|
||||
moe-theme
|
||||
];
|
||||
extraConfig = ''
|
||||
;;;; Set emacs PATH
|
||||
|
||||
(setenv "PATH" (concat (getenv "PATH") ":${lib.makeBinPath emacsPkgs}"))
|
||||
${builtins.concatStringsSep "\n" (builtins.map (x: "(setq exec-path (append exec-path '(\""+x+"/bin\")))" ) emacsPkgs)}
|
||||
|
||||
;;;; Done setting PATH
|
||||
|
||||
;;;; Config
|
||||
${builtins.readFile (configPath + "config.el")}
|
||||
;;;; Config End
|
||||
'';
|
||||
|
||||
default-config = ''
|
||||
(defvar materus/nix-packages t)
|
||||
(defvar materus/init-from-home nil)
|
||||
(defvar materus/init-from-default nil)
|
||||
(when (not materus/init-from-home)
|
||||
(setq-default materus/init-from-default t)
|
||||
(message "Config loading not from homeDir, need "materus/init-from-home" variable in init.el")
|
||||
${setNixInit}
|
||||
(require 'materus-config)
|
||||
)
|
||||
'';
|
||||
|
||||
|
||||
|
||||
materus-config = epkgs: epkgs.trivialBuild rec {
|
||||
pname = "materus-config";
|
||||
src = pkgs.symlinkJoin {
|
||||
name = "materus-emacs-config";
|
||||
paths = [
|
||||
configPath
|
||||
];
|
||||
};
|
||||
version = "1.0";
|
||||
packageRequires = (packages epkgs);
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
emacs -L . --batch -f batch-byte-compile **/*.el
|
||||
emacs -L . --batch -f batch-byte-compile *.el
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
LISPDIR=$out/share/emacs/site-lisp
|
||||
install -d $LISPDIR
|
||||
install **.el **.elc $LISPDIR
|
||||
cp -r materus $LISPDIR
|
||||
emacs --batch -l package --eval "(package-generate-autoloads \"${pname}\" \"$LISPDIR\")"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
|
||||
cfg = config.materus.profile.editor.emacs;
|
||||
configPath = "${materusArg.cfg.path}" + "/extraFiles/config/emacs/";
|
||||
emacsPkgs = with pkgs;[
|
||||
python3
|
||||
lua
|
||||
multimarkdown
|
||||
git
|
||||
];
|
||||
setNixInit = ''
|
||||
(setenv "PATH" (concat (getenv "PATH") ":${lib.makeBinPath emacsPkgs}"))
|
||||
${builtins.concatStringsSep "\n" (builtins.map (x: "(setq exec-path (append exec-path '(\""+x+"/bin\")))" ) emacsPkgs)}
|
||||
(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)
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.materus.profile.editor.emacs.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable emacs with materus cfg";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
xdg.configFile."emacs/init.el".text = ''
|
||||
(defvar materus/nix-packages nil)
|
||||
(defvar materus/init-from-home t)
|
||||
(defvar materus/init-from-default nil)
|
||||
${setNixInit}
|
||||
(setq-default materus/init-from-home t)
|
||||
(setq-default materus/nix-packages (require 'materus-config nil 'noerror))
|
||||
(when (not materus/nix-packages)
|
||||
(load (concat user-emacs-directory "materus/init"))
|
||||
(message "Config loaded from user dir")
|
||||
)
|
||||
'';
|
||||
xdg.configFile."emacs/materus" = {
|
||||
source = configPath + "materus";
|
||||
recursive = true;
|
||||
};
|
||||
programs.emacs = {
|
||||
enable = true;
|
||||
package = with pkgs; lib.mkDefault (emacs29.override { withX = true; withGTK3 = true; withAlsaLib = true; withGconf = true; withImageMagick = true; withXwidgets = true; });
|
||||
extraPackages = epkgs: ((packages epkgs) ++ [(materus-config epkgs)]);
|
||||
extraConfig = default-config;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user