From aa3e1cedce2023c09e616b892af26765c555441c Mon Sep 17 00:00:00 2001
From: DerGrumpf
Date: Sat, 27 Sep 2025 16:18:13 +0200
Subject: [PATCH] Added: Darwin Config
---
darwin/config.jsonc | 175 ++++++++++++++++++++++++++++++++++++++++++
darwin/flake.nix | 66 +++++++++-------
darwin/home.nix | 19 +++--
darwin/sketchybar.nix | 43 +++++++++++
darwin/yabari.nix | 95 -----------------------
5 files changed, 270 insertions(+), 128 deletions(-)
create mode 100644 darwin/config.jsonc
create mode 100644 darwin/sketchybar.nix
diff --git a/darwin/config.jsonc b/darwin/config.jsonc
new file mode 100644
index 0000000..fb19768
--- /dev/null
+++ b/darwin/config.jsonc
@@ -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",
+ ]
+}
+
diff --git a/darwin/flake.nix b/darwin/flake.nix
index 08ce2e6..2c9f931 100644
--- a/darwin/flake.nix
+++ b/darwin/flake.nix
@@ -21,39 +21,49 @@
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, ... }:
- let
- system = "x86_64-darwin";
- specialArgs = { inherit inputs system; };
- in
- {
- darwinConfigurations = {
- "Phil-Mac" = nix-darwin.lib.darwinSystem {
- inherit system specialArgs;
+ outputs =
+ inputs@{
+ self,
+ nix-darwin,
+ nixpkgs,
+ home-manager,
+ catppuccin,
+ nixvim,
+ ...
+ }:
+ let
+ system = "x86_64-darwin";
+ specialArgs = { inherit inputs system; };
+ in
+ {
+ darwinConfigurations = {
+ "Phil-Mac" = nix-darwin.lib.darwinSystem {
+ inherit system specialArgs;
- modules = [
- # Main Config
- ./configuration.nix
+ modules = [
+ # Main Config
+ ./configuration.nix
- # home manager integration
- home-manager.darwinModules.home-manager {
- home-manager = {
- useGlobalPkgs = true;
- useUserPackages = true;
- users.dergrumpf = import ./home.nix;
- backupFileExtension = "backup";
- extraSpecialArgs = specialArgs;
- sharedModules = [
- inputs.nixvim.homeManagerModules.nixvim
- ];
- };
- }
- ];
+ # home manager integration
+ home-manager.darwinModules.home-manager
+ {
+ home-manager = {
+ useGlobalPkgs = true;
+ useUserPackages = true;
+ users.dergrumpf = import ./home.nix;
+ backupFileExtension = "backup";
+ extraSpecialArgs = specialArgs;
+ sharedModules = [
+ inputs.nixvim.homeManagerModules.nixvim
+ ];
+ };
+ }
+ ];
+ };
};
};
- };
}
diff --git a/darwin/home.nix b/darwin/home.nix
index 550f6bf..62aa5c0 100644
--- a/darwin/home.nix
+++ b/darwin/home.nix
@@ -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; [
diff --git a/darwin/sketchybar.nix b/darwin/sketchybar.nix
new file mode 100644
index 0000000..6eed533
--- /dev/null
+++ b/darwin/sketchybar.nix
@@ -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
+ # '';
+ };
+
+}
diff --git a/darwin/yabari.nix b/darwin/yabari.nix
index e1f5005..4d78afc 100644
--- a/darwin/yabari.nix
+++ b/darwin/yabari.nix
@@ -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
- '';
- };
}