-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
212 lines (177 loc) · 4.64 KB
/
default.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/* Main user-level configuration */
{ config, lib, pkgs, ... }:
let
secrets = import ./secrets;
modules = import ../lib/modules.nix {inherit lib;};
in
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
# sometimes it is useful to pin a version of some tool or program.
# this can be done in "overlays/pinned.nix"
(import ../overlays/pinned.nix)
];
# Flakes are not standard yet, but widely used, enable them.
xdg.configFile."nix/nix.conf".text = ''
experimental-features = nix-command flakes
'';
imports = [
# Programs to install
./packages.nix
# everything for work
./work
] ++ (modules.importAllModules ./modules);
# secureEnv.onePassword = {
# enable = true;
# sessionVariables = {
# GITHUB_TOKEN = {
# vault = "Private";
# item = "Github Token";
# field = "password";
# };
# };
# };
# Home Manager needs a bit of information about you and the
# paths it should manage.
home = {
username = config.user.name;
homeDirectory = config.user.home;
wallpaper.file = ./config/wallpaper/drwho-macos.jpeg;
sessionVariables = {
EDITOR = "vim";
};
sessionPath = [
];
keyboard = {
enableKeyMapping = true;
remapCapsLockToControl = true;
};
};
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
# fonts
(nerdfonts.override { fonts = [ "FiraCode" "FiraMono" "FantasqueSansMono" ]; })
];
programs = {
lazygit.enable = true;
bat.enable = true;
navi.enable = true;
jq.enable = true;
htop.enable = true;
bottom.enable = true;
vim.enable = true;
broot.enable = true; # better tree
skim = {
enable = true;
};
eza = {
enable = true;
extraOptions = [
"--group-directories-first"
"--header"
];
};
direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
fzf = {
enable = true;
enableZshIntegration = true;
enableBashIntegration = true;
};
lf.enable = true;
};
# services.colima = {
# enable = false;
# config = {
# cpu = 4;
# memory = 4;
# };
# };
tools = {
aws.enable = true;
dotnet.enable = true;
skim.enable = true;
# Comparable to jq / yq, but supports JSON, YAML, TOML, XML and CSV with zero runtime dependencies.
dasel = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
git = {
enable = true;
userName = secrets.github.fullName;
userEmail = secrets.github.userEmail;
githubUser = secrets.github.userName;
};
};
### ZSH (TODO: Maybe Mmve to a module?)
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
# history.extended = true;
# this is to workaround zsh syntax highlighting slowness on copy/paste
# https://github.com/zsh-users/zsh-syntax-highlighting/issues/295#issuecomment-214581607
initExtra = ''
zstyle ':bracketed-paste-magic' active-widgets '.self-*'
'';
shellAliases = {
whereis = "function _whereis() { which \"$1\" | xargs realpath; }; _whereis";
};
plugins = [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "powerlevel10k-config";
src = lib.cleanSource ./config/p10k;
file = "p10k-classic.zsh";
}
];
oh-my-zsh = {
enable = true;
plugins = [
"aws"
"dirhistory"
"docker-compose"
"git-extras"
"git"
"gitfast"
"github"
"z"
];
# theme = "robbyrussell";
};
};
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "21.05";
targets.darwin.defaults = {
NSGlobalDomain = {
AppleShowAllExtensions = true;
InitialKeyRepeat = 20;
KeyRepeat = 2;
};
"com.apple.desktopservices" = {
DSDontWriteNetworkStores = true;
DSDontWriteUSBStores = true;
};
"com.apple.driver.AppleBluetoothMultitouch.mouse" = {
MouseButtonMode = "TwoButton";
};
};
}