nixos-config/user/app/doom-emacs/doom.nix

152 lines
4.2 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, pkgs-emacs, pkgs-stable, inputs, userSettings, systemSettings, ... }:
2023-06-04 21:22:24 +05:30
let
themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+userSettings.theme)+"/polarity.txt"));
dashboardLogo = ./. + "/nix-" + themePolarity + ".webp";
2023-06-04 21:22:24 +05:30
in
2023-05-16 04:48:59 +05:30
{
imports = [
inputs.nix-doom-emacs.hmModule
../git/git.nix
../../shell/sh.nix
../../shell/cli-collection.nix
];
2023-05-16 04:48:59 +05:30
programs.doom-emacs = {
enable = true;
emacsPackage = pkgs-emacs.emacs29-pgtk;
2023-05-16 04:48:59 +05:30
doomPrivateDir = ./.;
# This block from https://github.com/znewman01/dotfiles/blob/be9f3a24c517a4ff345f213bf1cf7633713c9278/emacs/default.nix#L12-L34
# Only init/packages so we only rebuild when those change.
doomPackageDir = let
filteredPath = builtins.path {
path = ./.;
name = "doom-private-dir-filtered";
filter = path: type:
builtins.elem (baseNameOf path) [ "init.el" "packages.el" ];
};
in pkgs-emacs.linkFarm "doom-packages-dir" [
{
name = "init.el";
path = "${filteredPath}/init.el";
}
{
name = "packages.el";
path = "${filteredPath}/packages.el";
}
{
name = "config.el";
path = pkgs-emacs.emptyFile;
}
];
# End block
2023-05-16 04:48:59 +05:30
};
2023-05-16 04:48:59 +05:30
home.file.".emacs.d/themes/doom-stylix-theme.el".source = config.lib.stylix.colors {
template = builtins.readFile ./themes/doom-stylix-theme.el.mustache;
extension = ".el";
};
home.packages = (with pkgs-emacs; [
2024-07-20 22:04:21 +05:30
emacs-lsp-booster
nil
nixfmt
kotlin-language-server
file
wmctrl
jshon
aria
hledger
hunspell hunspellDicts.en_US-large
(pkgs-emacs.mu.override { emacs = emacs29-pgtk; })
2024-08-10 03:40:51 +05:30
(pkgs.callPackage ./pkgs/org-analyzer.nix {})
emacsPackages.mu4e
isync
msmtp
(python3.withPackages (p: with p; [
pandas
requests
2024-02-18 20:53:57 +05:30
epc lxml
pysocks
pymupdf
markdown
]))
2024-02-18 20:53:57 +05:30
]) ++ (with pkgs-stable; [
nodejs
nodePackages.mermaid-cli
]) ++ (with pkgs; [
openssl
stunnel
2024-02-18 20:53:57 +05:30
]);
2023-12-22 07:56:08 +05:30
services.mbsync = {
enable = true;
package = pkgs-stable.isync;
frequency = "*:0/5";
};
2023-09-23 22:24:14 +05:30
home.file.".emacs.d/org-yaap" = {
source = "${inputs.org-yaap}";
2023-09-23 22:24:14 +05:30
recursive = true;
};
2023-10-06 01:27:44 +05:30
home.file.".emacs.d/org-side-tree" = {
source = "${inputs.org-side-tree}";
2023-10-06 01:27:44 +05:30
recursive = true;
};
home.file.".emacs.d/org-timeblock" = {
source = "${inputs.org-timeblock}";
recursive = true;
};
home.file.".emacs.d/org-nursery" = {
source = "${inputs.org-nursery}";
};
2024-04-03 09:43:28 +05:30
home.file.".emacs.d/org-krita" = {
source = "${inputs.org-krita}";
2024-04-03 09:43:28 +05:30
};
home.file.".emacs.d/org-xournalpp" = {
source = "${inputs.org-xournalpp}";
};
2024-04-14 01:31:22 +05:30
home.file.".emacs.d/org-sliced-images" = {
source = "${inputs.org-sliced-images}";
2024-04-14 01:31:22 +05:30
};
2024-06-26 01:25:20 +05:30
home.file.".emacs.d/magit-file-icons" = {
source = "${inputs.magit-file-icons}";
};
home.file.".emacs.d/dashboard-logo.webp".source = dashboardLogo;
2023-06-16 04:57:06 +05:30
home.file.".emacs.d/scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh" = {
source = ./scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh;
executable = true;
};
home.file.".emacs.d/phscroll" = {
source = "${inputs.phscroll}";
};
2024-04-02 07:39:55 +05:30
home.file.".emacs.d/mini-frame" = {
source = "${inputs.mini-frame}";
2024-04-02 07:39:55 +05:30
};
home.file.".emacs.d/system-vars.el".text = ''
;;; ~/.emacs.d/config.el -*- lexical-binding: t; -*-
;; Import relevant variables from flake into emacs
(setq user-full-name "''+userSettings.name+''") ; name
(setq user-username "''+userSettings.username+''") ; username
(setq user-mail-address "''+userSettings.email+''") ; email
(setq user-home-directory "/home/''+userSettings.username+''") ; absolute path to home directory as string
(setq user-default-roam-dir "''+userSettings.defaultRoamDir+''") ; absolute path to home directory as string
(setq system-nix-profile "''+systemSettings.profile+''") ; what profile am I using?
(setq system-wm-type "''+userSettings.wmType+''") ; wayland or x11?
(setq doom-font (font-spec :family "''+userSettings.font+''" :size 20)) ; import font
(setq dotfiles-dir "''+userSettings.dotfilesDir+''") ; import location of dotfiles directory
'';
2023-05-16 04:48:59 +05:30
}