/
home.nix
177 lines (161 loc) · 4.04 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
{
pkgs,
lib,
...
}: {
home.stateVersion = "23.11";
programs.direnv.enable = true;
programs.htop.enable = true;
programs.git = {
enable = true;
userName = "Andreas Pelme";
userEmail = "andreas@pelme.se";
aliases = {
done = "!branch=$(git rev-parse --abbrev-ref HEAD); git switch main && git branch -D $branch";
};
extraConfig = {
rerere.enabled = true;
commit.template = "${./git_commit_template.txt}";
push.autosetupremote = true;
push.default = "current";
pull.rebase = true;
diff.noprefix = true;
init.defaultBranch = "main";
branch.sort = "-committerdate";
advice.skippedCherryPicks = false;
# delta
core.pager = "${pkgs.delta}/bin/delta";
interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
delta.navigate = true;
delta.light = false;
merge.conflictstyle = "diff3";
diff.colorMoved = "default";
};
};
programs.sapling = {
enable = true;
userName = "Andreas Pelme";
userEmail = "andreas@pelme.se";
};
programs.fish = {
enable = true;
loginShellInit = ''
# This is needed to workaround the PATH being set in the wrong order.
# https://github.com/LnL7/nix-darwin/issues/122#issuecomment-1030877541
fish_add_path --move --prepend --path $HOME/.nix-profile/bin /run/wrappers/bin /etc/profiles/per-user/$USER/bin /nix/var/nix/profiles/default/bin /run/current-system/sw/bin
set -g fish_greeting
set __done_min_cmd_duration 2000
'';
interactiveShellInit = lib.concatStringsSep "\n" (map builtins.readFile [
./fish/prompt.fish
./fish/abbr.fish
./fish/homebrew.fish
(pkgs.fetchurl {
url = "https://iterm2.com/shell_integration/fish";
hash = "sha256-tdn4z0tIc0nC5nApGwT7GYbiY91OTA4hNXZDDQ6g9qU=";
})
]);
plugins = with pkgs.fishPlugins; [
{
name = "done";
src = done.src;
}
#{name = "grc"; src = grc.src;}
];
};
programs.helix = {
enable = true;
settings = {
theme = "molokai";
editor = {
bufferline = "multiple";
color-modes = true;
file-picker.hidden = false;
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
};
keys.normal = {
"{" = ["goto_prev_paragraph"];
"}" = ["goto_next_paragraph"];
};
};
languages = {
language-server.pylsp.config.pylsp = {
plugins.black.enabled = true;
};
};
};
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
vim-airline
vim-airline-themes
vim-commentary
vim-nix
vim-one
vim-surround
vim-fish
ctrlp-vim
];
extraConfig = builtins.readFile ./vimrc.vim;
};
home.shellAliases = {
pbclean = "pbpaste | pbcopy";
};
home.packages = with pkgs; [
alejandra
awscli2
bashInteractive
cachix
comma
coreutils
curl
gh
grc
httpie
jq
nodePackages.npm
nodejs
openssh
poetry
ripgrep
rsync
s3cmd
socat
tailscale
terraform-ls
tmux
wget
(pkgs.runCommand "all-the-pythons" {} ''
mkdir -p $out/bin
ln -s ${pkgs.python312}/bin/python $out/bin/python3
ln -s ${pkgs.python312}/bin/python $out/bin/python
ln -s ${pkgs.python39}/bin/python $out/bin/python3.9
ln -s ${pkgs.python310}/bin/python $out/bin/python3.10
ln -s ${pkgs.python311}/bin/python $out/bin/python3.11
ln -s ${pkgs.python312}/bin/python $out/bin/python3.12
ln -s ${pkgs.python313}/bin/python $out/bin/python3.13
'')
];
home.file = {
".hushlogin".text = "";
".psqlrc".text = ''
\set QUIET ON
\pset null 'NULL'
\timing
\set COMP_KEYWORD_CASE upper
\set QUIET OFF
'';
};
home.sessionVariables = {
LANG = "en_US.UTF-8";
LC_CTYPE = "en_US.UTF-8";
PYTHONIOENCODING = "UTF-8";
};
}