2020-07-27 07:18:59 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
2020-01-04 08:06:31 +03:00
|
|
|
let inherit (lib) fileContents;
|
2020-07-31 07:17:28 +03:00
|
|
|
in
|
|
|
|
{
|
2019-12-18 01:56:02 +03:00
|
|
|
nix.package = pkgs.nixFlakes;
|
2019-12-05 08:36:36 +03:00
|
|
|
|
2020-01-04 08:06:31 +03:00
|
|
|
nix.systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
2019-12-05 08:36:36 +03:00
|
|
|
|
2020-08-02 23:50:05 +03:00
|
|
|
imports = [ ../../local/locale.nix ];
|
2019-12-05 08:36:36 +03:00
|
|
|
|
|
|
|
environment = {
|
|
|
|
|
|
|
|
systemPackages = with pkgs; [
|
|
|
|
binutils
|
|
|
|
coreutils
|
|
|
|
curl
|
2020-08-02 22:28:41 +03:00
|
|
|
direnv
|
2019-12-05 08:36:36 +03:00
|
|
|
dnsutils
|
2020-07-07 03:25:32 +03:00
|
|
|
dosfstools
|
2019-12-05 08:36:36 +03:00
|
|
|
fd
|
|
|
|
git
|
2019-12-26 10:17:44 +03:00
|
|
|
gotop
|
2019-12-17 07:13:33 +03:00
|
|
|
gptfdisk
|
2019-12-05 08:36:36 +03:00
|
|
|
iputils
|
2020-07-21 03:04:37 +03:00
|
|
|
jq
|
2020-12-17 00:48:40 +03:00
|
|
|
manix
|
|
|
|
nix-index
|
2019-12-05 08:36:36 +03:00
|
|
|
moreutils
|
2020-07-07 03:25:32 +03:00
|
|
|
nmap
|
2019-12-05 08:36:36 +03:00
|
|
|
ripgrep
|
|
|
|
utillinux
|
2020-07-07 03:25:32 +03:00
|
|
|
whois
|
2019-12-05 08:36:36 +03:00
|
|
|
];
|
|
|
|
|
2020-07-27 07:24:28 +03:00
|
|
|
shellInit = ''
|
|
|
|
export STARSHIP_CONFIG=${
|
|
|
|
pkgs.writeText "starship.toml"
|
2020-08-02 23:50:05 +03:00
|
|
|
(fileContents ./starship.toml)
|
2020-07-27 07:24:28 +03:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
2020-01-04 08:06:31 +03:00
|
|
|
shellAliases =
|
2020-07-31 07:13:41 +03:00
|
|
|
let ifSudo = lib.mkIf config.security.sudo.enable;
|
2020-07-31 07:17:28 +03:00
|
|
|
in
|
|
|
|
{
|
2019-12-05 08:36:36 +03:00
|
|
|
# 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
|
2019-12-16 08:33:52 +03:00
|
|
|
n = "nix";
|
2019-12-17 01:37:31 +03:00
|
|
|
np = "n profile";
|
|
|
|
ni = "np install";
|
|
|
|
nr = "np remove";
|
2020-07-25 05:20:24 +03:00
|
|
|
ns = "n search --no-update-lock-file";
|
2020-08-02 07:12:15 +03:00
|
|
|
nf = "n flake";
|
2021-01-19 11:00:41 +03:00
|
|
|
nepl = "n repl '<nixos>'";
|
2020-07-24 02:06:07 +03:00
|
|
|
srch = "ns nixpkgs";
|
2019-12-16 07:29:54 +03:00
|
|
|
nrb = ifSudo "sudo nixos-rebuild";
|
2020-12-17 00:48:40 +03:00
|
|
|
mn = ''
|
|
|
|
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | sk --preview="manix '{}'" | xargs manix
|
|
|
|
'';
|
2019-12-16 07:29:54 +03:00
|
|
|
|
2021-01-19 10:51:23 +03:00
|
|
|
# fix nixos-option
|
|
|
|
nixos-option = "nixos-option -I nixpkgs=${toString ../../compat}";
|
|
|
|
|
2019-12-05 08:36:36 +03:00
|
|
|
# sudo
|
2019-12-19 21:57:49 +03:00
|
|
|
s = ifSudo "sudo -E ";
|
|
|
|
si = ifSudo "sudo -i";
|
2019-12-05 08:36:36 +03:00
|
|
|
se = ifSudo "sudoedit";
|
|
|
|
|
2019-12-26 10:17:44 +03:00
|
|
|
# top
|
|
|
|
top = "gotop";
|
|
|
|
|
2019-12-05 08:36:36 +03:00
|
|
|
# systemd
|
|
|
|
ctl = "systemctl";
|
2019-12-19 21:57:49 +03:00
|
|
|
stl = ifSudo "s systemctl";
|
2019-12-05 08:36:36 +03:00
|
|
|
utl = "systemctl --user";
|
|
|
|
ut = "systemctl --user start";
|
|
|
|
un = "systemctl --user stop";
|
2019-12-19 21:57:49 +03:00
|
|
|
up = ifSudo "s systemctl start";
|
|
|
|
dn = ifSudo "s systemctl stop";
|
|
|
|
jtl = "journalctl";
|
2019-12-05 08:36:36 +03:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
fonts = {
|
2020-01-04 08:06:31 +03:00
|
|
|
fonts = with pkgs; [ powerline-fonts dejavu_fonts ];
|
2019-12-05 08:36:36 +03: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 11:18:33 +03:00
|
|
|
experimental-features = nix-command flakes ca-references
|
2020-07-17 00:16:27 +03:00
|
|
|
min-free = 536870912
|
2020-12-26 08:09:09 +03:00
|
|
|
keep-outputs = true
|
|
|
|
keep-derivations = true
|
2019-12-05 08:36:36 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2020-08-02 22:28:41 +03:00
|
|
|
programs.bash = {
|
|
|
|
promptInit = ''
|
|
|
|
eval "$(${pkgs.starship}/bin/starship init bash)"
|
|
|
|
'';
|
2020-12-20 04:35:16 +03:00
|
|
|
interactiveShellInit = ''
|
2020-08-02 22:28:41 +03:00
|
|
|
eval "$(${pkgs.direnv}/bin/direnv hook bash)"
|
|
|
|
'';
|
|
|
|
};
|
2020-07-27 07:24:28 +03:00
|
|
|
|
2019-12-05 08:36:36 +03:00
|
|
|
security = {
|
|
|
|
|
|
|
|
hideProcessInformation = true;
|
|
|
|
|
|
|
|
protectKernelImage = true;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
services.earlyoom.enable = true;
|
|
|
|
|
2020-01-06 10:38:12 +03:00
|
|
|
users.mutableUsers = false;
|
2019-12-05 08:36:36 +03:00
|
|
|
|
|
|
|
}
|