Added: Darwin Config

This commit is contained in:
2025-09-27 16:18:13 +02:00
parent 26461fbf13
commit aa3e1cedce
5 changed files with 270 additions and 128 deletions

175
darwin/config.jsonc Normal file
View File

@@ -0,0 +1,175 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "kitty-icat",
"source": "~/Pictures/Avatar/avatar_no_bg.png",
//"height": 15,
"width": 40,
"padding": {
"top": 0,
"left": 0
}
},
"modules": [
"break",
{
"type": "custom",
"format": "\u001b[90m┌──────────────────────Hardware──────────────────────┐"
},
{
"type": "host",
"key": " PC",
"keyColor": "green"
},
{
"type": "cpu",
"key": "│ ├",
"keyColor": "green"
},
{
"type": "gpu",
"key": "│ ├󰍛",
"keyColor": "green"
},
{
"type": "memory",
"key": "│ ├󰍛",
"keyColor": "green"
},
{
"type": "disk",
"key": "│ ├",
"keyColor": "green"
},
{
"type": "memory",
"key": "└ └󰍛",
"keyColor": "green"
},
{
"type": "custom",
"format": "\u001b[90m└────────────────────────────────────────────────────┘"
},
"break",
{
"type": "custom",
"format": "\u001b[90m┌──────────────────────Software──────────────────────┐"
},
{
"type": "os",
"key": " OS",
"keyColor": "yellow"
},
{
"type": "kernel",
"key": "│ ├",
"keyColor": "yellow"
},
{
"type": "bios",
"key": "│ ├",
"keyColor": "yellow"
},
{
"type": "packages",
"key": "│ ├󰏖",
"keyColor": "yellow"
},
{
"type": "shell",
"key": "└ └",
"keyColor": "yellow"
},
"break",
{
"type": "de",
"key": " DE",
"keyColor": "blue"
},
{
"type": "lm",
"key": "│ ├",
"keyColor": "blue"
},
{
"type": "wm",
"key": "│ ├",
"keyColor": "blue"
},
{
"type": "wmtheme",
"key": "│ ├󰉼",
"keyColor": "blue"
},
{
"type": "terminal",
"key": "└ └",
"keyColor": "blue"
},
{
"type": "custom",
"format": "\u001b[90m└────────────────────────────────────────────────────┘"
},
"break",
{
"type": "custom",
"format": "\u001b[90m┌─────────────────Uptime / Age / DT──────────────────┐"
},
{
"type": "command",
"key": " OS Age ",
"keyColor": "magenta",
"text": "birth_install=$(stat -c %W /); current=$(date +%s); time_progression=$((current - birth_install)); days_difference=$((time_progression / 86400)); echo $days_difference days"
},
{
"type": "uptime",
"key": " Uptime ",
"keyColor": "magenta"
},
{
"type": "datetime",
"key": " DateTime ",
"keyColor": "magenta"
},
{
"type": "custom",
"format": "\u001b[90m└────────────────────────────────────────────────────┘"
},
"break",
{
"type": "custom",
"format": "\u001b[90m┌─────────────────────Networking─────────────────────┐"
},
{
"type": "publicip",
"key": " Public ",
"keyColor": "magenta"
},
{
"type": "localip",
"key": " Local ",
"keyColor": "magenta"
},
{
"type": "dns",
"key": " DNS ",
"keyColor": "magenta"
},
{
"type": "netio",
"key": " Net I/O ",
"keyColor": "magenta"
},
{
"type": "custom",
"format": "\u001b[90m└────────────────────────────────────────────────────┘"
},
{
"type": "colors",
"paddingLeft": 2,
"symbol": "circle"
},
"break",
]
}

View File

