home managing, attempt 2

This commit is contained in:
k3t
2026-03-12 07:17:02 -06:00
parent 8307d9bd72
commit ceda663361
9 changed files with 190 additions and 4 deletions
Generated
+39 -4
View File
@@ -1,6 +1,24 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1773286336,
"narHash": "sha256-+yFtmhOHterllxWmV6YbdevTXpJdGS0mS0UmJ0k9fh0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "7d06e0cefe6e4a1e85b2b3274dcb0b3da242a557",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"impermanence",
@@ -23,8 +41,8 @@
},
"impermanence": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
"home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1769548169,
@@ -57,6 +75,22 @@
}
},
"nixpkgs": {
"locked": {
"lastModified": 1772963539,
"narHash": "sha256-9jVDGZnvCckTGdYT53d/EfznygLskyLQXYwJLKMPsZs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9dcb002ca1690658be4a04645215baea8b95f31d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1768564909,
"narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=",
@@ -72,7 +106,7 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs_3": {
"locked": {
"lastModified": 1773122722,
"narHash": "sha256-FIqHByVqxCprNjor1NqF80F2QQoiiyqanNNefdlvOg4=",
@@ -90,9 +124,10 @@
},
"root": {
"inputs": {
"home-manager": "home-manager",
"impermanence": "impermanence",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_3"
}
}
},
+12
View File
@@ -0,0 +1,12 @@
{
imports = [
./common.nix
];
home.file = {
".profile".text = ''
bash /home/k3t/.car/init.sh
'';
".car/init.sh".source = ../hosts/pi-car/scripts/init.sh;
};
#programs.zsh.loginExtra = "bash /home/k3t/.car/init.sh";
}
+7
View File
@@ -0,0 +1,7 @@
{
programs.git = {
enable = true;
userName = "k3t";
userEmail = "k3t@k3t.dev";
};
}
+38
View File
@@ -0,0 +1,38 @@
{
programs.htop.settings = {
color_scheme = 0;
cpu_count_from_one = 0;
delay = 1;
fields = with config.lib.htop.fields; [
PID
USER
PRIORITY
NICE
M_SIZE
M_RESIDENT
M_SHARE
STATE
PERCENT_CPU
PERCENT_MEM
TIME
COMM
];
highlight_base_name = 1;
highlight_megabytes = 1;
highlight_threads = 1;
detailed_cpu_time = 1;
show_cpu_usage = 1;
show_cpu_frequency = 1;
show_cpu_temperature = 1;
} // (with config.lib.htop; leftMeters [
(bar "AllCPUs2")
(bar "Memory")
(bar "Swap")
(text "Zram")
]) // (with config.lib.htop; rightMeters [
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
(text "Systemd")
]);
}
+17
View File
@@ -0,0 +1,17 @@
{
programs.zsh = {
enable = true;
enableCompletion = true;
enableVteIntegration = true;
autocd = true;
autosuggestion.enable = true;
oh-my-zsh = {
enable = true;
plugins = [
"git" "sudo"
];
theme = "agnoster";
};
};
}
+12
View File
@@ -0,0 +1,12 @@
{ config, ... }:
{
imports = [
./cfg/git.nix
./cfg/htop.nix
./cfg/zsh.nix
];
home.username = "k3t";
home.homeDirectory = "/home/k3t";
}
+5
View File
@@ -0,0 +1,5 @@
{
imports = [
./common.nix
];
}
+5
View File
@@ -0,0 +1,5 @@
{
imports = [
./common.nix
];
}
+55
View File
@@ -0,0 +1,55 @@
# Pontiac G5 Pi AUX Unit (i dont know wtf to name this thing)
if [ -z ${SSH_CLIENT+x} ]; then echo "not running over ssh"; else exit; fi
clear
cat <<EOF
██╗ ██╗██████╗ ████████╗██╗ ██╗██╗ ██╗███████╗ ██████╗ ███████╗██╗ ██╗███████╗██╗ ██████╗ ██████╗ ███╗ ███╗███████╗███╗ ██╗████████╗
██║ ██╔╝╚════██╗╚══██╔══╝╚██╗██╔╝╚██╗ ██╔╝╚══███╔╝ ██╔══██╗██╔════╝██║ ██║██╔════╝██║ ██╔═══██╗██╔══██╗████╗ ████║██╔════╝████╗ ██║╚══██╔══╝
█████╔╝ █████╔╝ ██║ ╚███╔╝ ╚████╔╝ ███╔╝ ██║ ██║█████╗ ██║ ██║█████╗ ██║ ██║ ██║██████╔╝██╔████╔██║█████╗ ██╔██╗ ██║ ██║
██╔═██╗ ╚═══██╗ ██║ ██╔██╗ ╚██╔╝ ███╔╝ ██║ ██║██╔══╝ ╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║██╔═══╝ ██║╚██╔╝██║██╔══╝ ██║╚██╗██║ ██║
██║ ██╗██████╔╝ ██║██╗██╔╝ ██╗ ██║ ███████╗ ██████╔╝███████╗ ╚████╔╝ ███████╗███████╗╚██████╔╝██║ ██║ ╚═╝ ██║███████╗██║ ╚████║ ██║
╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚══════╝ ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝
EOF
# Functions
logger() {
local message="$*"
local timestamp=$(date '+%b %e %H:%M:%S') # e.g., Mar 8 14:35:22
local hostname=$(hostname)
local pid=$$ # PID of the current script
echo "$timestamp g5pi[$pid]: $message"
}
# bluetooth network loop
netloop() {
# Exit if already locked
[[ -e /dev/shm/netloop ]] && return 0
touch /dev/shm/netloop
while :; do
# Check if "Pixel 6a Network" is active
if ! nmcli -t -f NAME connection show --active | grep -qx "Pixel 6a Network"; then
#echo "Connecting to Pixel 6a Network..."
nmcli connection up "Pixel 6a Network"
fi
sleep 5
done
}
echo "$(date) [g5pi] starting up.."
journalctl -f &
# bump up that aux to the highest it can be
pactl set-sink-volume alsa_output.platform-fe00b840.mailbox.stereo-fallback 100%
# Bluetooth preparation
bluetoothctl <<EOF
power on
agent NoInputNoOutput
default-agent
system-alias "Pontiac G5"
discoverable on
pairable on
EOF
netloop &
tail