129 lines
3.9 KiB
Nix
129 lines
3.9 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
|
|
{
|
|
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;
|
|
userName = "alisceon";
|
|
userEmail = "alisceon@protonmail.com";
|
|
extraConfig = {
|
|
push = { autoSetupRemote = true; };
|
|
init.defaultBranch = "main";
|
|
};
|
|
}; # end git
|
|
ssh = {
|
|
enable = true;
|
|
matchBlocks = {
|
|
"alisceon-core" = {
|
|
hostname = "core.alisceon.com";
|
|
user = "opc";
|
|
};
|
|
"miscbox" = {
|
|
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";
|
|
};
|
|
"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";
|
|
};
|
|
}; # end matchBlocks
|
|
}; # end ssh
|
|
direnv = {
|
|
enable = true;
|
|
silent = 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
|