/
flake.nix
150 lines (118 loc) · 4.46 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
{
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";
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:
{
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
{
homeConfigurations.brianhicks = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs rec {
system = "aarch64-darwin";
overlays = mkOverlays system;
};
modules = [ ./home.nix ];
};
} // inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import inputs.nixpkgs {
inherit system;
# we need overlays even in the dev-shell home-manager because we want
# to use the exact home-manager version from the flake, not whatever
# one happens to be upstream in nixpkgs.
overlays = mkOverlays system;
};
in
{
formatter = pkgs.nixpkgs-fmt;
devShell = pkgs.mkShell {
packages = [
pkgs.home-manager
];
FLAKE_CONFIG_URI = "/Users/brianhicks/code/BrianHicks/dotfiles.nix#homeConfigurations.brianhicks";
};
}
);
}