2021-10-01 07:08:00 -07:00
|
|
|
{ self, config, lib, pkgs, ... }:
|
|
|
|
let inherit (lib) fileContents;
|
|
|
|
in
|
|
|
|
{
|
2022-03-17 08:11:12 -07:00
|
|
|
imports = [ ../cachix ];
|
|
|
|
|
|
|
|
nix.systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
|
|
|
|
2022-05-22 04:10:29 -07: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 = ''
|
|
|
|
min-free = 536870912
|
|
|
|
keep-outputs = true
|
|
|
|
keep-derivations = true
|
|
|
|
fallback = true
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
#programs.bash = {
|
|
|
|
# promptInit = ''
|
|
|
|
# eval "$(starship init bash)"
|
|
|
|
# '';
|
|
|
|
# interactiveShellInit = ''
|
|
|
|
# flakify() {
|
|
|
|
# if [ ! -e flake.nix ]; then
|
|
|
|
# nix flake new -t github:nix-community/nix-direnv .
|
|
|
|
# elif [ ! -e .envrc ]; then
|
|
|
|
# echo "use flake" > .envrc
|
|
|
|
# direnv allow
|
|
|
|
# fi
|
|
|
|
# vim flake.nix
|
|
|
|
# }
|
|
|
|
|
|
|
|
# export STARSHIP_CONFIG=${
|
|
|
|
# pkgs.writeText "starship.toml"
|
|
|
|
# (builtins.readFile ./starship.toml)
|
|
|
|
# }
|
|
|
|
|
|
|
|
# eval "$(${pkgs.direnv}/bin/direnv hook bash)"
|
|
|
|
# '';
|
|
|
|
# enableCompletion = true;
|
|
|
|
#};
|
|
|
|
|
|
|
|
programs.zsh.enable = true;
|
|
|
|
|
2022-03-17 08:11:12 -07:00
|
|
|
environment = {
|
|
|
|
|
|
|
|
shellInit = ''
|
|
|
|
export STARSHIP_CONFIG=${
|
|
|
|
pkgs.writeText "starship.toml"
|
|
|
|
(fileContents ./starship.toml)
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
|
|
|
shellAliases =
|
|
|
|
let ifSudo = lib.mkIf config.security.sudo.enable;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
# nix
|
|
|
|
n = "nix";
|
|
|
|
np = "n profile";
|
|
|
|
ni = "np install";
|
|
|
|
nr = "np remove";
|
|
|
|
ns = "n search --no-update-lock-file";
|
|
|
|
nf = "n flake";
|
|
|
|
nepl = "n repl '<nixpkgs>'";
|
|
|
|
srch = "ns nixos";
|
|
|
|
orch = "ns override";
|
2022-04-11 01:58:58 -07:00
|
|
|
nrb = ifSudo "cd /tmp; sudo nixos-rebuild switch --flake '/etc/nixos/#curve'; cd $OLDPWD";
|
2022-03-17 08:11:12 -07:00
|
|
|
nrt = ifSudo "sudo nixos-rebuild test --flake '/etc/nixos/#curve'";
|
|
|
|
nedit = "cd /etc/nixos; vim";
|
|
|
|
ncd = "cd /etc/nixos";
|
|
|
|
mn = ''
|
|
|
|
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | sk --preview="manix '{}'" | xargs manix
|
|
|
|
'';
|
|
|
|
# fix nixos-option
|
|
|
|
nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat";
|
|
|
|
|
|
|
|
# sudo
|
|
|
|
s = ifSudo "sudo -E ";
|
|
|
|
pls = ifSudo "s";
|
|
|
|
si = ifSudo "sudo -i";
|
|
|
|
se = ifSudo "sudoedit";
|
|
|
|
|
|
|
|
# top
|
|
|
|
top = "btm";
|
|
|
|
|
|
|
|
# systemd
|
|
|
|
ctl = "systemctl";
|
|
|
|
stl = ifSudo "s systemctl";
|
|
|
|
utl = "systemctl --user";
|
|
|
|
ut = "systemctl --user start";
|
|
|
|
un = "systemctl --user stop";
|
|
|
|
up = ifSudo "s systemctl start";
|
|
|
|
dn = ifSudo "s systemctl stop";
|
|
|
|
jtl = "journalctl";
|
|
|
|
|
|
|
|
# quick ssh
|
2022-04-23 21:55:24 -07:00
|
|
|
sm = "ssh 10.0.69.4";
|
2022-03-17 08:11:12 -07:00
|
|
|
ss = "ssh sealight.xyz";
|
2022-04-19 00:53:59 -07:00
|
|
|
sc = "ssh lakhwara.com"; # cube
|
2022-03-17 08:11:12 -07:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-03-22 05:06:31 -07:00
|
|
|
services.devmon.enable = true;
|
|
|
|
|
2022-03-17 08:11:12 -07:00
|
|
|
# For rage encryption, all hosts need a ssh key pair
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = lib.mkDefault false;
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.gnupg.agent.enable = true;
|
|
|
|
#programs.gnupg.agent.pinentryFlavor = "curses";
|
|
|
|
|
|
|
|
services.earlyoom.enable = true;
|
2021-10-01 07:08:00 -07:00
|
|
|
}
|