-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
165 lines (145 loc) · 4.06 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
{
description = "My blog, built with Org mode and Hakyll";
inputs = {
emacs-overlay = {
inputs = {
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs-stable";
};
url = "github:nix-community/emacs-overlay";
};
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.follows = "nixpkgs-stable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
pre-commit-hooks-nix = {
inputs = {
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs-stable";
};
url = "github:cachix/git-hooks.nix";
};
treefmt-nix = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:numtide/treefmt-nix";
};
};
outputs = inputs@{ flake-parts, self, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
flake = {
overlays.emacs = _final: prev: {
myEmacs = prev.emacsWithPackagesFromUsePackage {
alwaysEnsure = true;
config = ./emacs.el;
};
};
};
imports = [
inputs.pre-commit-hooks-nix.flakeModule
inputs.treefmt-nix.flakeModule
];
systems = [ "x86_64-linux" ];
perSystem = { config, lib, self', pkgs, system, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
overlays = [
inputs.emacs-overlay.overlay
self.overlays.emacs
];
inherit system;
};
devShells = {
c = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
clang
gcc
];
};
clojure = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
clojure
clojure-lsp
leiningen
];
};
default = pkgs.mkShell {
FONTCONFIG_FILE = pkgs.makeFontsConf {
fontDirectories = [
(pkgs.nerdfonts.override { fonts = [ "Iosevka" ]; })
];
};
inputsFrom = [
config.pre-commit.devShell
] ++
builtins.attrValues
(lib.filterAttrs (name: _: name != "default") self'.devShells);
nativeBuildInputs = with pkgs; [
myEmacs
];
};
erlang = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
erlfmt
erlang-ls
erlang_nox
rebar3
];
};
haskell = pkgs.mkShell {
inputsFrom = [
self'.packages.blorg.env
];
nativeBuildInputs = with pkgs; [
cabal-install
ghc
ghcid
haskell-language-server
] ++ (with haskellPackages; [
hakyll
ormolu
pointfree
]);
};
idris = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
idris
];
};
lilypond = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
lilypond
];
};
lfe = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
];
};
};
packages = {
blorg = pkgs.haskellPackages.developPackage {
root = ./.;
modifier = drv:
pkgs.haskell.lib.addBuildTools drv (with pkgs; [
zlib.dev
zlib.out
]);
};
default = self'.packages.blorg;
};
pre-commit.settings.hooks = {
convco.enable = true;
# FIXME: this is very angry about some generated files
editorconfig-checker.enable = false;
treefmt.enable = true;
};
treefmt = {
projectRootFile = ./flake.nix;
programs = {
deadnix.enable = true;
erlfmt.enable = true;
hlint.enable = true;
nixpkgs-fmt.enable = true;
ormolu.enable = true;
};
};
};
};
}