-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
48 lines (43 loc) · 1.63 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
{
description = "nano-agenda";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
nano-emacs.url = "github:rougier/nano-emacs";
nano-agenda.url = "github:rougier/nano-agenda";
nano-agenda.flake = false;
};
outputs = { self, nixpkgs, flake-utils, nano-emacs, nano-agenda }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
fonts = pkgs.makeFontsConf {
fontDirectories =
[ pkgs.iosevka pkgs.noto-fonts-emoji pkgs.roboto pkgs.fira-code ];
};
emacs = (pkgs.emacsPackagesFor pkgs.emacs-nox).emacsWithPackages (epkgs: [
(pkgs.runCommand "nano-emacs" { } ''
mkdir -p $out/share/emacs/site-lisp
cp ${nano-emacs}/quick-help.org ${nano-emacs}/*.el $out/share/emacs/site-lisp/
# remove load-path update
sed -e '/load-path/d' -i $out/share/emacs/site-lisp/nano.el
# apply new agenda
cp -f ${nano-agenda}/*.el $out/share/emacs/site-lisp/
'')
epkgs.org-ql
epkgs.magit
epkgs.company
epkgs.markdown-mode
epkgs.nano-agenda
]);
# for regular emacs
emacs-wrapper = pkgs.writeScriptBin "nano-emacs" ''
#!/bin/sh
exec env FONTCONFIG_FILE=${fonts} ${emacs}/bin/.emacs-wrapped --load ${self}/default.el $*
'';
nox-wrapper = pkgs.writeScriptBin "nano-emacs" ''
#!/bin/sh
exec ${emacs}/bin/.emacs-wrapped --load ${self}/default.el $*
'';
in { defaultPackage = nox-wrapper; });
}