-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
243 lines (217 loc) · 5.57 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
{ config, pkgs, pkgs-unstable, lib, ... }:
let
inherit (lib.meta) hiPrio;
configRepo = /home/niklas/dotconfig;
enableWithFish = { enable = true; enableFishIntegration = true; };
in
{
home.username = "niklas";
home.homeDirectory = "/home/niklas";
home.stateVersion = "23.05"; # Please read the comment before changing.
programs.home-manager.enable = true;
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"spotify"
];
home.packages = with pkgs; [
alacritty
arandr
autorandr
(nerdfonts.override { fonts = [ "CascadiaCode" "Ubuntu" ]; })
rofi
xclip
i3lock
git-absorb
libinput-gestures
wmctrl
playerctl
nemo
libsForQt5.ark
firefox
ungoogled-chromium
thunderbird
keepassxc
libreoffice
pkgs-unstable.discord
spotify
telegram-desktop
signal-desktop
vlc
obs-studio
eog
gimp
btop
tealdeer
du-dust
rsync
unzip
clang
(hiPrio gcc)
rustup
typst
typst-lsp
typst-fmt
(texlive.combine {
inherit (texlive) scheme-medium enumitem titling todonotes cleveref;
})
ipe
okular
zathura
pdftk
ghostscript
pkgs-unstable.musescore
nil
nixpkgs-fmt
stylua
lua-language-server
tree-sitter
nix-output-monitor
zotero
];
fonts.fontconfig.enable = true;
gtk = {
enable = true;
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
theme = {
name = "palenight";
package = pkgs.palenight-theme;
};
cursorTheme = {
name = "Numix-Cursor";
package = pkgs.numix-cursor-theme;
};
gtk3.extraConfig.Settings = ''
gtk-application-prefer-dark-theme=1
'';
gtk4.extraConfig.Settings = ''
gtk-application-prefer-dark-theme=1
'';
};
home.sessionVariables.GTK_THEME = "palenight";
qt = {
enable = true;
platformTheme.name = "gtk";
style.name = "adwaita-dark";
};
home.file =
let
link = config.lib.file.mkOutOfStoreSymlink;
linkedFiles = [ ".config/alacritty" ".config/qtile" ".config/nvim" ".tmux.conf" ".config/latexmk" ];
linkedFilesConfig = builtins.listToAttrs (map
(name: {
inherit name;
value.source = link (configRepo + "/${name}");
})
linkedFiles);
otherFilesConfig = {
".config/gdb/gdbinit".text = ''
set history save on
set history size 1024
set history filename ${config.xdg.cacheHome}/gdb_history
'';
".config/rofi/config.rasi".text = ''
configuration {
modi: "combi";
font: "Ubuntu Regular 11";
show-icons: true;
terminal: "alacritty";
ssh-command: "{terminal} -e ssh {host}";
combi-modi: "drun,ssh,window";
}
'';
};
in
linkedFilesConfig // otherFilesConfig;
xdg.enable = true;
home.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
CARGO_TARGET_DIR = "${config.xdg.cacheHome}/cargo-target-dir";
MANPAGER = "nvim +Man!";
};
services.picom = {
enable = true;
vSync = true;
};
# Fix tray.target not being present (https://github.com/nix-community/home-manager/issues/2064)
systemd.user.targets.tray.Unit = {
Description = "Home Manager System Tray";
Requires = [ "graphical-session-pre.target" ];
};
services.pasystray.enable = true;
services.dunst.enable = true;
services.network-manager-applet.enable = true;
services.blueman-applet.enable = true;
programs.gpg.enable = true;
services.gpg-agent = enableWithFish // {
pinentryPackage = pkgs.pinentry-curses;
};
programs.git = {
enable = true;
userName = "Niklas Mohrin";
userEmail = "[email protected]";
signing = {
key = null; # Use key matching the commit author
signByDefault = true;
};
ignores = [ ".vim-rooter" ".direnv" ];
extraConfig."init"."defaultBranch" = "main";
difftastic.enable = true;
};
programs.gh.enable = true;
programs.fish = {
enable = true;
functions = {
take.body = "mkdir -p $argv[1]; and cd $argv[1]";
};
interactiveShellInit = ''
set fish_greeting
fish_vi_key_bindings
bind \cf accept-autosuggestion
bind -M insert \cf accept-autosuggestion
'';
shellAbbrs = {
vim = "nvim";
cal = "cal -m";
open = "xdg-open";
xclip = "xclip -sel clip";
g = "git";
ga = "git add";
gap = "git add -p";
gc = "git commit";
gd = "git diff";
gds = "git diff --staged";
gff = "git pull --ff-only";
gffu = "git pull --ff-only upstream (git branch --show-current)";
gl = "git log";
gp = "git push";
gr = "git rebase";
gri = "git rebase --interactive --autosquash";
gs = "git status";
gsh = "git show";
gsw = "git switch";
};
};
programs.nix-index = enableWithFish;
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
programs.zoxide = enableWithFish;
programs.eza = enableWithFish;
services.flameshot.enable = true;
systemd.user.services.backup = {
Unit.Description = "Backs up files";
Service = {
ExecStart = "${pkgs.rsync}/bin/rsync %h/Sync -CERrltm pi:Sync";
Environment = "PATH=${lib.makeBinPath [ pkgs.openssh ]}";
};
};
systemd.user.paths.backup = {
Unit.Description = "Checks if paths that are currently being backed up have changed";
Path.PathChanged = "%h/Sync";
Install.WantedBy = [ "default.target" ];
};
}