From b4e392f7ded31195695441115286aef20d305c24 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 12 Dec 2024 07:28:12 +0000 Subject: [PATCH] Add Emacs templates file back Reduced since I don't need to duplicate what's in tempel-collection --- system/home/emacs/default.nix | 15 ++++++++------ system/home/emacs/templates | 39 +++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 system/home/emacs/templates diff --git a/system/home/emacs/default.nix b/system/home/emacs/default.nix index 6fbf9c74..1cba4617 100644 --- a/system/home/emacs/default.nix +++ b/system/home/emacs/default.nix @@ -12,12 +12,15 @@ ../texlive/default.nix ../programming/default.nix ]; - home.file.".emacs.d/early-init.el".text = '' - (setopt use-package-check-before-init t - use-package-enable-imenu-support t - base16-theme-distinct-fringe-background t - base16-theme-highlight-mode-line 'contrast) - ''; + home.file = { + ".emacs.d/templates".source = ./templates; + ".emacs.d/early-init.el".text = '' + (setopt use-package-check-before-init t + use-package-enable-imenu-support t + base16-theme-distinct-fringe-background t + base16-theme-highlight-mode-line 'contrast) + ''; + }; services.emacs = { enable = lib.mkDefault true; package = config.programs.emacs.finalPackage; diff --git a/system/home/emacs/templates b/system/home/emacs/templates new file mode 100644 index 00000000..4ffe016e --- /dev/null +++ b/system/home/emacs/templates @@ -0,0 +1,39 @@ +nix-mode + +(pydefault "let" n + > "pkgs = import " (p "") " { };" n + > "pyproject-nix = import (builtins.fetchGit {" n + > "url = \"https://github.com/pyproject-nix/pyproject.nix.git\";" n + > "}) { inherit (pkgs) lib; };" n + > "python = pkgs." (p "python3") ";" n + > "project = pyproject-nix.lib.project.loadPoetryPyproject { projectRoot = ./.; };" n + "in" n + > "python.pkgs.buildPythonPackage (project.renderers.buildPythonPackage { inherit python; })") +(pyshell "let" n + > "pkgs = import " (p "") " { };" n + > "pyproject-nix = import (builtins.fetchGit {" n + > "url = \"https://github.com/pyproject-nix/pyproject.nix.git\";" n + > "}) { inherit (pkgs) lib; };" n + > "python = pkgs." (p "python3") ";" n + > "project = pyproject-nix.lib.project.loadPoetryPyproject { projectRoot = ./.; };" n + > "extraPackages = (ps: with ps; [" (p "flake8 isort mypy") "]);" n + > "pythonEnv = python3.withPackages (project.renderers.withPackages { inherit python extraPackages; });" n + "in" n + "pkgs.mkShellNoCC {" n + > "packages = [pythonEnv];" n + > "shellHook = ''" n + > "export PYTHONPATH=$(readlink -f " (p "./.") "):$PYTHONPATH" n + > "export MPLBACKEND=" (p "TkAgg") n + > "'';"n + "}") +(sal > "pkgs.fetchFromGitHub {" n + > "owner = \"pixelifytica\";" n + > "repo = \"simple-access-layer\";" n + > "rev = \"7a5d43959cd28d668f92b702e4cd955e27d7b220\";" n + > "hash = \"sha256-soZ1yDd3aVT7icXrifELJygPjNuzl0w26k/WOm5C1Gs=\";" n + > "}") + +;; Local Variables: +;; mode: lisp-data +;; outline-regexp: "[a-z]" +;; End: