/
flake.nix
193 lines (161 loc) · 6.14 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
{
description = "Brian's Dotfiles";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-21.05";
nixos-hardware.url = "github:NixOS/nixos-hardware";
home-manager.url = "github:nix-community/home-manager/release-21.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
naersk.url = "github:nix-community/naersk";
naersk.inputs.nixpkgs.follows = "nixpkgs-unstable";
similar-sort.url =
"git+https://git.bytes.zone/brian/similar-sort.git?ref=main";
similar-sort.inputs.nixpkgs.follows = "nixpkgs";
similar-sort.inputs.naersk.follows = "naersk";
tree-grepper.url = "github:BrianHicks/tree-grepper";
tree-grepper.inputs.nixpkgs.follows = "nixpkgs-unstable";
tree-grepper.inputs.naersk.follows = "naersk";
tmux = {
url = "github:tmux/tmux";
flake = false;
};
fzf-tab = {
url = "github:Aloxaf/fzf-tab";
flake = false;
};
comma = {
url = "github:shopify/comma";
flake = false;
};
# kakoune plugins
active-window = {
url = "github:greenfork/active-window.kak";
flake = false;
};
kak-subvert = {
url = "github:dmerejkowsky/kak-subvert";
flake = false;
};
kakoune-auto-percent = {
url = "github:Delapouite/kakoune-auto-percent";
flake = false;
};
kakoune-find = {
url = "github:occivink/kakoune-find";
flake = false;
};
kakoune-idris = {
url = "github:stoand/kakoune-idris";
flake = false;
};
kakoune-surround = {
url = "github:h-youhei/kakoune-surround";
flake = false;
};
shellcheck-kak = {
url = "github:whereswaldon/shellcheck.kak";
flake = false;
};
smarttab-kak = {
url = "github:andreyorst/smarttab.kak";
flake = false;
};
tug = {
url = "github:matthias-margush/tug";
flake = false;
};
};
outputs = inputs:
let
mkOverlays = system: [
inputs.similar-sort.overlay."${system}"
inputs.tree-grepper.overlay."${system}"
(final: prev:
let
naersk = inputs.naersk.lib."${system}";
# kak-tree uses submodules. I don't know how to get Nix to fetch
# those in a flake, so we source with fetchgit instead, all wrapped
# up in this package. I'd love to move it to a real flake, though,
# so things would be all in one place!
kak-tree = final.callPackage ./pkgs/kak-tree { inherit naersk; };
in {
comma = final.callPackage inputs.comma { };
# is this going to cause problems by not actually being a package?
fzf-tab = inputs.fzf-tab;
git-gclone = final.callPackage ./pkgs/git-gclone { };
kak-session = final.callPackage ./pkgs/kak-session { };
kak-subvert = naersk.buildPackage inputs.kak-subvert;
kak-tree = kak-tree.kak-tree;
kakounePlugins = let
buildKakounePlugin = name: input:
final.kakouneUtils.buildKakounePlugin {
pname = name;
version = input.rev;
src = input;
};
in prev.kakounePlugins // {
active-window =
buildKakounePlugin "active-window" inputs.active-window;
kak-ayu = final.callPackage ./pkgs/kak-ayu { };
kak-subvert = buildKakounePlugin "kak-subvert" inputs.kak-subvert;
kak-tree = kak-tree.kakounePlugins.kak-tree;
kakoune-auto-percent = buildKakounePlugin "kakoune-auto-percent"
inputs.kakoune-auto-percent;
kakoune-find =
buildKakounePlugin "kakoune-find" inputs.kakoune-find;
kakoune-idris = final.kakouneUtils.buildKakounePlugin {
name = "kakoune-idris";
version = inputs.kakoune-idris.rev;
src = inputs.kakoune-idris;
patches = [
(builtins.fetchurl {
url =
"https://patch-diff.githubusercontent.com/raw/stoand/kakoune-idris/pull/9.patch";
sha256 =
"sha256:1hwrn4hqji4qi4bxrzvccxcaq9gkd0cmyra3jl8zzaqplh6m7jyn";
})
];
};
kakoune-surround =
buildKakounePlugin "kakoune-surround" inputs.kakoune-surround;
shellcheck-kak =
buildKakounePlugin "shellcheck.kak" inputs.shellcheck-kak;
smarttab-kak =
buildKakounePlugin "smarttab.kak" inputs.smarttab-kak;
tug = buildKakounePlugin "tug" inputs.tug;
};
lazygit-window = final.callPackage ./pkgs/lazygit-window { };
tmux = prev.tmux.overrideAttrs (attrs:
attrs // {
src = inputs.tmux;
version = inputs.tmux.rev;
# macOS does some weird stuff with locales and character widths.
# Practically, that means that without extra support tmux will
# behave weirdly around multi-byte characters like emoji. Enabling
# utf8proc support should backfill the right tables so that tmux
# can get the correct character widths.
buildInputs = attrs.buildInputs ++ [ prev.utf8proc ];
configureFlags = attrs.configureFlags
++ [ "--enable-utf8proc" ];
});
tmux-session = final.callPackage ./pkgs/tmux-session { };
})
];
in {
nixosConfigurations.torch = inputs.nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
({ ... }: { nixpkgs.overlays = mkOverlays system; })
(import ./machines/torch inputs)
inputs.home-manager.nixosModules.home-manager
];
};
nixosConfigurations.vbox-dev = inputs.nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
({ ... }: { nixpkgs.overlays = mkOverlays system; })
(import ./machines/vbox-dev inputs)
inputs.home-manager.nixosModules.home-manager
];
};
};
}