@@ -21,11 +21,20 @@
inputs.nixpkgs.follows = "nixpkgs";
};
sketchybar-config.url = "github:kcraft059/sketchybar-config";
catppuccin.url = "github:catppuccin/nix";
};
outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, catppuccin, nixvim, ... }:
outputs =
inputs@{
self,
nix-darwin,
nixpkgs,
home-manager,
catppuccin,
nixvim,
...
}:
let
system = "x86_64-darwin";
specialArgs = { inherit inputs system; };
@@ -40,7 +49,8 @@
./configuration.nix
# home manager integration
home-manager.darwinModules.home-manager {
home-manager.darwinModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;

View File

@@ -1,19 +1,28 @@
{
config,
pkgs,
lib,
darwinConfig,
...
}:
{
imports = [ ];
imports = [ ./sketchybar.nix ];
home.username = "dergrumpf";
home.homeDirectory = "/Users/dergrumpf";
home.stateVersion = "23.11";
home.file = {
"Pictures/Avatar" = {
source = ../avatar;
recursive = true;
};
};
home.file = {
"Pictures/Wallpapers" = {
source = ../wallpapers;
recursive = true;
};
};
home.file.".config/fastfetch/config.jsonc".source = ./config.jsonc;
programs.home-manager.enable = true;
home.packages = with pkgs; [

43
darwin/sketchybar.nix Normal file
View File

@@ -0,0 +1,43 @@
{
inputs,
pkgs,
...
}:
{
home.packages = with pkgs; [
sketchybar-app-font
# menubar-cli # (needs to come from an overlay, check https://github.com/Kcraft059/Nix-Config/blob/master/overlays/menubar-cli.nix for implementation - bin by @FelixKratz)
];
programs.sketchybar = {
enable = true;
service = rec {
enable = true;
errorLogFile = "/tmp/sketchybar.log";
outLogFile = errorLogFile;
};
configType = "bash";
config = {
source = "${inputs.sketchybar-config}"; # flake input path
recursive = true; # copy entire tree
};
extraPackages = with pkgs; [
# menubar-cli # see above
imagemagick
macmon
];
};
# Example of providing dynamic icon map or other generated files
xdg.configFile = {
"sketchybar/dyn-icon_map.sh".source = "${pkgs.sketchybar-app-font}/bin/icon_map.sh";
# Optional: inline user overrides without forking
# "sketchybar/config.sh".text = ''
# NOTCH_WIDTH=200
# MUSIC_INFO_WIDTH=100
# '';
};
}

View File

@@ -67,99 +67,4 @@
ctrl - q : open -a kitty --args --directory="~"
'';
};
services.sketchybar = {
enable = true;
config = ''
# Bar configuration (batched together for efficiency)
sketchybar --bar color=0x1e1e2e \
border_color=0xffff9e2e \
position=top \
height=25 \
notch_display_height=0 \
margin=0 \
y_offset=0 \
corner_radius=0 \
border_width=2 \
blur_radius=0 \
padding_left=0 \
padding_right=2 \
notch_width=200 \
notch_offset=0 \
display=all \
hidden=off \
topmost=off \
sticky=on \
font_smoothing=off \
shadow=off
# Default item properties
sketchybar --default updates=when_shown \
icon.font="Hack Nerd Font:Bold:14.0" \
icon.color=0xffcdd6f4 \
label.font="Hack Nerd Font:Regular:12.0" \
label.color=0xffcdd6f4
# Left items - Date and time
sketchybar --add item date left \
--set date icon= \
label="$(date '+%a %d %b')" \
script='while true; do sketchybar --set date label="$(date "+%a %d %b")"; sleep 300; done' \
update_freq=300
sketchybar --add item time left \
--set time icon= \
label="$(date '+%H:%M')" \
script='while true; do sketchybar --set time label="$(date "+%H:%M")"; sleep 60; done' \
update_freq=60
# Center items - Active window title
sketchybar --add item title center \
--set title label="Desktop" \
script='sketchybar --set title label="$INFO"'
# Right items - System info
sketchybar --add item cpu right \
--set cpu icon= \
label="?" \
script='~/.config/sketchybar/plugins/cpu.sh' \
update_freq=5
sketchybar --add item ram right \
--set ram icon= \
label="?" \
script='~/.config/sketchybar/plugins/ram.sh' \
update_freq=5
sketchybar --add item battery right \
--set battery icon= \
label="?" \
script='~/.config/sketchybar/plugins/battery.sh' \
update_freq=10
sketchybar --add item volume right \
--set volume icon= \
label="?" \
script='~/.config/sketchybar/plugins/volume.sh' \
update_freq=1
sketchybar --add item wifi right \
--set wifi icon= \
label="?" \
script='~/.config/sketchybar/plugins/wifi.sh' \
update_freq=10
# Spacing items
sketchybar --add item spacer_left left \
--set spacer_left width=10
sketchybar --add item spacer_right right \
--set spacer_right width=10
# Subscribe to events
sketchybar --subscribe title front_app_switched \
volume volume_change \
battery power_source_change system_woke
'';
};
}