2019-12-05 08:36:36 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
2019-12-15 07:37:46 +03:00
|
|
|
let
|
|
|
|
inherit (lib)
|
|
|
|
fileContents
|
|
|
|
;
|
|
|
|
|
|
|
|
in
|
2019-12-05 08:36:36 +03:00
|
|
|
{
|
|
|
|
|
|
|
|
imports = [
|
2019-12-14 08:00:11 +03:00
|
|
|
../local/locale.nix
|
2019-12-05 21:09:17 +03:00
|
|
|
../local/file-systems.nix
|
2019-12-05 08:36:36 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
|
|
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
|
|
|
|
tmpOnTmpfs = true;
|
|
|
|
|
|
|
|
kernel.sysctl."kernel.sysrq" = 1;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
environment = {
|
|
|
|
|
|
|
|
systemPackages = with pkgs; [
|
|
|
|
binutils
|
|
|
|
coreutils
|
|
|
|
curl
|
|
|
|
dnsutils
|
|
|
|
fd
|
|
|
|
git
|
|
|
|
iputils
|
|
|
|
manpages
|
|
|
|
moreutils
|
|
|
|
ripgrep
|
|
|
|
stdmanpages
|
|
|
|
utillinux
|
|
|
|
];
|
|
|
|
|
|
|
|
shellAliases = let
|
|
|
|
ifSudo = string: lib.mkIf config.security.sudo.enable string;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
# quick cd
|
|
|
|
".." = "cd ..";
|
|
|
|
"..." = "cd ../..";
|
|
|
|
"...." = "cd ../../..";
|
|
|
|
"....." = "cd ../../../..";
|
|
|
|
|
2019-12-15 11:17:42 +03:00
|
|
|
# git
|
|
|
|
g = "git";
|
|
|
|
|
2019-12-15 07:37:46 +03:00
|
|
|
# grep
|
|
|
|
grep = "rg";
|
|
|
|
gi = "grep -i";
|
|
|
|
|
2019-12-05 08:36:36 +03:00
|
|
|
# internet ip
|
|
|
|
myip = "dig +short myip.opendns.com @208.67.222.222 2>&1";
|
|
|
|
|
2019-12-16 07:29:54 +03:00
|
|
|
# nix
|
|
|
|
ni = "nix profile install";
|
|
|
|
nrb = ifSudo "sudo nixos-rebuild";
|
|
|
|
|
2019-12-05 08:36:36 +03:00
|
|
|
# sudo
|
|
|
|
si = ifSudo "env sudo -i";
|
|
|
|
sudo = ifSudo "sudo -E ";
|
|
|
|
se = ifSudo "sudoedit";
|
|
|
|
|
|
|
|
# systemd
|
|
|
|
ctl = "systemctl";
|
|
|
|
stl = ifSudo "sudo systemctl";
|
|
|
|
utl = "systemctl --user";
|
|
|
|
ut = "systemctl --user start";
|
|
|
|
un = "systemctl --user stop";
|
|
|
|
up = ifSudo "sudo systemctl start";
|
|
|
|
dn = ifSudo "sudo systemctl stop";
|
|
|
|
jctl = "journalctl";
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
fonts = {
|
|
|
|
fonts = with pkgs; [
|
|
|
|
powerline-fonts
|
|
|
|
dejavu_fonts
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
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 11:18:33 +03:00
|
|
|
experimental-features = nix-command flakes ca-references
|
2019-12-05 08:36:36 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
|
|
|
|
programs.mtr.enable = true;
|
|
|
|
|
|
|
|
|
|
|
|
security = {
|
|
|
|
|
|
|
|
hideProcessInformation = true;
|
|
|
|
|
|
|
|
protectKernelImage = true;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
services.earlyoom.enable = true;
|
|
|
|
|
|
|
|
|
2019-12-14 08:47:05 +03:00
|
|
|
users = {
|
|
|
|
mutableUsers = false;
|
|
|
|
|
2019-12-15 07:37:46 +03:00
|
|
|
users.root.hashedPassword = fileContents ../secrets/root;
|
2019-12-14 08:47:05 +03:00
|
|
|
};
|
2019-12-05 08:36:36 +03:00
|
|
|
|
|
|
|
}
|