This repository has been archived by the owner on Jan 31, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcommon.nix
237 lines (225 loc) · 6.87 KB
/
common.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
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.veritas.profiles.common;
in
{
options.veritas.profiles.common = {
enable = mkEnableOption "common configurations";
# Define a colour scheme for use in application configurations to ensure consistency.
colourScheme =
let
mkColour = description: default: mkOption {
inherit default;
description = "Define the colour for ${description}.";
example = "FFFFFF";
type = types.str;
};
in
{
background = mkColour "background" "1C1C1C";
cursor = mkColour "foreground" cfg.colourScheme.foreground;
foreground = mkColour "foreground" "C5C8C6";
# Regular colours
black = mkColour "black" "282A2E";
red = mkColour "red" "A54242";
green = mkColour "green" "8C9440";
yellow = mkColour "yellow" "DE935F";
blue = mkColour "blue" "5F819D";
magenta = mkColour "magenta" "85678F";
cyan = mkColour "cyan" "5E8D87";
white = mkColour "white" "707880";
# Bright colours
brightBlack = mkColour "bright black" "373B41";
brightRed = mkColour "bright red" "CC6666";
brightGreen = mkColour "bright green" "B5BD68";
brightYellow = mkColour "bright yellow" "F0C674";
brightBlue = mkColour "bright blue" "81A2BE";
brightMagenta = mkColour "bright magenta" "B294BB";
brightCyan = mkColour "bright cyan" "8ABEB7";
brightWhite = mkColour "bright white" "C5C8C6";
};
withTools = mkOption {
type = types.str;
default = true;
description = "Install helpful tools and utilities for debugging.";
};
};
config = mkIf cfg.enable {
home = {
enableDebugInfo = true;
keyboard.layout = "gb";
language.base = "en_GB.utf8";
packages = with pkgs; [
# Locales!
glibcLocales
# Helper script to print the IOMMU groups of PCI devices.
(
writeScriptBin "list-iommu-groups" ''
#! ${pkgs.runtimeShell} -e
shopt -s nullglob
for g in /sys/kernel/iommu_groups/*; do
echo "IOMMU Group ''${g##*/}:"
for d in $g/devices/*; do
echo -e "\t$(lspci -nns ''${d##*/})"
done;
done;
''
)
# Determine file type.
file
# Show full path of shell commands.
which
# Daemon to execute scheduled commands.
cron
# Collection of useful tools that aren't coreutils.
moreutils
# Non-interactive network downloader.
wget
# List directory contents in tree-like format.
tree
# Interactive process viewer.
htop
# Top-like I/O monitor.
iotop
# Power consumption and management diagnosis tool.
powertop
# List hardware.
lshw
# Collection of programs for inspecting/manipulating configuration of PCI devices.
pciutils
# Collection of utilities using proc filesystem (`pstree`, `killall`, etc.)
psmisc
# DMI table decoder.
dmidecode
# Tools for working with usb devices (`lsusb`, etc.)
usbutils
# Collection of common network programs.
inetutils
# Mobile shell with roaming and intelligent local echo.
mosh
# Bandwidth monitor and rate estimator.
bmon
# DNS server (provides `dig`)
bind
# Connection tracking userspace tools.
conntrack-tools
# Dump traffic on a network.
tcpdump
# Query/control network driver and hardware settings.
ethtool
# Parititon manipulation program.
parted
# exFAT filesystem implementation.
exfat
# Utilities for creating/checking FAT/VFAT filesystems.
dosfstools
# ncurses disk usage.
ncdu
# Hard-drive health monitoring.
smartmontools
# Compress/uncompress `.zip` files.
unzip
zip
# Uncompress `.rar` files.
unrar
# Man pages
man
man-pages
posix_man_pages
stdman
# Arbitrary-precision calculator.
bc
# Copy files/archives/repositories into the nix store.
nix-prefetch-scripts
# Index the nix store (provides `nix-locate`).
nix-index
# Eases nixpkgs review workflow.
nix-review
# grep alternative.
ripgrep
# ls alternative.
exa
# cat alternative.
bat
# Quicker access to files and directories.
fasd
# GnuPG
gnupg
# A command-line tool to generate, analyze, convert and manipulate colors.
pastel
# Tool for indexing, slicing, analyzing, splitting and joining CSV files.
xsv
# Simple, fast and user-friendly alternative to find.
fd
# More intuitive du.
du-dust
# cat for markdown
mdcat
# Command line image viewer
viu
# Tool for discovering and probing hosts on a computer network
arping
# Dependency mgmt for nix projects
niv
# Visualize Nix gc-roots to delete to free space.
nix-du
# Reading hardware sensors.
lm_sensors
# NFS debugging utilities
nfsUtils
# Recover dead disks :(
ddrescue
# Query SNMP servers
net_snmp
# Required to mount encrypted USB drives.
cryptsetup
# Check which process is using a mountpoint.
lsof
# Encrypted files in Git repositories
git-crypt
# Keybase
keybase
# Hosted binary caches
cachix
# Show information about the current system
neofetch
];
sessionVariables = {
"LOCALE_ARCHIVE" = "${pkgs.glibcLocales}/lib/locale/locale-archive";
"LANGUAGE" = config.home.language.base;
"LC_ALL" = config.home.language.base;
# Don't clear the screen when leaving man.
"MANPAGER" = "less -X";
};
};
# Install home-manager manpages.
manual.manpages.enable = true;
# Install man output for any Nix packages.
programs.man.enable = true;
veritas.configs = {
bash.enable = true;
cachix.enable = true;
command-not-found.enable = true;
feh.enable = true;
fish.enable = true;
fzf.enable = true;
git.enable = true;
gnupg.enable = true;
htop.enable = true;
hushlogin.enable = true;
info.enable = true;
jq.enable = true;
less.enable = true;
mail.enable = true;
neovim.enable = true;
netrc.enable = true;
readline.enable = true;
ssh.enable = true;
starship.enable = true;
tmux.enable = true;
xdg.enable = true;
};
};
}
# vim:foldmethod=marker:foldlevel=0:ts=2:sts=2:sw=2:et:nowrap