-
Notifications
You must be signed in to change notification settings - Fork 0
/
programs.nix
284 lines (221 loc) · 8.08 KB
/
programs.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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
{
config,
lib,
modulesPath,
options,
pkgs,
specialArgs,
}:
let
issue-208242 = pkgs.callPackage ./scripts/issue-208242.nix { };
# See nixos/nixpkgs#22652 for this workaround
alacritty = pkgs.alacritty.overrideAttrs (finalAttrs: {
postInstall = (finalAttrs.postInstall or "") + ''
wrapProgram $out/bin/alacritty --set XCURSOR_THEME Adwaita
'';
});
in
{
programs.git.package = pkgs.git.overrideAttrs (prevAttrs: {
patches = (prevAttrs.patches or [ ]) ++ [
# Print the previous name of the branch when switching it.
patches/git/0001-checkout-print-previous-branch-name-when-switching.patch
];
# We violate the expectations somehow by changing the message.
preInstallCheck =
prevAttrs.preInstallCheck
+ ''
disable_test t2024-checkout-dwim
'';
});
# Use Vim as the editor of choice.
programs.vim.enable = true;
programs.vim.defaultEditor = true;
# Have an SSH agent.
programs.ssh.startAgent = true;
# Give a bashrc that's worth a damn.
programs.bash.interactiveShellInit = ''
source ${
pkgs.replaceVars dotfiles/bash/bashrc {
# `h` is a tool to check out and jump to checked-out repositories.
# https://github.com/zimbatm/h
inherit (pkgs) h;
# `git` is just Git!
git = config.programs.git.package;
}
}
'';
# Set up inputrc to be my custom one.
environment.etc.inputrc.source = dotfiles/readline/inputrc;
# `firefox` is a web browser.
# http://www.mozilla.com/en-US/firefox/
programs.firefox.enable = true;
# `htop` is an interactive process viewer.
# https://htop.dev/
programs.htop = {
enable = true;
package = pkgs.htop.overrideAttrs (prev: {
# Remove the .desktop icon; no need to launch htop from Gnome.
postInstall = ''
rm -rf $out/share/{applications,icons,pixmaps}
'';
});
};
# `wireshark` is a network packet tracing application
# https://www.wireshark.org/
programs.wireshark.enable = true;
# Use Tailscale.
services.tailscale.enable = true;
# Turn off the firewall altogether.
networking.firewall.enable = false;
# Turn on polkit (ew)
security.polkit.enable = true;
# Turn on PCSC-Lite daemon.
services.pcscd.enable = true;
# Turn on sudo explicitly. In time, let's explore having other privilege escalators.
security.sudo.enable = true;
# Some NixOS packages provide debug symbols. However, these are not included in the system closure
# by default to save disk space. Enabling this option causes the debug symbols to appear in
# `/run/current-system/sw/lib/debug/.build-id`, where tools such as `gdb` can find them.
environment.enableDebugInfo = true;
environment.systemPackages = with pkgs; [
# `bat` is a modern `cat` written in Rust with sweet features.
# https://github.com/sharkdp/bat
bat
# `browsh` is a modern text-based browser.
# https://www.brow.sh/
browsh
# `comby` is a tool for searching and changing code structure.
# https://comby.dev/
comby
# `curl` is the do-anything tool for network access.
# https://github.com/curl/curl
curl
# `diffoscope` tries to get to the bottom of what makes files or directories different.
# https://diffoscope.org/
diffoscope
# `efibootmgr` is a tool to control EFI boots
# https://github.com/rhboot/efibootmgr/
efibootmgr
# `efivar` is a tool to show and modify EFI variables
# https://github.com/rhboot/efivar
efivar
# `fd` is a simple, fast and user-friendly alternative to find.
# https://github.com/sharkdp/fd
fd
# `figlet` is a program for making large letters out of ordinary text.
# http://www.figlet.org/
figlet
# `file` is a program that shows the type of files.
# https://darwinsys.com/file
file
# `gdb` is the GNU debugger.
# https://www.sourceware.org/gdb/
gdb
# `gh` is the command line GitHub client.
# https://cli.github.com/
gh
# `glib` is the GNOME core library
# https://gitlab.gnome.org/GNOME/glib
glib
# `gping` is ping, but with a graph.
# https://github.com/orf/gping
gping
# The `fixparts`, `cgdisk`, `sgdisk`, and `gdisk` programs are partitioning tools for GPT disks.
# https://www.rodsbooks.com/gdisk/
gptfdisk
# `hexyl` is a command-line hex viewer.
# https://github.com/sharkdp/hexyl
hexyl
# `inotifywait`, `fsnotifywatch`, `inotifywatch`, and `fsnotifywait` allow waiting for
# filesystem events and running commands when they occur.
# https://github.com/inotify-tools/inotify-tools/wiki
inotify-tools
# Helper script to work on nixos/nixpkgs#208242
issue-208242
# `jq` is a lightweight and flexible command-line JSON processor.
# https://stedolan.github.io/jq/
jq
# `nixpkgs-fmt` is a Nix code formatter designed for nixpkgs. It's not official.
# https://nix-community.github.io/nixpkgs-fmt
nixpkgs-fmt
# `nixpkgs-review` automatically builds packages changed in nixpkgs pull requests.
# https://github.com/Mic92/nixpkgs-review
nixpkgs-review
# `lspci` and `setpci` are tools that inspect and manipulate the configuration of PCI devices.
# https://mj.ucw.cz/sw/pciutils/
pciutils
# `pv` is a tool for monitoring the progress of data through a pipeline.
# https://www.ivarch.com/programs/pv.shtml
pv
# `qrtool` is a CLI for decoding QR codes
# https://github.com/sorairolake/qrtool
qrtool
# `ren` is a file rename tool that fits in with `fd`.
# https://blog.robenkleene.com/2023/12/26/introducing-rep-ren/
ren-find
# `rep` is a find-and-replace tool that fits in with `rg`
# https://blog.robenkleene.com/2023/12/26/introducing-rep-ren/
rep-grep
# `rg` is a modern `grep` written in Rust.
# https://github.com/BurntSushi/ripgrep
ripgrep
# `shellcheck` is a static analysis tool for Bash shell scripts.
# https://www.shellcheck.net/
shellcheck
# `shfmt` is a shell formatter (sh/bash/mksh).
# https://github.com/mvdan/sh
shfmt
# The `rdsquashfs`, `tar2sqfs`, `sqfsdiff`, `gensquashfs`, and `sqfs2tar` tools work on #
# SquashFS disk images.
# https://github.com/AgentD/squashfs-tools-ng
squashfs-tools-ng
# A collection of performance monitoring tools for Linux (such as `sar`, `iostat` and `pidstat`)
# http://sebastien.godard.pagesperso-orange.fr/
sysstat
# `uefisettings` is a rough-and-ready program to look through BIOS information in HiiDB format.
# https://github.com/linuxboot/uefisettings
uefisettings
# `unzip` is an extraction utility for archives compressed in .zip format.
# http://www.info-zip.org/
unzip
# The `lsusb.py`, `usbhid-dump`, `usb-devices`, and `lsusb` tools work with USB devices.
# http://www.linux-usb.org/
usbutils
# `watchexec` is a tool to execute something when files change.
# https://watchexec.github.io/
watchexec
# `wget` is a tool for retrieving files using HTTP, HTTPS, and FTP.
# https://www.gnu.org/software/wget/
wget
# `yq` is like jq for YAML files
# https://github.com/mikefarah/yq
yq
# `llama-cpp` is a set of programs for running LLMs locally
llama-cpp
];
users.users.philip.packages = [
# `alacritty` is a cross-platform, GPU-accelerated terminal emulator.
# https://github.com/alacritty/alacritty
alacritty
# `chromium` is a browser from Google.
# https://www.chromium.org/
pkgs.chromium
# `discord` is an all-in-one cross-platform voice and text chat for ~gamers~
# https://discordapp.com/
pkgs.discord
# `element-desktop` is a feature-rich client for Matrix.org
# https://element.io/
pkgs.element-desktop
# `gh` is the command line GitHub client.
# https://cli.github.com/
pkgs.gh
# Slack is the Searchable Log of All Conversation and Knowledge.
# https://slack.com/
pkgs.slack
];
systemd.user.tmpfiles.users.philip.rules = [
"L+ %h/.config/alacritty/alacritty.toml - - - - ${dotfiles/alacritty/alacritty.toml}"
"L+ %h/.config/gdb/gdbinit - - - - ${dotfiles/gdb/gdbinit}"
];
}