-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
129 lines (119 loc) · 4.45 KB
/
flake.nix
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{
description = "emacs configurations";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
emacs-overlay.url = "github:nix-community/emacs-overlay";
# emacs-ng = {
# url = "github:emacs-ng/emacs-ng";
# inputs.emacs-overlay.follows = "emacs-overlay";
# }; # emacs with some wacky things like web rendering. also rust
};
outputs = {
self,
nixpkgs,
flake-utils,
emacs-overlay,
# emacs-ng,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
emacs-overlay.overlays.default
#emacs-ng.overlays.default
]; # gets emacs and package overlays
};
propogatedBuildInputs = [
#runtime deps
pkgs.tree-sitter-grammars.tree-sitter-elisp
(pkgs.python3.withPackages (p:
# I think this works for lsp-bridge
with p; [
epc
orjson
sexpdata
six
setuptools
paramiko
]))
pkgs.emacs-lsp-booster
pkgs.python3
pkgs.tetex
pkgs.plantuml
];
# ] ++ with pkgs.python311Packages [
# epc
# orjson
# sexpdata
# six
# setuptools
# paramiko
# rapidfuzz
# ];
in {
packages."emacs" = pkgs.stdenv.mkDerivation {
name = "emacs";
src = self.packages.${system}.emacsUnwrapped;
buildPhase = ''
mkdir $out
cp -r * $out/
'';
buildInputs = propogatedBuildInputs;
};
packages.default = self.packages.${system}."emacs";
devShells.default = pkgs.mkShell {
packages = propogatedBuildInputs;
};
packages.emacsUnwrapped = pkgs.emacsWithPackagesFromUsePackage {
# Your Emacs config file. Org mode babel files are also
# supported.
# NB: Config files cannot contain unicode characters, since
# they're being parsed in nix, which lacks unicode
# support.
# config = ./emacs.org;
config = ./emacs.el;
# Whether to include your config as a default init file.
# If being bool, the value of config is used.
# Its value can also be a derivation like this if you want to do some
# substitution:
# defaultInitFile = pkgs.substituteAll {
# name = "default.el";
# src = ./emacs.el;
# inherit (config.xdg) configHome dataHome;
# };
defaultInitFile = true;
# Package is optional, defaults to pkgs.emacs
# package = pkgs.emacsngWRPgtk; #emacs-ng build
package = pkgs.emacs-pgtk; # bleeding edge pgtk
# package = pkgs.emacs29-pgtk; # stable latest release pgtk
# By default emacsWithPackagesFromUsePackage will only pull in
# packages with `:ensure`, `:ensure t` or `:ensure <package name>`.
# Setting `alwaysEnsure` to `true` emulates `use-package-always-ensure`
# and pulls in all use-package references not explicitly disabled via
# `:ensure nil` or `:disabled`.
# Note that this is NOT recommended unless you've actually set
# `use-package-always-ensure` to `t` in your config.
alwaysEnsure = true;
# For Org mode babel files, by default only code blocks with
# `:tangle yes` are considered. Setting `alwaysTangle` to `true`
# will include all code blocks missing the `:tangle` argument,
# defaulting it to `yes`.
# Note that this is NOT recommended unless you have something like
# `#+PROPERTY: header-args:emacs-lisp :tangle yes` in your config,
# which defaults `:tangle` to `yes`.
# alwaysTangle = true;
# Optionally provide extra packages not in the configuration file.
extraEmacsPackages = epkgs: [
#epkgs => pkgs.emacsPackages namespace in nix
epkgs.vterm # this supposedly neesd to go here. Maybe due to external library issues?
epkgs.treesit-grammars.with-all-grammars
epkgs.use-package
epkgs.jinx # needs libenchant
epkgs.lsp-bridge # just in case
];
};
}
);
}