2023-10-13 07:19:37 +05:30
|
|
|
{ config, lib, pkgs, eaf, eaf-browser, org-nursery, phscroll, org-yaap, org-side-tree, org-timeblock, theme, font, name, username, email, dotfilesDir, profile, wmType, defaultRoamDir, ... }:
|
2023-06-04 21:22:24 +05:30
|
|
|
let
|
2023-06-23 01:23:10 +05:30
|
|
|
themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+theme)+"/polarity.txt"));
|
|
|
|
dashboardLogo = ./. + "/nix-" + themePolarity + ".png";
|
2023-06-04 21:22:24 +05:30
|
|
|
in
|
2023-05-16 04:48:59 +05:30
|
|
|
{
|
|
|
|
programs.doom-emacs = {
|
|
|
|
enable = true;
|
2023-08-14 23:48:42 +05:30
|
|
|
emacsPackage = pkgs.emacs29-pgtk;
|
2023-05-16 04:48:59 +05:30
|
|
|
doomPrivateDir = ./.;
|
2023-06-15 01:18:04 +05:30
|
|
|
# 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.linkFarm "doom-packages-dir" [
|
|
|
|
{
|
|
|
|
name = "init.el";
|
|
|
|
path = "${filteredPath}/init.el";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "packages.el";
|
|
|
|
path = "${filteredPath}/packages.el";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "config.el";
|
|
|
|
path = pkgs.emptyFile;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
# End block
|
2023-05-16 04:48:59 +05:30
|
|
|
};
|
2023-06-11 09:34:03 +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";
|
|
|
|
};
|
2023-06-11 09:34:03 +05:30
|
|
|
|
2023-05-20 06:55:57 +05:30
|
|
|
home.packages = with pkgs; [
|
2023-07-28 04:10:51 +05:30
|
|
|
nil
|
|
|
|
nixfmt
|
2023-05-20 06:55:57 +05:30
|
|
|
git
|
2023-06-16 04:57:06 +05:30
|
|
|
file
|
2023-05-20 06:55:57 +05:30
|
|
|
nodejs
|
|
|
|
wmctrl
|
|
|
|
jshon
|
|
|
|
aria
|
2023-06-02 07:48:06 +05:30
|
|
|
hledger
|
2023-06-11 09:34:03 +05:30
|
|
|
hunspell hunspellDicts.en_US-large
|
|
|
|
pandoc
|
2023-06-02 07:48:06 +05:30
|
|
|
nodePackages.mermaid-cli
|
2023-05-20 06:55:57 +05:30
|
|
|
(python3.withPackages (p: with p; [
|
|
|
|
pandas
|
|
|
|
requests
|
|
|
|
pyqt6 sip qtpy qt6.qtwebengine epc lxml pyqt6-webengine
|
|
|
|
pysocks
|
|
|
|
pymupdf
|
|
|
|
markdown
|
|
|
|
]))];
|
2023-06-11 09:34:03 +05:30
|
|
|
|
|
|
|
home.sessionVariables = {
|
|
|
|
EDITOR = "emacsclient";
|
|
|
|
};
|
|
|
|
|
2023-05-20 06:55:57 +05:30
|
|
|
home.file.".emacs.d/eaf" = {
|
|
|
|
source = "${eaf}";
|
|
|
|
recursive = true;
|
|
|
|
};
|
2023-09-23 22:24:14 +05:30
|
|
|
|
|
|
|
home.file.".emacs.d/org-yaap" = {
|
|
|
|
source = "${org-yaap}";
|
|
|
|
recursive = true;
|
|
|
|
};
|
|
|
|
|
2023-10-06 01:27:44 +05:30
|
|
|
home.file.".emacs.d/org-side-tree" = {
|
|
|
|
source = "${org-side-tree}";
|
|
|
|
recursive = true;
|
|
|
|
};
|
|
|
|
|
2023-10-13 07:19:37 +05:30
|
|
|
home.file.".emacs.d/org-timeblock" = {
|
|
|
|
source = "${org-timeblock}";
|
|
|
|
recursive = true;
|
|
|
|
};
|
|
|
|
|
2023-05-20 06:55:57 +05:30
|
|
|
home.file.".emacs.d/eaf/app/browser" = {
|
|
|
|
source = "${eaf-browser}";
|
|
|
|
recursive = true;
|
|
|
|
onChange = "
|
|
|
|
pushd ~/.emacs.d/eaf/app/browser;
|
2023-05-20 07:21:12 +05:30
|
|
|
rm package*.json;
|
|
|
|
npm install darkreader @mozilla/readability && rm package*.json;
|
2023-05-20 06:55:57 +05:30
|
|
|
popd;
|
|
|
|
";
|
|
|
|
};
|
2023-10-13 07:19:37 +05:30
|
|
|
|
2023-06-04 09:42:31 +05:30
|
|
|
home.file.".emacs.d/org-nursery" = {
|
|
|
|
source = "${org-nursery}";
|
|
|
|
};
|
2023-10-13 07:19:37 +05:30
|
|
|
|
2023-06-23 01:23:10 +05:30
|
|
|
home.file.".emacs.d/dashboard-logo.png".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;
|
|
|
|
};
|
2023-10-13 07:19:37 +05:30
|
|
|
|
2023-08-27 02:28:45 +05:30
|
|
|
home.file.".emacs.d/phscroll" = {
|
|
|
|
source = "${phscroll}";
|
|
|
|
};
|
2023-10-13 07:19:37 +05:30
|
|
|
|
2023-08-27 19:51:09 +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 "''+name+''") ; name
|
2023-09-03 08:45:50 +05:30
|
|
|
(setq user-username "''+username+''") ; username
|
2023-08-27 19:51:09 +05:30
|
|
|
(setq user-mail-address "''+email+''") ; email
|
|
|
|
(setq user-home-directory "/home/''+username+''") ; absolute path to home directory as string
|
2023-09-17 21:44:45 +05:30
|
|
|
(setq user-default-roam-dir "''+defaultRoamDir+''") ; absolute path to home directory as string
|
2023-08-27 19:51:09 +05:30
|
|
|
(setq system-nix-profile "''+profile+''") ; what profile am I using?
|
|
|
|
(setq system-wm-type "''+wmType+''") ; wayland or x11?
|
|
|
|
(setq doom-font (font-spec :family "''+font+''" :size 20)) ; import font
|
|
|
|
(setq dotfiles-dir "''+dotfilesDir+''") ; import location of dotfiles directory
|
|
|
|
'';
|
2023-05-16 04:48:59 +05:30
|
|
|
}
|