aboutsummaryrefslogtreecommitdiff
path: root/home-manager/programs/emacs/default.nix
blob: 920a42c4da9eb2213382057ebf34715c78be5b61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{ pkgs, ... }:
let
  pkgsForEmacs = with pkgs; [
    tree-sitter
    gcc
    cmake
    nodePackages_latest.bash-language-server
    gnumake
    tdlib
    emacs-all-the-icons-fonts
    libappindicator
    libwebp
    tgs2png
    pkg-config
    ffmpeg_6-full
    rustc
    cargo
    rust-analyzer
    nodejs_20
  ];
  pythonPkgs = with pkgs.python311Packages; [
    flake8
    python-lsp-server
    autopep8
    matplotlib
  ];
  
  pkgsUsePackage = with pkgs; [
    (pkgs.emacsWithPackagesFromUsePackage {
      package = pkgs.emacs29-pgtk;
      config = ./init.el;
      alwaysEnsure = true;
      extraEmacsPackages = epkgs: [
        epkgs.use-package
        (epkgs.melpaBuild rec {
          pname = "codeium";
          version = "1.2.102";

          src = fetchFromGitHub {
            owner = "Exafunction";
            repo = "codeium.el";
            rev = "1.4.4";
            sha256 = "1jjix7fn73ihjnhfivf72wris72f4kwf7xb6k5hxs41fm4kr9hdd";
          };

          commit = "ddc9927ea231ecc5a32f7c9905f92fdfb7912e75";

          recipe = writeText "recipe" ''
          (codeium
            :repo "${src.owner}/${src.repo}"
            :fetcher github)
          '';
        })
        # (epkgs.melpaBuild rec {
        #   pname = "orgnote";
        #   version = "0.7.17";

        #   src = fetchFromGitHub {
        #     owner = "Artawower";
        #     repo = "orgnote.el";
        #     rev = "v${version}";
        #     sha256 = "1lrj47h244z4dqq2wyhpww7p3b4sy6bayk8lwlka517lhbcdgh33";
        #   };

        #   commit = "ccc40cc346ebf5a6e6a55e3d4a147f0230337350";
          
        #   recipe = writeText "recipe" ''
        #   (orgnote
        #     :repo "${src.owner}/${src.repo}"
        #     :fetcher github)
        #   '';
        # })
      ];
    })
  ];
in
{
  home.packages = pkgsForEmacs ++ pkgsUsePackage ++ pythonPkgs;
  xdg.configFile = {
    # "emacs/init.el".text = builtins.readFile ./init.el;
    "emacs/early-init.el".text = builtins.readFile ./early-init.el;
  };
}