From 79f15beaac11640d2950f6a89435c2625c9b1a90 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 26 Dec 2023 14:53:46 +0400 Subject: [PATCH] lmao --- config/emacs/emacs.org | 8 ++++---- modules/dev/editors/emacs/default.nix | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 0c1434fc..e9ea01c2 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1,5 +1,5 @@ #+title: Sakomacs configuration -#+PROPERTY: header-args:emacs-lisp :tangle yes +#+PROPERTY: header-args:emacs-lisp :tangle yes :tangle init.el * Usage M-x org-bable-tangle * Lexical Binding @@ -90,14 +90,14 @@ Should make startup faster, taken from doom-emacs (require `package) (setq package-archives `(("mepla" . "https://melpa.org/packages/") - ("org" . "https://orgmode.org/elpa/") - ("elpa" . "https://elpa.gnu.org/packages/"))) + ("org" . "https://orgmode.org/elpa/") + ("elpa" . "https://elpa.gnu.org/packages/"))) (package-initialize) (unless package-archive-contents (package-refresh-contents)) - ;; Init package for non-linux + ;; install the thing (unless (package-installed-p `use-package) (package-install `use-package)) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index a00c975f..3e65f013 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -23,12 +23,15 @@ in { services.emacs = { enable = cfg.daemon; install = true; - # package = pkgs.emacs29-pgtk; + # package = pkgs.emacs29-pgtk; package = pkgs.emacsWithPackagesFromUsePackage { config = ../../../../config/emacs/emacs.org; package = pkgs.emacs-pgtk; alwaysEnsure = true; alwaysTangle = true; + extraEmacsPackages = epkgs: [ + epkgs.use-package + ]; }; }; users.users.sako.packages = with pkgs; [ @@ -36,6 +39,19 @@ in { direnv ]; + home-manager.users.sako = {lib, ...}: { + home.file = { + ".emacs.d/init.el".source = pkgs.runCommand "init.el" {} '' + cp ${../../../../config/emacs/emacs.org} emacs.org + ${pkgs.emacs}/bin/emacs -Q --batch ./emacs.org -f org-babel-tangle + mv init.el $out + ''; + + # Create the auto-saves directory + # ".emacs.d/auto-saves/.manage-directory".text = ""; + }; + }; + fonts.packages = with pkgs; [ (nerdfonts.override {fonts = ["JetBrainsMono"];}) jetbrains-mono