Compare commits
15 Commits
25.11
...
0c1190f39c
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c1190f39c | |||
| 00f05d1bb2 | |||
| 4e6c6ab81d | |||
| 04e1a8563c | |||
| 7278dc8306 | |||
| 066eea2999 | |||
| 80633142fb | |||
| 3029e3d9a8 | |||
| 3483e26bce | |||
| b3add6ddf8 | |||
| 89994e3fc8 | |||
| 0e9671a45f | |||
| f4078970b2 | |||
| bc42c4dc77 | |||
| 585f9ef5c7 |
@@ -53,7 +53,7 @@
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
unstable = import nixpkgs-unstable {
|
||||
system = prev.system;
|
||||
system = prev.stdenv.hostPlatform.system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
custom = prev.callPackage ./packages {};
|
||||
@@ -81,7 +81,7 @@
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
unstable = import nixpkgs-unstable {
|
||||
system = prev.system;
|
||||
system = prev.stdenv.hostPlatform.system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
custom = prev.callPackage ./packages {};
|
||||
@@ -107,7 +107,7 @@
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
unstable = import nixpkgs-unstable {
|
||||
system = prev.system;
|
||||
system = prev.stdenv.hostPlatform.system;
|
||||
config.allowUnfree = true;
|
||||
overlays = [
|
||||
# Override claude-code in unstable to use our custom GCS-based build
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
# Enable all desktop roles for full-featured experience
|
||||
home.roles = {
|
||||
"3d-printing".enable = true;
|
||||
base.enable = true;
|
||||
desktop.enable = true;
|
||||
office.enable = true;
|
||||
|
||||
22
home/roles/3d-printing/default.nix
Normal file
22
home/roles/3d-printing/default.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles."3d-printing";
|
||||
in
|
||||
{
|
||||
options.home.roles."3d-printing" = {
|
||||
enable = mkEnableOption "Enable 3D printing applications and tools";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
# 3D Slicing Software
|
||||
orca-slicer # G-code generator for 3D printers (Bambu, Prusa, Voron, etc.)
|
||||
|
||||
# 3D Modeling Software
|
||||
openscad-unstable # 3D parametric model compiler (nightly build)
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -298,7 +298,7 @@ in
|
||||
gaps = {
|
||||
outer = {
|
||||
top = 0;
|
||||
bottom = 40;
|
||||
bottom = 38;
|
||||
left = 0;
|
||||
right = 0;
|
||||
};
|
||||
@@ -337,8 +337,8 @@ in
|
||||
FOCUSED=0xff285577
|
||||
|
||||
# Background colors matching i3blocks bar
|
||||
BAR_BG=0xcc000000 # Semi-transparent black
|
||||
ITEM_BG=0xff333333 # Dark gray for inactive items
|
||||
BAR_BG=0xff333333 # Dark gray
|
||||
ITEM_BG=0xff333333 # Dark gray matching bar
|
||||
|
||||
# Text colors
|
||||
TEXT=0xffffffff # White text
|
||||
@@ -351,29 +351,32 @@ in
|
||||
# Configure the bar appearance
|
||||
${pkgs.sketchybar}/bin/sketchybar --bar \
|
||||
position=bottom \
|
||||
height=32 \
|
||||
height=30 \
|
||||
color=$BAR_BG \
|
||||
border_width=0 \
|
||||
corner_radius=0 \
|
||||
padding_left=10 \
|
||||
padding_right=10
|
||||
padding_right=10 \
|
||||
shadow=off \
|
||||
topmost=on \
|
||||
sticky=on
|
||||
|
||||
# Set default properties for all items
|
||||
# Using monospace font to match waybar's Fira Code styling
|
||||
${pkgs.sketchybar}/bin/sketchybar --default \
|
||||
updates=when_shown \
|
||||
icon.font="SF Mono:Regular:13.0" \
|
||||
icon.font="Fira Code:Regular:13.0" \
|
||||
icon.color=$TEXT \
|
||||
icon.padding_left=4 \
|
||||
icon.padding_right=4 \
|
||||
label.font="SF Mono:Regular:13.0" \
|
||||
label.font="Fira Code:Regular:13.0" \
|
||||
label.color=$TEXT \
|
||||
label.padding_left=4 \
|
||||
label.padding_right=4 \
|
||||
padding_left=4 \
|
||||
padding_right=4 \
|
||||
background.corner_radius=5 \
|
||||
background.height=24
|
||||
background.corner_radius=0 \
|
||||
background.height=30
|
||||
|
||||
# Register aerospace workspace change event
|
||||
${pkgs.sketchybar}/bin/sketchybar --add event aerospace_workspace_change
|
||||
@@ -390,11 +393,12 @@ in
|
||||
${pkgs.sketchybar}/bin/sketchybar --add item space.$sid left \
|
||||
--subscribe space.$sid aerospace_workspace_change \
|
||||
--set space.$sid \
|
||||
drawing=on \
|
||||
update_freq=2 \
|
||||
width=32 \
|
||||
background.color=$ITEM_BG \
|
||||
background.corner_radius=5 \
|
||||
background.height=20 \
|
||||
background.corner_radius=0 \
|
||||
background.height=30 \
|
||||
background.drawing=on \
|
||||
icon="$display" \
|
||||
icon.padding_left=13 \
|
||||
@@ -405,15 +409,6 @@ in
|
||||
script="$PLUGIN_DIR/aerospace.sh $sid"
|
||||
done
|
||||
|
||||
# Separator after workspaces
|
||||
${pkgs.sketchybar}/bin/sketchybar --add item separator_left left \
|
||||
--set separator_left \
|
||||
icon="" \
|
||||
label="" \
|
||||
background.drawing=off \
|
||||
padding_left=10 \
|
||||
padding_right=10
|
||||
|
||||
# System monitoring modules (right side)
|
||||
# Note: Items added to 'right' appear in reverse order (last added = leftmost)
|
||||
# Adding in reverse to get: disk | cpu | memory | battery | volume | calendar
|
||||
@@ -425,14 +420,6 @@ in
|
||||
background.drawing=on \
|
||||
script="$PLUGIN_DIR/calendar.sh"
|
||||
|
||||
${pkgs.sketchybar}/bin/sketchybar --add item separator_media right \
|
||||
--set separator_media \
|
||||
icon="|" \
|
||||
label="" \
|
||||
background.drawing=off \
|
||||
padding_left=5 \
|
||||
padding_right=5
|
||||
|
||||
${pkgs.sketchybar}/bin/sketchybar --add item volume right \
|
||||
--set volume \
|
||||
background.color=$ITEM_BG \
|
||||
@@ -448,14 +435,6 @@ in
|
||||
script="$PLUGIN_DIR/battery.sh" \
|
||||
--subscribe battery system_woke power_source_change
|
||||
|
||||
${pkgs.sketchybar}/bin/sketchybar --add item separator_sys right \
|
||||
--set separator_sys \
|
||||
icon="|" \
|
||||
label="" \
|
||||
background.drawing=off \
|
||||
padding_left=5 \
|
||||
padding_right=5
|
||||
|
||||
${pkgs.sketchybar}/bin/sketchybar --add item memory right \
|
||||
--set memory \
|
||||
update_freq=5 \
|
||||
@@ -528,8 +507,15 @@ in
|
||||
# Get list of empty workspaces
|
||||
EMPTY_WORKSPACES=$(${pkgs.aerospace}/bin/aerospace list-workspaces --monitor all --empty)
|
||||
|
||||
# Clean up the workspace number parameter
|
||||
WORKSPACE_NUM=$(echo "$1" | tr -d ' \n\r')
|
||||
# Get workspace number - from $1 if provided (event-triggered), otherwise extract from $NAME (routine update)
|
||||
# $NAME is always available (e.g., "space.1", "space.2", etc.)
|
||||
# $1 is only available when called via event trigger with positional argument
|
||||
if [ -n "$1" ]; then
|
||||
WORKSPACE_NUM=$(echo "$1" | tr -d ' \n\r')
|
||||
else
|
||||
# Extract number from item name: "space.1" -> "1", "space.10" -> "10"
|
||||
WORKSPACE_NUM=$(echo "$NAME" | sed 's/space\.//')
|
||||
fi
|
||||
|
||||
# Check if workspace has windows (is NOT empty)
|
||||
IS_EMPTY=false
|
||||
@@ -543,37 +529,55 @@ in
|
||||
IS_FOCUSED=true
|
||||
fi
|
||||
|
||||
# Determine display value (workspace 10 displays as "0")
|
||||
if [ "$WORKSPACE_NUM" = "10" ]; then
|
||||
DISPLAY="0"
|
||||
else
|
||||
DISPLAY="$WORKSPACE_NUM"
|
||||
fi
|
||||
|
||||
# Determine visibility and styling
|
||||
# Always show focused workspace (even if empty) with fixed width
|
||||
# Hide non-focused empty workspaces by setting width to 0 (collapsed)
|
||||
# Show non-focused non-empty workspaces with fixed width and inactive styling
|
||||
|
||||
if [ "$IS_FOCUSED" = "true" ]; then
|
||||
# Focused workspace - always show with focused styling
|
||||
# Focused workspace - always show with focused styling and bold font
|
||||
${pkgs.sketchybar}/bin/sketchybar --set space.$WORKSPACE_NUM \
|
||||
drawing=on \
|
||||
icon="$DISPLAY" \
|
||||
width=32 \
|
||||
icon.padding_left=13 \
|
||||
icon.padding_right=11 \
|
||||
icon.align=center \
|
||||
background.color=$FOCUSED_COLOR \
|
||||
background.drawing=on \
|
||||
icon.color=$TEXT
|
||||
icon.color=$TEXT \
|
||||
icon.font="Fira Code:Bold:13.0"
|
||||
elif [ "$IS_EMPTY" = "true" ]; then
|
||||
# Empty workspace (not focused) - hide by turning off drawing
|
||||
${pkgs.sketchybar}/bin/sketchybar --set space.$WORKSPACE_NUM \
|
||||
drawing=off
|
||||
else
|
||||
# Non-empty workspace (not focused) - show with inactive styling
|
||||
# Empty workspace (not focused) - hide by collapsing width and clearing content
|
||||
# Using width=0 with drawing=on so updates=when_shown continues to run the script
|
||||
${pkgs.sketchybar}/bin/sketchybar --set space.$WORKSPACE_NUM \
|
||||
drawing=on \
|
||||
icon="" \
|
||||
label="" \
|
||||
width=0 \
|
||||
icon.padding_left=0 \
|
||||
icon.padding_right=0 \
|
||||
background.drawing=off
|
||||
else
|
||||
# Non-empty workspace (not focused) - show with inactive styling and white text
|
||||
${pkgs.sketchybar}/bin/sketchybar --set space.$WORKSPACE_NUM \
|
||||
drawing=on \
|
||||
icon="$DISPLAY" \
|
||||
width=32 \
|
||||
icon.padding_left=13 \
|
||||
icon.padding_right=11 \
|
||||
icon.align=center \
|
||||
background.color=$ITEM_BG \
|
||||
background.drawing=on \
|
||||
icon.color=$GRAY
|
||||
icon.color=$TEXT \
|
||||
icon.font="Fira Code:Regular:13.0"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
@@ -595,21 +599,28 @@ in
|
||||
};
|
||||
|
||||
# SketchyBar memory monitoring plugin
|
||||
# Shows actual memory pressure (excludes file cache/inactive pages)
|
||||
home.file.".config/sketchybar/plugins/memory.sh" = mkIf cfg.sketchybar.enable {
|
||||
executable = true;
|
||||
text = ''
|
||||
#!/bin/bash
|
||||
|
||||
MEMORY_STATS=$(vm_stat)
|
||||
PAGES_FREE=$(echo "$MEMORY_STATS" | grep "Pages free" | awk '{print $3}' | tr -d '.')
|
||||
PAGES_ACTIVE=$(echo "$MEMORY_STATS" | grep "Pages active" | awk '{print $3}' | tr -d '.')
|
||||
PAGES_INACTIVE=$(echo "$MEMORY_STATS" | grep "Pages inactive" | awk '{print $3}' | tr -d '.')
|
||||
PAGES_WIRED=$(echo "$MEMORY_STATS" | grep "Pages wired down" | awk '{print $4}' | tr -d '.')
|
||||
PAGES_COMPRESSED=$(echo "$MEMORY_STATS" | grep "Pages stored in compressor" | awk '{print $5}' | tr -d '.')
|
||||
|
||||
TOTAL_PAGES=$((PAGES_FREE + PAGES_ACTIVE + PAGES_INACTIVE + PAGES_WIRED + PAGES_COMPRESSED))
|
||||
USED_PAGES=$((PAGES_ACTIVE + PAGES_INACTIVE + PAGES_WIRED + PAGES_COMPRESSED))
|
||||
MEMORY_PERCENT=$((USED_PAGES * 100 / TOTAL_PAGES))
|
||||
# Use awk for all arithmetic to avoid bash integer overflow on large RAM systems
|
||||
# Memory pressure = Anonymous (app memory) + Wired + Compressor RAM
|
||||
# - Anonymous pages: app-allocated memory (heap, stack) - matches Activity Monitor's "App Memory"
|
||||
# - Wired: kernel/system memory that can't be paged out
|
||||
# - Pages occupied by compressor: actual RAM used by compressor (NOT "stored in compressor")
|
||||
TOTAL_RAM=$(sysctl -n hw.memsize)
|
||||
MEMORY_PERCENT=$(vm_stat | awk -v total_ram="$TOTAL_RAM" '
|
||||
/page size of/ { page_size = $8 }
|
||||
/Anonymous pages/ { anon = $3 + 0 }
|
||||
/Pages wired/ { wired = $4 + 0 }
|
||||
/Pages occupied by compressor/ { compressor = $5 + 0 }
|
||||
END {
|
||||
used = (anon + wired + compressor) * page_size
|
||||
printf "%.0f", used / total_ram * 100
|
||||
}
|
||||
')
|
||||
|
||||
${pkgs.sketchybar}/bin/sketchybar --set $NAME label="$MEMORY_PERCENT%"
|
||||
'';
|
||||
|
||||
@@ -4,4 +4,8 @@
|
||||
imports = [
|
||||
../aerospace
|
||||
];
|
||||
|
||||
# Override to use -d instead of --delete-older-than on Darwin due to launchd bug
|
||||
# https://github.com/nix-community/home-manager/issues/7211
|
||||
nix.gc.options = "-d";
|
||||
}
|
||||
|
||||
@@ -24,6 +24,17 @@ in
|
||||
tree
|
||||
];
|
||||
|
||||
# Automatic garbage collection for user profile (home-manager generations).
|
||||
# This complements system-level gc which only cleans system generations.
|
||||
# - Linux: Uses --delete-older-than to keep 10-day rollback window
|
||||
# - Darwin: Overridden to use -d in base-darwin role to avoid launchd bug
|
||||
# (https://github.com/nix-community/home-manager/issues/7211)
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
randomizedDelaySec = mkIf pkgs.stdenv.isLinux "14m";
|
||||
options = lib.mkDefault "--delete-older-than 10d";
|
||||
};
|
||||
|
||||
# Essential programs everyone needs
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
@@ -41,9 +52,9 @@ in
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "John Ogle";
|
||||
userEmail = "john@ogle.fyi";
|
||||
extraConfig = {
|
||||
settings = {
|
||||
user.name = "John Ogle";
|
||||
user.email = "john@ogle.fyi";
|
||||
safe.directory = "/etc/nixos";
|
||||
};
|
||||
};
|
||||
@@ -58,8 +69,11 @@ in
|
||||
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
addKeysToAgent = "yes";
|
||||
enableDefaultConfig = false;
|
||||
matchBlocks = {
|
||||
"*" = {
|
||||
addKeysToAgent = "yes";
|
||||
};
|
||||
"nucdeb1" = {
|
||||
hostname = "nucdeb1.oglehome";
|
||||
user = "root";
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# Platform-specific roles are imported via base-linux or base-darwin
|
||||
# in each home configuration file
|
||||
imports = [
|
||||
./3d-printing
|
||||
./base
|
||||
./communication
|
||||
./desktop
|
||||
|
||||
@@ -343,7 +343,7 @@ in {
|
||||
|
||||
modules-left = [ "sway/workspaces" "sway/mode" ];
|
||||
modules-center = [ ];
|
||||
modules-right = [ "disk" "cpu" "memory" "pulseaudio" "backlight" "network" "battery" "tray" "clock" ];
|
||||
modules-right = [ "disk" "cpu" "memory" "pulseaudio" "custom/backlight-ddc" "backlight" "network" "battery" "tray" "clock" ];
|
||||
|
||||
"sway/workspaces" = {
|
||||
disable-scroll = true;
|
||||
@@ -400,6 +400,23 @@ in {
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
"custom/backlight-ddc" = {
|
||||
exec = pkgs.writeShellScript "waybar-backlight-ddc" ''
|
||||
if command -v ddcutil &>/dev/null; then
|
||||
# Display current brightness
|
||||
brightness=$(ddcutil getvcp 10 --brief 2>/dev/null | awk '{print $4}')
|
||||
if [ -n "$brightness" ]; then
|
||||
echo "☀️ $brightness%"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
interval = 5;
|
||||
format = "{}";
|
||||
on-scroll-up = "ddcutil setvcp 10 + 5 2>/dev/null &";
|
||||
on-scroll-down = "ddcutil setvcp 10 - 5 2>/dev/null &";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
"network" = {
|
||||
format-wifi = "📶 {essid} ({signalStrength}%)";
|
||||
format-ethernet = "🔌 {ipaddr}";
|
||||
|
||||
@@ -14,6 +14,11 @@ in
|
||||
wayland = mkOption {
|
||||
default = true;
|
||||
};
|
||||
jellyfinScaleFactor = mkOption {
|
||||
type = types.nullOr types.float;
|
||||
default = null;
|
||||
description = "Scale factor for Jellyfin Media Player UI (e.g., 1.5 for 150% scaling)";
|
||||
};
|
||||
appLauncherServer = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
@@ -37,6 +42,19 @@ in
|
||||
steam-library
|
||||
youtube
|
||||
]);
|
||||
|
||||
jellyfinMediaPlayerPkg =
|
||||
if cfg.jellyfinScaleFactor != null
|
||||
then pkgs.symlinkJoin {
|
||||
name = "jellyfin-media-player-scaled";
|
||||
paths = [ pkgs.jellyfin-media-player ];
|
||||
buildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/jellyfinmediaplayer \
|
||||
--add-flags "--scale-factor ${toString cfg.jellyfinScaleFactor}"
|
||||
'';
|
||||
}
|
||||
else pkgs.jellyfin-media-player;
|
||||
in mkIf cfg.enable
|
||||
{
|
||||
users.extraUsers.kodi = {
|
||||
@@ -50,11 +68,18 @@ in
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
jellyfinMediaPlayerPkg
|
||||
kodiPkg
|
||||
wget
|
||||
firefox
|
||||
] ++ optional cfg.appLauncherServer.enable pkgs.custom.app-launcher-server;
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = lib.warn
|
||||
"Allowing insecure package qtwebengine-5.15.19 as a jellyfin-media-player dependency. Remove this once jellyfin is updated to use qt6"
|
||||
[
|
||||
"qtwebengine-5.15.19"
|
||||
];
|
||||
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
systemd.user.services = mkIf cfg.appLauncherServer.enable {
|
||||
|
||||
@@ -25,7 +25,7 @@ in
|
||||
users.users.johno = {
|
||||
isNormalUser = true;
|
||||
description = "John Ogle";
|
||||
extraGroups = [ "wheel" "networkmanager" "audio" "video" ] ++ cfg.extraGroups;
|
||||
extraGroups = [ "wheel" "networkmanager" "audio" "video" "i2c" ] ++ cfg.extraGroups;
|
||||
};
|
||||
|
||||
users.users.eli = mkIf cfg.kids {
|
||||
|
||||
Reference in New Issue
Block a user