2019-12-05 06:36:36 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2019-12-15 05:37:46 +01:00
|
|
|
let
|
|
|
|
inherit (lib)
|
|
|
|
fileContents
|
|
|
|
;
|
|
|
|
|
|
|
|
in
|
2019-12-05 06:36:36 +01:00
|
|
|
{
|
2019-12-17 23:56:02 +01:00
|
|
|
nix.package = pkgs.nixFlakes;
|
2019-12-05 06:36:36 +01:00
|
|
|
|
2019-12-18 01:49:26 +01:00
|
|
|
nix.systemFeatures = [
|
|
|
|
"nixos-test"
|
|
|
|
"benchmark"
|
|
|
|
"big-parallel"
|
|
|
|
"kvm"
|
|
|
|
];
|
|
|
|
|
2019-12-05 06:36:36 +01:00
|
|
|
imports = [
|
2019-12-14 06:00:11 +01:00
|
|
|
../local/locale.nix
|
2019-12-05 19:09:17 +01:00
|
|
|
../local/file-systems.nix
|
2019-12-05 06:36:36 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
|
|
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
|
|
|
|
tmpOnTmpfs = true;
|
|
|
|
|
|
|
|
kernel.sysctl."kernel.sysrq" = 1;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
environment = {
|
|
|
|
|
|
|
|
systemPackages = with pkgs; [
|
|
|
|
binutils
|
|
|
|
coreutils
|
|
|
|
curl
|
2019-12-17 05:13:33 +01:00
|
|
|
dosfstools
|
2019-12-05 06:36:36 +01:00
|
|
|
dnsutils
|
|
|
|
fd
|
|
|
|
git
|
2019-12-17 05:13:33 +01:00
|
|
|
gptfdisk
|
2019-12-05 06:36:36 +01:00
|
|
|
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 09:17:42 +01:00
|
|
|
# git
|
|
|
|
g = "git";
|
|
|
|
|
2019-12-15 05:37:46 +01:00
|
|
|
# grep
|
|
|
|
grep = "rg";
|
|
|
|
gi = "grep -i";
|
|
|
|
|
2019-12-05 06:36:36 +01:00
|
|
|
# internet ip
|
|
|
|
myip = "dig +short myip.opendns.com @208.67.222.222 2>&1";
|
|
|
|
|
2019-12-16 05:29:54 +01:00
|
|
|
# nix
|
2019-12-16 06:33:52 +01:00
|
|
|
n = "nix";
|
2019-12-16 23:37:31 +01:00
|
|
|
np = "n profile";
|
|
|
|
ni = "np install";
|
|
|
|
nr = "np remove";
|
|
|
|
ns = "n search";
|
2019-12-16 05:29:54 +01:00
|
|
|
nrb = ifSudo "sudo nixos-rebuild";
|
|
|
|
|
2019-12-05 06:36:36 +01:00
|
|
|
# sudo
|
2019-12-19 19:57:49 +01:00
|
|
|
s = ifSudo "sudo -E ";
|
|
|
|
si = ifSudo "sudo -i";
|
2019-12-05 06:36:36 +01:00
|
|
|
se = ifSudo "sudoedit";
|
|
|
|
|
|
|
|
# systemd
|
|
|
|
ctl = "systemctl";
|
2019-12-19 19:57:49 +01:00
|
|
|
stl = ifSudo "s systemctl";
|
2019-12-05 06:36:36 +01:00
|
|
|
utl = "systemctl --user";
|
|
|
|
ut = "systemctl --user start";
|
|
|
|
un = "systemctl --user stop";
|
2019-12-19 19:57:49 +01:00
|
|
|
up = ifSudo "s systemctl start";
|
|
|
|
dn = ifSudo "s systemctl stop";
|
|
|
|
jtl = "journalctl";
|
2019-12-05 06:36:36 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
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 09:18:33 +01:00
|
|
|
experimental-features = nix-command flakes ca-references
|
2019-12-05 06:36:36 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
|
|
|
|
programs.mtr.enable = true;
|
|
|
|
|
|
|
|
|
|
|
|
security = {
|
|
|
|
|
|
|
|
hideProcessInformation = true;
|
|
|
|
|
|
|
|
protectKernelImage = true;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
services.earlyoom.enable = true;
|
|
|
|
|
|
|
|
|
2019-12-14 06:47:05 +01:00
|
|
|
users = {
|
|
|
|
mutableUsers = false;
|
|
|
|
|
2019-12-15 05:37:46 +01:00
|
|
|
users.root.hashedPassword = fileContents ../secrets/root;
|
2019-12-14 06:47:05 +01:00
|
|
|
};
|
2019-12-05 06:36:36 +01:00
|
|
|
|
|
|
|
}
|