2019-12-05 05:36:36 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2020-01-04 05:06:31 +00:00
|
|
|
let inherit (lib) fileContents;
|
2019-12-15 04:37:46 +00:00
|
|
|
|
2020-01-04 05:06:31 +00:00
|
|
|
in {
|
2019-12-17 22:56:02 +00:00
|
|
|
nix.package = pkgs.nixFlakes;
|
2019-12-05 05:36:36 +00:00
|
|
|
|
2020-01-04 05:06:31 +00:00
|
|
|
nix.systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
2019-12-05 05:36:36 +00:00
|
|
|
|
2020-01-04 05:06:31 +00:00
|
|
|
imports = [ ../local/locale.nix ];
|
2019-12-05 05:36:36 +00:00
|
|
|
|
|
|
|
boot = {
|
|
|
|
|
|
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
|
|
|
|
tmpOnTmpfs = true;
|
|
|
|
|
|
|
|
kernel.sysctl."kernel.sysrq" = 1;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
environment = {
|
|
|
|
|
|
|
|
systemPackages = with pkgs; [
|
|
|
|
binutils
|
|
|
|
coreutils
|
|
|
|
curl
|
|
|
|
dnsutils
|
2020-07-07 00:25:32 +00:00
|
|
|
dosfstools
|
2019-12-05 05:36:36 +00:00
|
|
|
fd
|
|
|
|
git
|
2019-12-26 07:17:44 +00:00
|
|
|
gotop
|
2019-12-17 04:13:33 +00:00
|
|
|
gptfdisk
|
2019-12-05 05:36:36 +00:00
|
|
|
iputils
|
|
|
|
manpages
|
|
|
|
moreutils
|
2020-07-07 00:25:32 +00:00
|
|
|
nmap
|
2019-12-05 05:36:36 +00:00
|
|
|
ripgrep
|
|
|
|
stdmanpages
|
|
|
|
utillinux
|
2020-07-07 00:25:32 +00:00
|
|
|
whois
|
2019-12-05 05:36:36 +00:00
|
|
|
];
|
|
|
|
|
2020-01-04 05:06:31 +00:00
|
|
|
shellAliases =
|
|
|
|
let ifSudo = string: lib.mkIf config.security.sudo.enable string;
|
|
|
|
in {
|
2019-12-05 05:36:36 +00:00
|
|
|
# quick cd
|
|
|
|
".." = "cd ..";
|
|
|
|
"..." = "cd ../..";
|
|
|
|
"...." = "cd ../../..";
|
|
|
|
"....." = "cd ../../../..";
|
|
|
|
|
2019-12-15 08:17:42 +00:00
|
|
|
# git
|
|
|
|
g = "git";
|
|
|
|
|
2019-12-15 04:37:46 +00:00
|
|
|
# grep
|
|
|
|
grep = "rg";
|
|
|
|
gi = "grep -i";
|
|
|
|
|
2019-12-05 05:36:36 +00:00
|
|
|
# internet ip
|
|
|
|
myip = "dig +short myip.opendns.com @208.67.222.222 2>&1";
|
|
|
|
|
2019-12-16 04:29:54 +00:00
|
|
|
# nix
|
2019-12-16 05:33:52 +00:00
|
|
|
n = "nix";
|
2019-12-16 22:37:31 +00:00
|
|
|
np = "n profile";
|
|
|
|
ni = "np install";
|
|
|
|
nr = "np remove";
|
|
|
|
ns = "n search";
|
2019-12-16 04:29:54 +00:00
|
|
|
nrb = ifSudo "sudo nixos-rebuild";
|
|
|
|
|
2019-12-05 05:36:36 +00:00
|
|
|
# sudo
|
2019-12-19 18:57:49 +00:00
|
|
|
s = ifSudo "sudo -E ";
|
|
|
|
si = ifSudo "sudo -i";
|
2019-12-05 05:36:36 +00:00
|
|
|
se = ifSudo "sudoedit";
|
|
|
|
|
2019-12-26 07:17:44 +00:00
|
|
|
# top
|
|
|
|
top = "gotop";
|
|
|
|
|
2019-12-05 05:36:36 +00:00
|
|
|
# systemd
|
|
|
|
ctl = "systemctl";
|
2019-12-19 18:57:49 +00:00
|
|
|
stl = ifSudo "s systemctl";
|
2019-12-05 05:36:36 +00:00
|
|
|
utl = "systemctl --user";
|
|
|
|
ut = "systemctl --user start";
|
|
|
|
un = "systemctl --user stop";
|
2019-12-19 18:57:49 +00:00
|
|
|
up = ifSudo "s systemctl start";
|
|
|
|
dn = ifSudo "s systemctl stop";
|
|
|
|
jtl = "journalctl";
|
2019-12-05 05:36:36 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
fonts = {
|
2020-01-04 05:06:31 +00:00
|
|
|
fonts = with pkgs; [ powerline-fonts dejavu_fonts ];
|
2019-12-05 05:36:36 +00:00
|
|
|
|
|
|
|
fontconfig.defaultFonts = {
|
|
|
|
|
|
|
|
monospace = [ "DejaVu Sans Mono for Powerline" ];
|
|
|
|
|
|
|
|
sansSerif = [ "DejaVu Sans" ];
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
|
|
|
|
autoOptimiseStore = true;
|
|
|
|
|
|
|
|
gc.automatic = true;
|
|
|
|
|
|
|
|
optimise.automatic = true;
|
|
|
|
|
|
|
|
useSandbox = true;
|
|
|
|
|
|
|
|
allowedUsers = [ "@wheel" ];
|
|
|
|
|
|
|
|
trustedUsers = [ "root" "@wheel" ];
|
|
|
|
|
|
|
|
extraOptions = ''
|
2019-12-15 08:18:33 +00:00
|
|
|
experimental-features = nix-command flakes ca-references
|
2020-07-14 02:07:32 +00:00
|
|
|
min-free = 2147483648
|
2019-12-05 05:36:36 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
security = {
|
|
|
|
|
|
|
|
hideProcessInformation = true;
|
|
|
|
|
|
|
|
protectKernelImage = true;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
services.earlyoom.enable = true;
|
|
|
|
|
2020-01-06 07:38:12 +00:00
|
|
|
users.mutableUsers = false;
|
2019-12-05 05:36:36 +00:00
|
|
|
|
|
|
|
}
|