Fix emacs config.
This commit is contained in:
parent
ba3a6e74eb
commit
2ce635d028
@ -10,11 +10,9 @@
|
||||
nixpkgs-b93b4e9b5.url = "github:NixOS/nixpkgs/b93b4e9b527904aadf52dba6ca35efde2067cbd4";
|
||||
home-manager.url = "github:nix-community/home-manager/release-24.11";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
emacs-overlay.url = "github:nix-community/emacs-overlay/da2f552d133497abd434006e0cae996c0a282394";
|
||||
emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-b93b4e9b5, impermanence, home-manager, emacs-overlay, ... }@inputs: let
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-b93b4e9b5, impermanence, home-manager, ... }@inputs: let
|
||||
base-system = {};
|
||||
odoqemu = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
|
@ -1,41 +1,68 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
#let
|
||||
# full-emacs = (pkgs.writeScriptBin "emacs" ''
|
||||
# #! ${pkgs.bash}/bin/bash
|
||||
# exec ${pkgs.emacs-gtk}/bin/emacs --init-directory ${./emacs.d} "$@"
|
||||
# '');
|
||||
#in
|
||||
let
|
||||
plainmacs = pkgs.writeShellScriptBin "plainmacs" ''
|
||||
INIT_SCRIPT=$(cat <<EOF
|
||||
(progn
|
||||
(setq make-backup-files nil auto-save-default nil create-lockfiles nil)
|
||||
(load-theme 'tango-dark t)
|
||||
(set-face-attribute 'default nil :background "black")
|
||||
;; Bright yellow highlighting for selected region
|
||||
(set-face-attribute 'region nil :background "#ffff50" :foreground "black")
|
||||
;; Bright green cursor to distinguish from yellow region
|
||||
(set-cursor-color "#ccff66")
|
||||
;; Hightlight the current line
|
||||
(set-face-attribute 'line-number-current-line nil :foreground "white")
|
||||
;; Set default font
|
||||
(set-face-attribute 'default nil :height 100 :width 'regular :weight 'regular :family "Cascadia Mono")
|
||||
;; Set fallback font for unicode glyphs
|
||||
(when (display-graphic-p)
|
||||
(set-fontset-font "fontset-default" nil (font-spec :name "Noto Color Emoji")))
|
||||
(menu-bar-mode -1)
|
||||
(when (fboundp 'tool-bar-mode)
|
||||
(tool-bar-mode -1))
|
||||
(when ( fboundp 'scroll-bar-mode)
|
||||
(scroll-bar-mode -1))
|
||||
(pixel-scroll-precision-mode)
|
||||
(setq frame-resize-pixelwise t)
|
||||
)
|
||||
EOF
|
||||
)
|
||||
|
||||
exec ${pkgs.emacs-gtk}/bin/emacs -q --eval "$INIT_SCRIPT" "''${@}"
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
#(pkgs.symlinkJoin {
|
||||
# name = "emacs";
|
||||
# paths = [
|
||||
# full-emacs
|
||||
# pkgs.emacs-gtk
|
||||
# ];
|
||||
#})
|
||||
|
||||
# (runCommand "default.el" {} ''
|
||||
# mkdir -p $out/share/emacs/site-lisp
|
||||
# cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
|
||||
# '')
|
||||
plainmacs
|
||||
emacs-gtk
|
||||
clang # To compile tree-sitter grammars
|
||||
];
|
||||
|
||||
home-manager.users.talexander = { pkgs, ... }: {
|
||||
home.file.".config/emacs" = {
|
||||
source = ./files/emacs;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
|
||||
#environment.systemPackages = with pkgs; [
|
||||
# (pkgs.emacsWithPackagesFromUsePackage {
|
||||
# package = pkgs.emacsPgtkNativeComp;
|
||||
# config = path/to/your/config.el;
|
||||
environment.persistence."/state" = {
|
||||
hideMounts = true;
|
||||
users.talexander = {
|
||||
directories = [
|
||||
".config/emacs/eln-cache" # Installed packages
|
||||
".config/emacs/elpa" # Installed packages
|
||||
".config/emacs/private" # For recentf
|
||||
".config/emacs/tree-sitter" # Compiled tree-sitter grammars
|
||||
];
|
||||
files = [
|
||||
".config/emacs/history" # For savehist
|
||||
".config/emacs/.last-package-update-day" # For use-package
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# # Optionally provide extra packages not in the configuration file.
|
||||
# # extraEmacsPackages = epkgs: [
|
||||
# # epkgs.use-package;
|
||||
# # ];
|
||||
# })
|
||||
#];
|
||||
|
||||
#nixpkgs.overlays = [ (emacs-overlay) ];
|
||||
environment.variables.EDITOR = "${plainmacs}/bin/plainmacs";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user