Files
nixfiles/lyrathorpe/home/desktop.nix
T
Emma Thorpe 829f209300 feat(shell): start tmux in every terminal; ssh-agent with auto-add
Move the tmux auto-start out of the graphical-only desktop layer into the
shared shell config so it also covers WSL, iTerm2 and the Linux console
(folded into programs.zsh.initContent via mkMerge alongside the SSH PS1
block). Same guards: interactive, not-already-in-tmux, not-SSH,
not-VS-Code, tmux-present.

ssh: run a user ssh-agent on Linux (macOS uses launchd) and add keys on
first use (addKeysToAgent), so the passphrase is entered once per login
session instead of per commit/push -- which also feeds commit signing.
macOS additionally caches in the login keychain (UseKeychain). The work
box keeps its own ~/.ssh/config (programs.ssh forced off there); its
ssh-agent still runs via the work module.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 11:30:09 +01:00

99 lines
3.2 KiB
Nix

# Graphical desktop layer: GUI apps, Wayland session env, and cursor theme.
# Imported only on hosts that run Sway (MBP, T400, Mac Pro); never pulled onto
# the headless WSL host. Login (and the Sway session launch) is handled by the
# greetd/ReGreet greeter -- see ../swaywm.nix -- so there is no tty1 autostart.
{
pkgs,
config,
inputs,
username,
...
}:
{
imports = [
./sway.nix
];
home.packages = [
pkgs.element-desktop
pkgs.legcord
pkgs.nemo # file manager (launched via Mod+e, see ./sway.nix)
#pkgs.plex-desktop
#pkgs.plexamp
];
home.sessionVariables = {
MOZ_USE_XINPUT2 = "1";
XDG_CURRENT_DESKTOP = "sway";
};
# Theme GTK apps (nemo, etc.) to match the Catppuccin Mocha desktop. Under
# Sway there is no XSettings daemon, so GTK reads these from the generated
# ~/.config/gtk-{3,4}.0/settings.ini directly. The Mocha theme is dark by
# design, so no separate prefer-dark hint is needed.
gtk = {
enable = true;
# Theme GTK4 apps too (for any added later). GTK4 ignores gtk-theme-name,
# but home-manager turns this into an `@import` of the theme's
# gtk-4.0/gtk.css into ~/.config/gtk-4.0/gtk.css -- which even libadwaita
# honours, since that file overrides the named colours it uses
# (window_bg_color, accent_bg_color, ...). Set explicitly (same value as the
# legacy default) so it also silences the stateVersion<26.05 warning.
gtk4.theme = config.gtk.theme;
theme = {
name = "catppuccin-mocha-blue-standard";
package = pkgs.catppuccin-gtk.override {
accents = [ "blue" ];
variant = "mocha";
};
};
iconTheme = {
name = "Adwaita";
package = pkgs.adwaita-icon-theme;
};
};
home.pointerCursor = {
gtk.enable = true;
x11 = {
enable = true;
defaultCursor = "Adwaita";
};
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
size = 24;
};
# Firefox is themed at the browser level (it does not follow the GTK theme).
# The system installs the binary (programs.firefox in ../user.nix); here
# home-manager owns only the profile, hence package = null. Apply the
# Catppuccin Mocha theme add-on (only the mauve accent is packaged upstream;
# the rest of the desktop uses blue) and make content + UI dark.
programs.firefox = {
enable = true;
package = null;
# Keep the legacy profile location (~/.mozilla/firefox) -- that is where the
# system Firefox actually looks; pin it explicitly to silence the
# stateVersion<26.05 default-change warning (the new XDG path depends on
# Firefox's own profile support).
configPath = ".mozilla/firefox";
profiles.${username} = {
id = 0;
isDefault = true;
extensions = {
force = true;
packages = [
inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}.catppuccin-mocha-mauve
];
};
settings = {
# Enable bundled add-ons automatically so the theme applies on first run.
"extensions.autoDisableScopes" = 0;
# Dark chrome + dark page content.
"ui.systemUsesDarkTheme" = 1;
"layout.css.prefers-color-scheme.content-override" = 0;
};
};
};
}