-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.nix
247 lines (229 loc) · 5.84 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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
{
config,
pkgs,
self,
jujutsu-latest,
vim-jjdescription,
...
}:
let
vim-jjdescription-plugin = pkgs.vimUtils.buildVimPlugin {
name = "vim-jjdescription";
src = vim-jjdescription;
};
gnome-extensions = with pkgs.gnomeExtensions; [ appindicator ];
# https://github.com/NixOS/nixpkgs/issues/348868
citrix-workspace-override = (
pkgs.citrix_workspace.override {
libvorbis = pkgs.libvorbis.override {
libogg = pkgs.libogg.overrideAttrs (prevAttrs: {
cmakeFlags = (prevAttrs.cmakeFlags or [ ]) ++ [
(pkgs.lib.cmakeBool "BUILD_SHARED_LIBS" true)
];
});
};
}
);
# Use new fish completions
jujutsu-override = jujutsu-latest.packages.${pkgs.system}.jujutsu.overrideAttrs (
{ postInstall, ... }:
{
postInstall =
postInstall
+ ''
installShellCompletion --cmd jj \
--bash <(echo 'source <(COMPLETE=bash jj)') \
--fish <(echo 'source (COMPLETE=fish jj | psub)')
'';
}
);
in
{
home.username = "scott";
home.homeDirectory = "/home/scott";
dconf = {
enable = true;
settings = {
"org/gnome/desktop/input-sources" = {
xkb-options = [ "caps:escape" ];
};
"org/gnome/shell" = {
disable-user-extensions = false;
enabled-extensions = builtins.map (ext: ext.extensionUuid) gnome-extensions;
};
};
};
nixpkgs.config.allowUnfree = true;
home.packages =
(with pkgs; [
anki-bin
bat
citrix-workspace-override
difftastic
discord
fd
fzf
gcc
ghc
gnumake
inkscape
jq
jujutsu-override
libreoffice
megasync
nixd
nodejs_22
python3
ripgrep
rustup
self.packages.${pkgs.system}.zoom-us-old
signal-desktop
spotify
vscode
xclip # Required for neovim clipboard
zip
])
++ gnome-extensions;
xdg.configFile = {
"jj/config.toml".source = ./jjconfig.toml;
};
home.file = {
# Required to have correct cursor in Alacritty
".icons/default/index.theme".text = ''
[icon theme]
Inherits=Adwaita
'';
};
programs = {
alacritty = {
enable = true;
settings = {
terminal.shell = "${pkgs.fish}/bin/fish";
window = {
dimensions.columns = 120;
dimensions.lines = 36;
padding.x = 3;
padding.y = 3;
};
};
};
direnv = {
enable = true;
nix-direnv.enable = true;
config = {
hide_env_diff = true;
warn_timeout = "0s"; # Disable warning
};
};
firefox.enable = true;
fish = {
enable = true;
functions = {
fish_greeting = ''
${./update-reminder.fish}
'';
fish_prompt = ''
set -l last_status $status
if test -n "$SHLVL" && test "$SHLVL" -gt 1
set_color $fish_color_param
echo -n "[$SHLVL] "
end
if test $last_status -eq 0
set_color green
else if test $last_status -eq 141
set_color yellow
else
set_color brred
end
echo -n (basename $PWD)
set_color normal
echo -n ' $ '
'';
dotfiles-update = ''
cd ~/dotfiles
echo "Updating channel..."
sudo nix-channel --update
echo "Updating flake..."
nix flake update
os-switch
hm-switch
echo "Showing status..."
jj st
echo "Remember to commit these changes!"
'';
os-switch = ''
echo "Switching NixOS..."
sudo nixos-rebuild switch --flake ~/dotfiles
'';
hm-switch = ''
echo "Collecting garbage..."
nix-collect-garbage --delete-older-than 7d
echo "Switching home-manager..."
home-manager switch --flake ~/dotfiles
'';
vimdiff = "nvim -d $argv";
};
};
git = {
enable = true;
userName = "Scott Taylor";
userEmail = "scott11x8@gmail.com";
ignores = [
"*~"
"*.swp"
".direnv"
".envrc"
"_i" # Directory for temporary files
];
};
gpg.enable = true;
home-manager.enable = true;
java.enable = true;
neovim = {
enable = true;
defaultEditor = true;
plugins = with pkgs.vimPlugins; [
papercolor-theme
vim-argumentative
vim-commentary
vim-indent-object
vim-javascript
vim-jjdescription-plugin
vim-jsx-pretty
vim-nix
vim-repeat
vim-surround
];
extraConfig = ''
source ${./vimrc.vim}
" Wait to enable theme until plugins loaded
augroup nixinitgroup
autocmd!
autocmd VimEnter * colorscheme PaperColor
augroup END
'';
viAlias = true;
vimAlias = true;
};
zed-editor = {
enable = true;
extensions = ["html" "toml" "make" "nix"];
userSettings = builtins.fromJSON (builtins.readFile ./zed/settings.json);
userKeymaps = builtins.fromJSON (builtins.readFile ./zed/keymap.json);
};
};
# Start megasync automatically
services.megasync.enable = true;
systemd.user.services.megasync = {
# Need to add sleep, otherwise it crashes
Service.ExecStartPre = "${pkgs.coreutils}/bin/sleep 30";
};
# 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 should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "24.05"; # Please read the comment before changing.
}