-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
228 lines (205 loc) · 6.06 KB
/
home.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
{ pkgs, ... }:
{
home.stateVersion = "22.11";
programs.home-manager.enable = true;
home.sessionVariables = {
EDITOR = "code";
# Just keep copy of ./etc-nix files in .config/nix since nix.settings and nix.extraOptions refuse to work
# FIXME 1/2024 - Settings in `darwin.nix` get applied to /etc/nix/nix.conf before this changes?
NIX_CONF_DIR = "$HOME/.config/nix";
};
##### Home-Manager Configurable Packages ###############################################################
programs.bash = {
enable = true;
profileExtra = builtins.readFile ./bash_profile;
initExtra = builtins.readFile ./bashrc;
## Per https://github.com/nix-community/home-manager/issues/3133#issuecomment-1320315536
# turn off the automated completion injection
enableCompletion = false;
# manually import completions using `-z` to check if it's been loaded instead of `-v`
bashrcExtra = ''
if [[ -z BASH_COMPLETION_VERSINFO ]]; then
. "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh"
fi
'';
## Per https://github.com/nix-community/home-manager/blob/bb4b25b302dbf0f527f190461b080b5262871756/modules/programs/bash.nix#L86
# Modify default option set to remove macOS-incompatible options
shellOptions = [
# Append to history file rather than replacing it.
"histappend"
# check the window size after each command and, if
# necessary, update the values of LINES and COLUMNS.
"checkwinsize"
# Extended globbing.
"extglob"
# "globstar" # unavailable on macOS
# Warn if closing shell with running jobs.
# "checkjobs" # unavailable on macOS
];
};
programs.direnv.enable = true;
programs.direnv = {
enableBashIntegration = true;
nix-direnv.enable = true;
};
programs.eza = {
enable = true;
};
programs.fzf = {
enable = true;
enableBashIntegration = true;
};
programs.git = {
enable = true;
includes = [{ path = "~/.config/nixpkgs/gitconfig"; }];
};
programs.jq.enable = true;
# Settings adapted from https://github.com/the-argus/nixsys/blob/74ee1dd0ac503e241581ee8c3d7b719fa4305e1e/user/primary/lf.nix#L46
programs.lf = {
enable = true;
settings = {
drawbox = true;
dirfirst = true;
icons = true;
ignorecase = true;
preview = true;
# shell = "${pkgs.dash}/bin/dash";
# shellopts = "-eu";
# tabstop = 2;
# info = "size";
};
# previewer = {
# source = sandbox;
# keybinding = "i";
# };
};
programs.neovim.enable = true;
programs.neovim = {
defaultEditor = false;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraPackages = [ ];
extraPython3Packages = ps: [ ];
plugins = [ ];
};
programs.nix-index.enable = true;
programs.nix-index = {
enableBashIntegration = true;
};
programs.pylint.enable = true;
programs.pylint = {
settings = { };
};
programs.vscode = {
enable = true;
enableUpdateCheck = false;
userSettings = {
"editor" = {
"fontSize" = 18;
"formatOnPaste" = true;
"tabSize" = 2;
"rulers" = [ 100 ];
};
"files.trimTrailingWhitespace" = true;
"markdown.preview.doubleClickToSwitchToEditor" = false;
"markdown.preview.openMarkdownLinks" = "inEditor";
"[markdown]" = {
"editor.unicodeHighlight.allowedCharacters" = {
"’" = true;
};
"editor.wordWrap" = "on";
};
"[nix]" = {
"editor.defaultFormatter" = "jnoortheen.nix-ide";
};
"nix.enableLanguageServer" = true; # Enable LSP.
"nix.serverPath" = "nil";
"nix.serverSettings" = {
"nil" = {
# "diagnostics" = {
# "ignored" = [ "unused_binding" "unused_with" ];
# };
"formatting" = {
"command" = [ "nixpkgs-fmt" ];
};
};
};
"window.titleBarStyle" = "native";
};
extensions = with pkgs.vscode-extensions; [
# Nix
bbenoist.nix
jnoortheen.nix-ide
# arrterian.nix-env-selector
# Haskell
haskell.haskell
# Python
ms-python.python
# ms-python.vscode-pylance # FIXME - allowUnfree
# Documentation
yzhang.markdown-all-in-one
# Configuration
tamasfe.even-better-toml
# Theme
# Tooling
eamodio.gitlens
# General
]
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
# Automatically load environments with direnv
name = "direnv";
publisher = "mkhl";
version = "0.14.0";
sha256 = "sha256-T+bt6ku+zkqzP1gXNLcpjtFAevDRiSKnZaE7sM4pUOs=";
}
{
# Mypy
name = "mypy";
publisher = "matangover";
version = "0.2.2";
sha256 = "sha256-eaiR30HjPCpOLUKQqiQ2Oqj+XY+JNnV47bM5KD2Mouk=";
}
{
# Prettier JS formatter
name = "prettier-vscode";
publisher = "esbenp";
version = "9.10.4";
sha256 = "sha256-khtyB0Qbm+iuM1GsAaF32YRv1VBTIy7daeCKdgwCIC8=";
}
{
# Pretty Typescript Errors
name = "pretty-ts-errors";
publisher = "yoavbls";
version = "0.4.1";
sha256 = "sha256-vY/dVO9k3LcXLYH9eX9blKMB+mDGCWkmU9ZU62YvAcM=";
}
{
# Run python doctests inline like HLS
name = "python-inline-repl";
publisher = "zijie";
version = "0.0.1";
sha256 = "sha256-rn/ZR5OgDaxAGB+Q0FJ3Vx1VIAVosoZq1A5z+hptiI0=";
}
{
# Documentation with Zeal (linux kapeli/Dash.app alternetive)
name = "vscode-dash"; # configure in vscode's settings.json through nix
publisher = "deerawan";
version = "2.4.0";
sha256 = "sha256-Yqn59ppNWQRMWGYVLLWofogds+4t/WRRtSSfomPWQy4=";
}
{
# Language support for MDX
name = "vscode-mdx";
publisher = "unifiedjs";
version = "1.3.0";
sha256 = "sha256-TfqSU9V5vG7GwxEihUdEGC19VFHEUjlrTg+XXHdOYn4=";
}
];
};
programs.zoxide = {
enable = true;
enableBashIntegration = true;
};
}