From 06ed0f1d527805905a5dd565252a9b9cd483dbb2 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 12 Sep 2023 08:33:05 +0100 Subject: [PATCH] Add doom-emacs using nix directly Keep config as separate repo for rapid iteration Restore Makefile --- Makefile | 7 +++ flake.lock | 17 ++++++ flake.nix | 4 ++ home/emacs/default.nix | 118 ++++++++++++++++++++++------------------- 4 files changed, 92 insertions(+), 54 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..ace602b8 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +.PHONY: test build + +test: + sudo nixos-rebuild test --flake . + +build: + sudo nixos-rebuild build --flake . diff --git a/flake.lock b/flake.lock index 0d1226b9..0f33f6fd 100644 --- a/flake.lock +++ b/flake.lock @@ -112,6 +112,22 @@ "type": "github" } }, + "doom-emacs": { + "flake": false, + "locked": { + "lastModified": 1694469381, + "narHash": "sha256-W2igPoy27chZrM8DYtnQ3d8WavrdHMYuX+Ez4DXdMZs=", + "owner": "doomemacs", + "repo": "doomemacs", + "rev": "a44e8d6bfd06e8746030eb1f2e6d3a200a2f4682", + "type": "github" + }, + "original": { + "owner": "doomemacs", + "repo": "doomemacs", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -206,6 +222,7 @@ "catppuccin-hyprland": "catppuccin-hyprland", "catppuccin-zathura": "catppuccin-zathura", "catppuccin-zsh": "catppuccin-zsh", + "doom-emacs": "doom-emacs", "home-manager": "home-manager", "hyprland": "hyprland", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index c096bcce..472bd537 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,10 @@ }; # Non-flake inputs + doom-emacs = { + url = "github:doomemacs/doomemacs"; + flake = false; + }; wallpapers = { url = "git+https://git.xenia.me.uk/xenia/wallpapers.git"; flake = false; diff --git a/home/emacs/default.nix b/home/emacs/default.nix index 36008536..3ea9d263 100644 --- a/home/emacs/default.nix +++ b/home/emacs/default.nix @@ -1,60 +1,70 @@ -{ pkgs, ... }: - -{ +{ pkgs, inputs, ... }: +let + sessionVariables = { + DOOMLOCALDIR = "$HOME/.local/share/doomemacs"; + DOOMPROFILELOADFILE = "$HOME/.local/share/doomemacs/profiles/load.el"; + }; +in { imports = [ ../accounts/default.nix ../git/default.nix ]; + xdg.configFile.emacs.source = inputs.doom-emacs; + systemd.user = { inherit sessionVariables; }; programs.emacs.enable = true; - home.packages = with pkgs; [ - # Emacs dependencies - ripgrep - coreutils - cmake - fd - graphviz - zip - unzip + home = { + inherit sessionVariables; + sessionPath = [ "${inputs.doom-emacs}/bin" ]; + packages = with pkgs; [ + # Emacs dependencies + ripgrep + coreutils + cmake + fd + graphviz + zip + unzip - # Language-specific requirements - ispell - findutils - sqlite - pandoc - gfortran - texlive.combined.scheme-medium - imagemagick - python3 - isort - python3Packages.cython - python3Packages.pyflakes - python3Packages.nose - python3Packages.pytest - nodePackages.stylelint + # Language-specific requirements + ispell + findutils + sqlite + pandoc + gfortran + texlive.combined.scheme-medium + imagemagick + python3 + isort + python3Packages.cython + python3Packages.pyflakes + python3Packages.nose + python3Packages.pytest + nodePackages.stylelint - # Formatters - nixfmt - beautysh - black - nodePackages.fixjson - fprettify - shellharden - shfmt - stylua - python3Packages.mdformat - html-tidy - nodePackages.js-beautify + # Formatters + nixfmt + beautysh + black + nodePackages.fixjson + fprettify + shellharden + shfmt + stylua + python3Packages.mdformat + html-tidy + nodePackages.js-beautify - # LSP servers - nixd - fortls - shellcheck - marksman - luajitPackages.lua-lsp - texlab - nodePackages.pyright - nodePackages.yaml-language-server - nodePackages.bash-language-server - nodePackages.vscode-html-languageserver-bin - nodePackages.vscode-css-languageserver-bin - nodePackages.vscode-json-languageserver-bin - nodePackages.dockerfile-language-server-nodejs - ]; + # LSP servers + nixd + fortls + shellcheck + marksman + luajitPackages.lua-lsp + texlab + nodePackages.pyright + nodePackages.yaml-language-server + nodePackages.bash-language-server + nodePackages.vscode-html-languageserver-bin + nodePackages.vscode-css-languageserver-bin + nodePackages.vscode-json-languageserver-bin + nodePackages.dockerfile-language-server-nodejs + ]; + }; }