/
flake.nix
165 lines (130 loc) · 4.7 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 = "Brian's Dotfiles";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
nixos-hardware.url = "github:NixOS/nixos-hardware";
darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
naersk.url = "github:nix-community/naersk";
naersk.inputs.nixpkgs.follows = "nixpkgs";
nix-index.url = "github:bennofs/nix-index";
nix-index.inputs.nixpkgs.follows = "nixpkgs";
tree-grepper.url = "github:BrianHicks/tree-grepper";
xbar-pr-status.url = "github:BrianHicks/xbar-pr-status";
xbar-pr-status.inputs.nixpkgs.follows = "nixpkgs";
xbar-pr-status.inputs.naersk.follows = "naersk";
xbar-review-request-status.url =
"github:BrianHicks/xbar-review-request-status";
xbar-review-request-status.inputs.nixpkgs.follows = "nixpkgs";
xbar-review-request-status.inputs.naersk.follows = "naersk";
comma = {
url =
"github:nix-community/comma/54149dc417819af14ddc0d59216d4add5280ad14";
flake = false;
};
fzf-tab = {
url = "github:Aloxaf/fzf-tab";
flake = false;
};
spoons = {
url = "github:Hammerspoon/Spoons";
flake = false;
};
sysz = {
url = "github:joehillen/sysz";
flake = false;
};
};
outputs = inputs:
let
mkOverlays = system: [
inputs.tree-grepper.overlay."${system}"
inputs.xbar-pr-status.overlay."${system}"
inputs.xbar-review-request-status.overlay."${system}"
(final: prev:
let
naersk = inputs.naersk.lib."${system}";
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 { };
home-manager = inputs.home-manager.packages.${system}.home-manager;
hammerspoon.spoons = final.stdenv.mkDerivation {
name = "spoons";
rev = inputs.spoons.rev;
src = inputs.spoons;
buildPhase = "true";
installPhase = ''
mkdir -p $out
cp -r Source/* $out
'';
};
lazygit-window = final.callPackage ./pkgs/lazygit-window { };
mand = final.writeShellScriptBin "mand" ''
${final.pandoc}/bin/pandoc -s -f markdown -t man $1 | ${final.groff}/bin/groff -T utf8 -man | ${final.less}/bin/less
'';
meet = final.callPackage ./pkgs/meet { };
# nix-index = inputs.nix-index.packages.${system}.nix-index;
sysz = final.stdenv.mkDerivation {
name = "sysz";
src = inputs.sysz;
buildPhase = "true";
buildInputs = [ final.makeWrapper ];
installPhase = ''
mkdir -p $out/bin
install -m755 sysz $out/bin
wrapProgram $out/bin/sysz --prefix PATH : ${
final.lib.makeBinPath [ final.fzf ]
}
'';
};
tmux-session = final.callPackage ./pkgs/tmux-session { };
# tree-grepper tests pass most of the time, but sometimes the nixpkgs
# between that repo and this one cause clippy incompatibilities. The
# tests are run in CI anyway, so there's no need to re-run them here.
tree-grepper =
prev.tree-grepper.overrideAttrs (attrs: { doCheck = false; });
})
];
in
{
darwinConfigurations.VNDR-A535 = inputs.darwin.lib.darwinSystem rec {
inherit inputs;
system = "aarch64-darwin";
modules = [
({ pkgs, ... }: { nixpkgs.overlays = mkOverlays system; })
./machines/VNDR-A535
inputs.home-manager.darwinModules.home-manager
];
};
darwinConfigurations.birch = inputs.darwin.lib.darwinSystem rec {
inherit inputs;
system = "aarch64-darwin";
modules = [
({ pkgs, ... }: { nixpkgs.overlays = mkOverlays system; })
./machines/birch
inputs.home-manager.darwinModules.home-manager
];
};
} // inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import inputs.nixpkgs {
inherit system;
overlays = mkOverlays system;
};
in
{
formatter = pkgs.nixpkgs-fmt;
devShell = pkgs.mkShell {
packages = [
pkgs.home-manager
];
};
}
);
}