-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
62 lines (58 loc) · 2.15 KB
/
flake.nix
File metadata and controls
62 lines (58 loc) · 2.15 KB
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
{
description = "Reusable NixEmacs Configuration Module";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
hoon-mode = pkgs.stdenvNoCC.mkDerivation {
pname = "hoon-mode";
version = "latest";
src = pkgs.fetchFromGitHub {
owner = "urbit";
repo = "hoon-mode.el";
#rev = "main";
rev = "master";
sha256 = "sha256-gOmh3+NxAIUa2VcmFFqavana8r6LT9VmnrJOFLCF/xw=";
};
dontBuild = true;
installPhase = ''
mkdir -p $out/share/emacs/site-lisp
cp hoon-mode.el hoon-dictionary.json $out/share/emacs/site-lisp/
'';
};
# Standalone nixmacs builder (duplicate logic from module.nix)
nixmacs = pkgs.writeShellScriptBin "nixmacs" ''
exec ${pkgs.emacs.pkgs.withPackages (epkgs: with epkgs; [
use-package color-theme-sanityinc-tomorrow company emms
fancy-dabbrev lsp-mode lsp-ui markdown-mode multi-term
multiple-cursors nix-buffer nix-mode rainbow-mode rust-mode
rustic wttrin hydra all-the-icons haskell-mode arduino-mode
flycheck gruvbox-theme bongo impatient-mode simple-httpd
compat xelb nickel-mode iedit anzu visual-regexp try sudo-edit
hoon-mode pdf-tools magit beacon doom-modeline vim-tab-bar
] ++ [
# Add your custom derivations here if needed
])}/bin/emacs "$@"
'';
in {
packages.nixmacs = nixmacs;
apps.nixmacs = {
type = "app";
program = "${nixmacs}/bin/nixmacs";
meta = {
description = "NixMacs - custom Emacs build for NixOS";
mainProgram = "nixmacs";
};
};
}) // {
homeManagerModules.default = import ./module.nix;
homeManagerModules.nixMacs = self.homeManagerModules.default;
};
}