nixos_config/home/alisceon/base.nix
2026-01-08 18:05:08 +01:00

159 lines
4.8 KiB
Nix

{ pkgs, config, hostName, lib, ... }:
let
# Universal shell abbreviations
baseAbbrs = {
tsla-fan = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0";
# NixOS commands
nixoss = "sudo nixos-rebuild switch --flake .#${hostName}";
nixost = "sudo nixos-rebuild test --flake .#${hostName}";
nixosdb = "sudo nixos-rebuild dry-build --flake .#${hostName}";
# Development commands
devt = "devenv test";
devtas = "devenv tasks list";
devtar = "devenv tasks run";
devs = "devenv shell";
devu = "devenv up -d";
devi-python = "nix flake init -t templates#python";
}; # end globalShellAbbrs
# Tower specific abbreviations
hostnameAbbrs =
if hostName == "tower" then {
weboot = "bash -c 'nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 && reboot'";
}
else if hostName == "tesla-nixos" then {
isponsorblocktv-setup = "podman run --rm -it -v ~/isponsorblocktv/:/app/data ghcr.io/dmunozv04/isponsorblocktv --setup";
}
else
{};
globalShellAbbrs = baseAbbrs // hostnameAbbrs;
in
{
stylix.enableReleaseChecks = false;
home.username = "alisceon";
home.homeDirectory = "/home/alisceon";
home.stateVersion = "24.05";
manual.manpages.enable = true;
programs = {
fish = {
enable = false;
# Disable greeting
interactiveShellInit = ''
set fish_greeting
'';
preferAbbrs = true;
shellAbbrs = globalShellAbbrs // {
ls = "exa";
ll = "exa -lah";
grep = "rg";
pypod = "podman run --rm -it --network host -v '.:/run' -w '/run' python /run/";
devi = "nix flake init -t templates#";
};
}; # end fish
nushell = {
enable = false;
configFile.source = ../conf/config.nu;
shellAliases = globalShellAbbrs // {
};
};
git = {
enable = true;
settings = {
user = {
name = "alisceon";
email = "alisceon@protonmail.com";
};
push = { autoSetupRemote = true; };
init.defaultBranch = "main";
};
}; # end git
ssh = {
enable = true;
enableDefaultConfig = false;
matchBlocks = {
"*" = {
forwardAgent = false;
addKeysToAgent = "no";
compression = false;
serverAliveInterval = 0;
serverAliveCountMax = 3;
hashKnownHosts = false;
userKnownHostsFile = "~/.ssh/known_hosts";
controlMaster = "no";
controlPath = "~/.ssh/master-%r@%n:%p";
controlPersist = "no";
};
"alisceon-core" = {
hostname = "core.alisceon.com";
user = "opc";
};
"blogbox-2" = {
hostname = "10.1.0.11";
proxyJump = "alisceon-core";
user = "opc";
};
"blogbox-1" = {
hostname = "10.1.0.247";
proxyJump = "alisceon-core";
user = "opc";
};
"filurbox" = {
hostname = "oci.malice.zone";
user = "opc";
};
"dnspi" = {
hostname = "10.40.0.2";
user = "pi";
};
"inuc" = {
hostname = "inuc.home.the.malice.zone";
};
"tsla-exporter-bridge" = {
hostname = "alma02.lab.the.malice.zone";
user = "root";
};
"tsla-runner-boi" = {
hostname = "alma03.lab.the.malice.zone";
user = "root";
};
"tsla-nixos" = {
hostname = "tesla-nixos.lab.the.malice.zone";
};
"tsla-backups" = {
hostname = "backups.lab.the.malice.zone";
user = "root";
};
"tsla-books" = {
hostname = "books.lab.the.malice.zone";
user = "root";
};
"tower" = {
forwardAgent = true;
addKeysToAgent = "yes";
hostname = "tower.home.the.malice.zone";
};
"electra" = {
forwardAgent = true;
addKeysToAgent = "yes";
hostname = "electra.home.the.malice.zone";
};
}; # end matchBlocks
}; # end ssh
direnv = {
enable = true;
silent = true;
nix-direnv.enable = true;
}; # end direnv
}; # end programs
# nixpkgs config
xdg.configFile."nixpkgs/config.nix".source = ../conf/config.nix;
# xonsh extras
xdg.configFile."xonsh/theo.py".source = ../conf/xonsh/theo.py;
xdg.configFile."xonsh/kittycatsay.py".source = ../conf/xonsh/kittycatsay.py;
# Ensure fish exists for the completer backend
home.packages = [ pkgs.fish ];
} # end file