Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions hosts/lobtop/programs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,78 @@
enable = true;
startOnActivation = true;
};

programs.cmux = {
enable = true;

settings = {
app.minimalMode = true;
notifications.showInMenuBar = false;
ui.surfaceTabBar.buttons = [
"cmux.newTerminal"
"cmux.splitRight"
"cmux.splitDown"
];
workspaceColors = {
notificationBadgeColor = null;
indicatorStyle = "leftRail";
selectionColor = null;
colors = {
Red = "#ff7b72";
Orange = "#ffa657";
Green = "#7ee787";
Blue = "#79c0ff";
Sky = "#a5d6ff";
Purple = "#d2a8ff";
Pink = "#ff6ac1";
Cyan = "#9aedfe";
};
};
shortcuts.bindings = {
openFolder = "";
reopenPreviousSession = "";
goToWorkspace = "cmd+o";
commandPalette = "cmd+p";
nextSurface = "cmd+opt+→";
prevSurface = "cmd+opt+←";
nextSidebarTab = "cmd+opt+↓";
prevSidebarTab = "cmd+opt+↑";
closeOtherTabsInPane = "";
selectSurfaceByNumber = "cmd+1";
selectWorkspaceByNumber = "ctrl+1";
};
};

ghostty = {
settings = {
background = "#131313";
foreground = "#dddddd";
"cursor-color" = "#dddddd";
"selection-background" = "#353436";
"selection-foreground" = "#dddddd";
"font-family" = "MesloLGSDZ Nerd Font Mono";
"font-size" = 12;
"window-padding-x" = 8;
"window-padding-y" = 8;
};
palette = {
"0" = "#131313";
"1" = "#ff5c57";
"2" = "#5af78e";
"3" = "#f3f99d";
"4" = "#57c7ff";
"5" = "#ff6ac1";
"6" = "#9aedfe";
"7" = "#caccca";
"8" = "#686868";
"9" = "#ff7b72";
"10" = "#7ee787";
"11" = "#ffa657";
"12" = "#79c0ff";
"13" = "#d2a8ff";
"14" = "#a5d6ff";
"15" = "#ffffff";
};
};
};
}
102 changes: 102 additions & 0 deletions modules/darwin/programs/cmux.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
config,
lib,
pkgs,
username,
...
}:
with lib; let
cfg = config.programs.cmux;

jsonFormat = pkgs.formats.json {};

valueToString = v:
if isBool v
then boolToString v
else toString v;

ghosttyConfigText =
concatStringsSep "\n" (
mapAttrsToList (k: v: "${k} = ${valueToString v}") cfg.ghostty.settings
++ map (idx: "palette = ${idx}=${cfg.ghostty.palette.${idx}}")
(sort (a: b: toInt a < toInt b) (attrNames cfg.ghostty.palette))
)
+ "\n";
in {
options.programs.cmux = {
enable = mkEnableOption "cmux";

settings = mkOption {
inherit (jsonFormat) type;
default = {};
description = ''
Configuration written to {file}`~/.config/cmux/cmux.json`.
Keys map directly to cmux JSON config fields.
'';
example = literalExpression ''
{
schemaVersion = 1;
app.minimalMode = true;
shortcuts.bindings = {
goToWorkspace = "cmd+o";
commandPalette = "cmd+p";
};
}
'';
};

ghostty = {
settings = mkOption {
type = types.attrsOf (types.oneOf [types.str types.int types.float types.bool]);
default = {};
description = ''
Ghostty settings written to {file}`~/.config/ghostty/config`
as `key = value` pairs.
'';
example = literalExpression ''
{
background = "#131313";
foreground = "#dddddd";
"cursor-color" = "#dddddd";
"font-family" = "MesloLGSDZ Nerd Font Mono";
"font-size" = 12;
}
'';
};

palette = mkOption {
type = types.attrsOf types.str;
default = {};
description = ''
Terminal color palette written as `palette = <index>=<color>` lines
in {file}`~/.config/ghostty/config`. Keys must be numeric strings "0"–"15".
'';
example = literalExpression ''
{
"0" = "#131313";
"1" = "#ff5c57";
"15" = "#ffffff";
}
'';
};
};
};

config = mkIf cfg.enable {
homebrew.casks = ["cmux"];

home-manager.users.${username} = {
xdg.configFile."cmux/cmux.json" = {
source = jsonFormat.generate "cmux-config" ({
"$schema" = "https://raw.githubusercontent.com/manaflow-ai/cmux/main/web/data/cmux.schema.json";
schemaVersion = 1;
}
// cfg.settings);
};

xdg.configFile."ghostty/config" = mkIf (cfg.ghostty.settings != {} || cfg.ghostty.palette != {}) {
text = ghosttyConfigText;
};
};
};
}
1 change: 1 addition & 0 deletions modules/darwin/programs/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
imports = [
./chromium.nix
./cmux.nix
./craft.nix
./daisydisk.nix
./fastscripts.nix
Expand Down
Loading