config/modules/base/default.nix

150 lines
2.8 KiB
Nix
Raw Normal View History

2023-04-14 14:12:45 +03:00
{
config,
lib,
pkgs,
...
}: {
imports = [
2023-07-22 16:05:44 +03:00
./boot
2023-04-14 14:12:45 +03:00
./initrd
2023-07-22 16:05:44 +03:00
./fileSystems
2023-07-18 12:31:48 +03:00
./snapshot
2023-07-20 06:58:47 +03:00
./sshd
2023-07-26 14:10:22 +03:00
./sshguard
2023-07-20 06:58:47 +03:00
./unitstatus
2023-07-20 15:02:38 +03:00
./users
./zfs
2023-07-19 14:16:56 +03:00
./zfsborg
2023-04-14 14:12:45 +03:00
];
2023-07-20 15:02:38 +03:00
options.mj = with lib.types; {
2023-04-14 14:12:45 +03:00
stateVersion = lib.mkOption {
2023-07-20 15:02:38 +03:00
type = str;
2023-04-14 14:12:45 +03:00
example = "22.11";
description = "The NixOS state version to use for this system";
};
2023-07-20 15:02:38 +03:00
2023-04-14 14:12:45 +03:00
timeZone = lib.mkOption {
2023-07-20 15:02:38 +03:00
type = str;
2023-04-14 14:12:45 +03:00
example = "Europe/Vilnius";
description = "Time zone for this system";
};
};
config = {
time.timeZone = config.mj.timeZone;
i18n = {
defaultLocale = "en_US.UTF-8";
supportedLocales = [
2023-07-24 12:47:41 +03:00
"en_US.UTF-8/UTF-8"
2023-04-14 14:12:45 +03:00
"lt_LT.UTF-8/UTF-8"
];
};
2023-07-20 11:56:08 +03:00
nix = {
gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 14d";
};
settings = {
experimental-features = ["nix-command" "flakes"];
trusted-users = ["motiejus"];
};
};
2023-04-14 14:12:45 +03:00
system.stateVersion = config.mj.stateVersion;
security = {
sudo = {
wheelNeedsPassword = false;
execWheelOnly = true;
};
};
environment = {
systemPackages = with pkgs; [
jc # parse different formats and command outputs to json
jq # parse, format and query json documents
pv # pipe viewer for progressbars in pipes
bat # "bat - cat with wings", cat|less with language highlight
duf # nice disk usage output
2023-07-20 11:56:08 +03:00
git
tmux
htop
2023-04-14 14:12:45 +03:00
file # file duh
host # look up host info
tree # tree duh
lsof # lsof yay
rage # encrypt-decrypt
2023-07-20 11:56:08 +03:00
ncdu # disk usage navigator
2023-04-14 14:12:45 +03:00
pwgen
2023-07-20 11:56:08 +03:00
parted
2023-04-14 14:12:45 +03:00
sqlite
2023-07-26 11:06:28 +03:00
procps
2023-04-14 14:12:45 +03:00
direnv
ripgrep
vimv-rs
2023-07-26 11:09:52 +03:00
sysstat
2023-04-14 14:12:45 +03:00
nix-top # nix-top is a top for what nix is doing
2023-07-20 11:56:08 +03:00
bsdgames
2023-04-14 14:12:45 +03:00
binutils
moreutils
unixtools.xxd
# networking
dig
nmap
2023-07-20 11:56:08 +03:00
ngrep
2023-04-14 14:12:45 +03:00
wget
curl
btop
iftop
2023-04-14 14:12:45 +03:00
whois
ipset
jnettop
2023-07-20 11:56:08 +03:00
openssl
tcpdump
2023-04-14 14:12:45 +03:00
testssl
dnsutils
speedtest-cli
prettyping
(runCommand "prettyping-pp" {} ''
mkdir -p $out/bin
ln -s ${prettyping}/bin/prettyping $out/bin/pp
'')
# compression/decompression
xz
pigz
zstd
p7zip
brotli
zopfli
];
variables = {
EDITOR = "nvim";
};
};
programs = {
mtr.enable = true;
2023-08-05 17:27:13 +03:00
sysdig.enable = true;
2023-04-14 14:12:45 +03:00
neovim = {
enable = true;
defaultEditor = true;
};
};
2023-07-26 14:10:22 +03:00
services = {
locate = {
enable = true;
locate = pkgs.plocate;
localuser = null;
};
};
2023-04-14 14:12:45 +03:00
};
}