diff options
author | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-09-28 11:03:57 -0500 |
---|---|---|
committer | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-09-28 11:03:57 -0500 |
commit | da7a932923fb6ad4110c7ec144cb60ef2b7b2796 (patch) | |
tree | 8013d396da98308f0484a6f7ab64f8c4dea63481 | |
parent | 56e6cb39a09835d120ac9ee879f7c3a57d71ab73 (diff) |
merge emacs into the hive
-rw-r--r-- | Makefile | 29 | ||||
-rw-r--r-- | common/.config/emacs/init.el.org | 25 | ||||
l--------- | nixos/.config/emacs | 1 | ||||
-rw-r--r-- | nixos/.flake/home/programs/core.nix.org | 1 | ||||
-rw-r--r-- | nixos/.flake/home/programs/emacs/core.nix.org | 25 | ||||
-rw-r--r-- | nixos/.flake/home/programs/emacs/feed.org.org (renamed from common/.config/emacs/feed.org.org) | 0 | ||||
-rw-r--r-- | nixos/.flake/home/programs/emacs/force-custom-file.el.org (renamed from common/.config/emacs/force-custom-file.el.org) | 0 | ||||
-rw-r--r-- | nixos/.flake/home/programs/emacs/languages.el.org (renamed from common/.config/emacs/languages.el.org) | 7 | ||||
-rw-r--r-- | nixos/.flake/home/programs/emacs/package-setup.el.org (renamed from common/.config/emacs/package-setup.el.org) | 0 | ||||
-rw-r--r-- | nixos/.flake/home/programs/emacs/tools.el.org (renamed from common/.config/emacs/tools.el.org) | 0 | ||||
-rw-r--r-- | nixos/.flake/home/programs/emacs/user-interface.el.org (renamed from common/.config/emacs/user-interface.el.org) | 0 |
11 files changed, 54 insertions, 34 deletions
@@ -1,20 +1,25 @@ -.PHONY: install update rollback +.PHONY: install update rollback nixos-update nixos-install -SRCDIR = ./nixos +SYSTEM = $(shell uname -n) +SRCDIR = ./$(SYSTEM) DSTDIR = $(HOME) SOURCES := $(shell find -L $(SRCDIR)/ -type f) CONFIGS := $(subst $(SRCDIR)/,$(DSTDIR)/,$(SOURCES:%.org=%)) +UPDATE_TARGET := +INSTALL_TARGET := + +ifeq ($(SYSTEM), nixos) + UPDATE_TARGET += nixos-update + INSTALL_TARGET += nixos-install +endif + all: update -update: install - nix flake update $(DSTDIR)/.flake - cp $(DSTDIR)/.flake/flake.lock $(SRCDIR)/.flake - sudo nixos-rebuild switch --flake $(DSTDIR)/.flake +update: install $(UPDATE_TARGET) -install: $(CONFIGS) - sudo nixos-rebuild switch --flake $(DSTDIR)/.flake +install: $(CONFIGS) $(INSTALL_TARGET) $(DSTDIR)/%: $(SRCDIR)/%.org mkdir -p $(dir $@) @@ -23,3 +28,11 @@ $(DSTDIR)/%: $(SRCDIR)/%.org $(DSTDIR)/%: $(SRCDIR)/% mkdir -p $(dir $@) cp $< $@ + +nixos-update: install + nix flake update $(DSTDIR)/.flake + cp $(DSTDIR)/.flake/flake.lock $(SRCDIR)/.flake + sudo nixos-rebuild switch --flake $(DSTDIR)/.flake + +nixos-install: $(CONFIGS) + sudo nixos-rebuild switch --flake $(DSTDIR)/.flake diff --git a/common/.config/emacs/init.el.org b/common/.config/emacs/init.el.org deleted file mode 100644 index 74566c3..0000000 --- a/common/.config/emacs/init.el.org +++ /dev/null @@ -1,25 +0,0 @@ -#+title: Emacs Configuration -Load [[./force-custom-file.org][force-custom-file.el]] to ensure that =init.el= is not polluted by customizations. -#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el :mkdirp yes - (load "~/.config/emacs/force-custom-file.el") -#+end_src - -Load [[./package-setup.org][package-setup.el]] to allow for package installation. -#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el :mkdirp yes - (load "~/.config/emacs/package-setup.el") -#+end_src - -Load [[./user-interface.org][user-interface.el]] to clean up Emacs' user interface and make it look the way I like. -#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el :mkdirp yes - (load "~/.config/emacs/user-interface.el") -#+end_src - -Load [[./tools.org][tools.el]] to add functionality to Emacs. -#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el :mkdirp yes - (load "~/.config/emacs/tools.el") -#+end_src - -Load [[./languages.org][languages.el]] to add language and language server protocol support. -#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el :mkdirp yes - (load "~/.config/emacs/languages.el") -#+end_src diff --git a/nixos/.config/emacs b/nixos/.config/emacs deleted file mode 120000 index f4e5e56..0000000 --- a/nixos/.config/emacs +++ /dev/null @@ -1 +0,0 @@ -../../common/.config/emacs
\ No newline at end of file diff --git a/nixos/.flake/home/programs/core.nix.org b/nixos/.flake/home/programs/core.nix.org index e42b91f..0e0e8c5 100644 --- a/nixos/.flake/home/programs/core.nix.org +++ b/nixos/.flake/home/programs/core.nix.org @@ -6,6 +6,7 @@ This is the core of my program configuration. This file installs programs that d { imports = [ + ./emacs/core.nix ./fastfetch.nix ./foot.nix ./git.nix diff --git a/nixos/.flake/home/programs/emacs/core.nix.org b/nixos/.flake/home/programs/emacs/core.nix.org new file mode 100644 index 0000000..b1632d9 --- /dev/null +++ b/nixos/.flake/home/programs/emacs/core.nix.org @@ -0,0 +1,25 @@ +#+title: Emacs Configuration + +#+begin_src nix :tangle ~/.flake/home/programs/emacs/core.nix :mkdirp yes + { config, pkgs, ... }: + + { + home.file = { + "./.config/emacs/force-custom-file.el".source = ./force-custom-file.el; + "./.config/emacs/package-setup.el".source = ./package-setup.el; + "./.config/emacs/user-interface.el".source = ./user-interface.el; + "./.config/emacs/tools.el".source = ./tools.el; + "./.config/emacs/languages.el".source = ./languages.el; + }; + programs.emacs = { + enable = true; + extraConfig = '' + (load "~/.config/emacs/force-custom-file.el") + (load "~/.config/emacs/package-setup.el") + (load "~/.config/emacs/user-interface.el") + (load "~/.config/emacs/tools.el") + (load "~/.config/emacs/languages.el") + ''; + }; + } +#+end_src diff --git a/common/.config/emacs/feed.org.org b/nixos/.flake/home/programs/emacs/feed.org.org index d93d32e..d93d32e 100644 --- a/common/.config/emacs/feed.org.org +++ b/nixos/.flake/home/programs/emacs/feed.org.org diff --git a/common/.config/emacs/force-custom-file.el.org b/nixos/.flake/home/programs/emacs/force-custom-file.el.org index 8b8a418..8b8a418 100644 --- a/common/.config/emacs/force-custom-file.el.org +++ b/nixos/.flake/home/programs/emacs/force-custom-file.el.org diff --git a/common/.config/emacs/languages.el.org b/nixos/.flake/home/programs/emacs/languages.el.org index 0c4fe7b..3ee63e0 100644 --- a/common/.config/emacs/languages.el.org +++ b/nixos/.flake/home/programs/emacs/languages.el.org @@ -139,3 +139,10 @@ Install YAML support and run =eglot= on YAML files. :init (add-hook 'yaml-mode-hook 'jj/eglot-setup)) #+end_src + +* Nix +Install =nix= support and run =eglot= on =nix= files. +#+begin_src emacs-lisp :tangle ~/.config/emacs/languages.el :mkdirp yes + (use-package nix-mode + :mode "\\.nix\\'") +#+end_src diff --git a/common/.config/emacs/package-setup.el.org b/nixos/.flake/home/programs/emacs/package-setup.el.org index 6ed238c..6ed238c 100644 --- a/common/.config/emacs/package-setup.el.org +++ b/nixos/.flake/home/programs/emacs/package-setup.el.org diff --git a/common/.config/emacs/tools.el.org b/nixos/.flake/home/programs/emacs/tools.el.org index d52c1b6..d52c1b6 100644 --- a/common/.config/emacs/tools.el.org +++ b/nixos/.flake/home/programs/emacs/tools.el.org diff --git a/common/.config/emacs/user-interface.el.org b/nixos/.flake/home/programs/emacs/user-interface.el.org index ff4bd34..ff4bd34 100644 --- a/common/.config/emacs/user-interface.el.org +++ b/nixos/.flake/home/programs/emacs/user-interface.el.org |