Compare commits
8 Commits
25.11
...
3029e3d9a8
| Author | SHA1 | Date | |
|---|---|---|---|
| 3029e3d9a8 | |||
| 3483e26bce | |||
| b3add6ddf8 | |||
| 89994e3fc8 | |||
| 0e9671a45f | |||
| f4078970b2 | |||
| bc42c4dc77 | |||
| 585f9ef5c7 |
@@ -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
|
||||
# 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
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -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 = "--delete-older-than 10d";
|
||||
};
|
||||
|
||||
# Essential programs everyone needs
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -32,7 +32,7 @@ in
|
||||
config = let
|
||||
kodiBasePkg = if cfg.wayland then pkgs.kodi-wayland else pkgs.kodi;
|
||||
kodiPkg = kodiBasePkg.withPackages (pkgs: with pkgs; [
|
||||
jellyfin
|
||||
jellyfin-media-player
|
||||
steam-launcher
|
||||
steam-library
|
||||
youtube
|
||||
|
||||
Reference in New Issue
Block a user