From 760e3533351a050b6cda7ce99b2fb5a1833b4b89 Mon Sep 17 00:00:00 2001 From: Erik Simon Date: Wed, 21 Oct 2026 11:33:03 +0200 Subject: [PATCH] feat(titan): Zenbook laptop on a shared workstation profile terra's desktop is split into profiles/workstation.nix (NixOS side) and home/desktop/ (home-manager side, moved from hosts/terra/home*), so titan, an ASUS Zenbook Pro Duo UX581 (Intel iGPU + RTX 2060 PRIME offload), gets the same Hyprland workstation. Per-host monitors, primary/secondary output and wallpaper are homelab.desktop.* options; the quickshell widgets read the outputs from QS_PRIMARY_OUTPUT/QS_SECONDARY_OUTPUT instead of hardcoding DP-2/HDMI-A-1. Folder icons come from a new HyprChrome-Folders icon theme. titan gets its own sops file and recipient. LibreChat is removed from terra along with its secrets declarations. Co-Authored-By: Claude Opus 5.5 --- .sops.yaml | 4 + CLAUDE.md | 5 +- dotfiles/quickshell/CLAUDE.md | 2 +- .../quickshell/HyprChrome/DebugWindow.qml | 3 +- .../HyprChrome/Widgets/HyprChromeShell.qml | 7 +- .../Widgets/Polkit/PolkitPrompt.qml | 2 +- dotfiles/quickshell/shell.qml | 2 +- dotfiles/quickshell/widgets/osd/VolumeOsd.qml | 2 +- flake.nix | 16 +- home/common.nix | 4 +- .../home.nix => home/desktop/default.nix | 6 +- .../terra/home => home/desktop}/hyprland.nix | 41 ++-- home/desktop/options.nix | 26 ++ {hosts/terra/home => home/desktop}/theme.nix | 25 +- hosts/terra/configuration.nix | 129 +--------- hosts/terra/secrets.nix | 27 +-- hosts/titan/configuration.nix | 55 +++++ hosts/titan/disk-config.nix | 40 +++ hosts/titan/hardware-configuration.nix | 21 ++ hosts/titan/secrets.nix | 16 ++ pkgs/hyprchrome-folders.nix | 229 ++++++++++++++++++ profiles/workstation.nix | 147 +++++++++++ secrets/titan.yaml | 30 +++ services/desktop/desktop-apps.nix | 5 +- services/desktop/librechat.nix | 87 ------- 25 files changed, 652 insertions(+), 279 deletions(-) rename hosts/terra/home.nix => home/desktop/default.nix (96%) rename {hosts/terra/home => home/desktop}/hyprland.nix (91%) create mode 100644 home/desktop/options.nix rename {hosts/terra/home => home/desktop}/theme.nix (70%) create mode 100644 hosts/titan/configuration.nix create mode 100644 hosts/titan/disk-config.nix create mode 100644 hosts/titan/hardware-configuration.nix create mode 100644 hosts/titan/secrets.nix create mode 100644 pkgs/hyprchrome-folders.nix create mode 100644 profiles/workstation.nix create mode 100644 secrets/titan.yaml delete mode 100644 services/desktop/librechat.nix diff --git a/.sops.yaml b/.sops.yaml index 637aff9..0b32218 100644 --- a/.sops.yaml +++ b/.sops.yaml @@ -14,6 +14,7 @@ keys: - &neptun age1hp72xyx2cnd05937e4eww95g5kdtn0wsf9j2nypw330pa69gfdxqn0lpkp - &terra age1rfcmu6zh40v4260l9hnf8ajs9vly0s06rx3ey76eu78dp9t7getqyhmkut - &mars age1eapjg6tdrr0fuvmgs3q3nlvnjkaxez298qynqqqxt0lpcv0lrsyq7ayxjk + - &titan age1qm6ne4mrgwkj7eea5j3vn0qmtw4p5h4eu78vvahhfnd4pk04qausn3qgv2 # mercury (rpi) uses a dedicated age key (SD image, no ssh-host-key delivery); # the private key is dropped on its boot partition after flashing. - &mercury age1cpty7zrgnn6l97upq00w5wa8zcvnkxkdt2jvhlj97jh83exure4slha43t @@ -29,6 +30,9 @@ creation_rules: - path_regex: secrets/terra\.yaml$ key_groups: - age: [ *admin, *terra ] + - path_regex: secrets/titan\.yaml$ + key_groups: + - age: [ *admin, *titan ] - path_regex: secrets/mars\.yaml$ key_groups: - age: [ *admin, *mars ] diff --git a/CLAUDE.md b/CLAUDE.md index 6b0d44c..8349222 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co Flake-based NixOS config for a homelab. Hosts: **jupiter** (ZimaBlade NAS, x86_64), **neptun** (netcup public reverse proxy + tailnet node, x86_64), **mercury** (Raspberry -Pi 3B+ DNS/DHCP, aarch64). See `README.md` for the full install/deploy walkthrough. +Pi 3B+ DNS/DHCP, aarch64), **terra** (desktop), **titan** (Zenbook Pro Duo laptop), +**mars** (Hermes Agent + luna's apps). See `README.md` for the full install/deploy walkthrough. ## Layout @@ -16,6 +17,8 @@ services//*.nix # one reusable NixOS module per service, grouped by categ # ITS OWN firewall ports. services/containers.nix (podman # backend) stays at the top level, shared across categories. hosts// # configuration.nix + disk-config.nix (disko) + hardware-configuration.nix + secrets.nix +profiles/workstation.nix # Hyprland workstation shared by terra + titan (NixOS side) +home/desktop/ # its home-manager side; per-host monitors via homelab.desktop.* secrets/.yaml # sops-nix, age-encrypted per host scripts/deploy # config-agnostic deploy wrapper (all args mandatory) scripts/edit_secrets diff --git a/dotfiles/quickshell/CLAUDE.md b/dotfiles/quickshell/CLAUDE.md index 7ee450e..e9daba2 100644 --- a/dotfiles/quickshell/CLAUDE.md +++ b/dotfiles/quickshell/CLAUDE.md @@ -8,7 +8,7 @@ A [Quickshell](https://quickshell.org/) configuration — a QML-based Wayland de ## Running / testing changes -**`~/.config/quickshell` is NOT a symlink to this repo.** `hosts/terra/home.nix` +**`~/.config/quickshell` is NOT a symlink to this repo.** `home/desktop/default.nix` ships the tree with `xdg.configFile."quickshell"`, which COPIES it into the nix store, so the config directory is a read-only symlink into `/nix/store/...`. Editing a file here therefore changes nothing about the running shell: it is diff --git a/dotfiles/quickshell/HyprChrome/DebugWindow.qml b/dotfiles/quickshell/HyprChrome/DebugWindow.qml index 91aeed2..3b734fa 100644 --- a/dotfiles/quickshell/HyprChrome/DebugWindow.qml +++ b/dotfiles/quickshell/HyprChrome/DebugWindow.qml @@ -28,7 +28,8 @@ Scope { // Monitor to stage on. Falls back to the LAST connected screen when the // name matches nothing, so a single-monitor session still gets a stage. - property string screenName: "HDMI-A-1" + // Set per host in home/desktop/options.nix (secondaryOutput). + property string screenName: Quickshell.env("QS_SECONDARY_OUTPUT") ?? "" property bool active: true default property alias content: slot.data diff --git a/dotfiles/quickshell/HyprChrome/Widgets/HyprChromeShell.qml b/dotfiles/quickshell/HyprChrome/Widgets/HyprChromeShell.qml index 3a7464a..f01d44a 100644 --- a/dotfiles/quickshell/HyprChrome/Widgets/HyprChromeShell.qml +++ b/dotfiles/quickshell/HyprChrome/Widgets/HyprChromeShell.qml @@ -40,7 +40,8 @@ Scope { // the name matches nothing, so the bar still appears on a single-monitor // session or after a cable swap (DebugWindow falls back to the last one // instead — it wants the secondary). - property string screenName: "DP-2" + // Set per host in home/desktop/options.nix (primaryOutput). + property string screenName: Quickshell.env("QS_PRIMARY_OUTPUT") ?? "" // Quickshell.screens is a QML list, not a JS array — no .find() on it. readonly property var targetScreen: { @@ -141,7 +142,7 @@ Scope { readonly property int barLayer: shell.scrimUp ? WlrLayer.Overlay : WlrLayer.Bottom readonly property int backdropLayer: shell.scrimUp ? WlrLayer.Top : WlrLayer.Background - // SUPER A — see hosts/terra/home/hyprland.nix. + // SUPER A — see home/desktop/hyprland.nix. GlobalShortcut { name: "chrome" description: "Expand or collapse the hyprchrome bar" @@ -253,7 +254,7 @@ Scope { // Polkit authentication agent. It registers for this logind session on // creation, so it replaces hyprpolkitagent rather than coexisting with it — - // only one agent may hold a session (see hosts/terra/home/hyprland.nix). + // only one agent may hold a session (see home/desktop/hyprland.nix). // // It lives here rather than beside the launchers in shell.qml because its // state is shared: `prompting` raises the scrim and freezes the density, diff --git a/dotfiles/quickshell/HyprChrome/Widgets/Polkit/PolkitPrompt.qml b/dotfiles/quickshell/HyprChrome/Widgets/Polkit/PolkitPrompt.qml index 41d5d4c..0971a9f 100644 --- a/dotfiles/quickshell/HyprChrome/Widgets/Polkit/PolkitPrompt.qml +++ b/dotfiles/quickshell/HyprChrome/Widgets/Polkit/PolkitPrompt.qml @@ -13,7 +13,7 @@ import qs.HyprChrome.Theme // nothing to call. Two consequences: // // * Only ONE agent may hold a session. hyprpolkitagent must not be running -// (hosts/terra/home/hyprland.nix autostart), or registration fails and this +// (home/desktop/hyprland.nix autostart), or registration fails and this // dialog silently never appears. `isRegistered` is the check. // * `path` is write-once — the binary refuses a later assignment with // "cannot change path after it has been set." Set it here or not at all. diff --git a/dotfiles/quickshell/shell.qml b/dotfiles/quickshell/shell.qml index 8e27641..a25a79b 100644 --- a/dotfiles/quickshell/shell.qml +++ b/dotfiles/quickshell/shell.qml @@ -40,7 +40,7 @@ Scope { // Host vitals HUD — toggle with SUPER CTRL V. Vitals {} - // Widget staging area, centered on the secondary monitor (HDMI-A-1), + // Widget staging area, centered on the secondary monitor, // toggled with SUPER CTRL D. Swap the children below for whatever widget // is being worked on; they must carry their own size (see DebugWindow). // DebugWindow { diff --git a/dotfiles/quickshell/widgets/osd/VolumeOsd.qml b/dotfiles/quickshell/widgets/osd/VolumeOsd.qml index 326545b..7364aa8 100644 --- a/dotfiles/quickshell/widgets/osd/VolumeOsd.qml +++ b/dotfiles/quickshell/widgets/osd/VolumeOsd.qml @@ -39,7 +39,7 @@ Scope { } PanelWindow { - screen: Quickshell.screens.find(s => s.name === "DP-2") + screen: Quickshell.screens.find(s => s.name === Quickshell.env("QS_PRIMARY_OUTPUT")) visible: root.active WlrLayershell.layer: WlrLayer.Overlay diff --git a/flake.nix b/flake.nix index d2f504d..d9bc8eb 100644 --- a/flake.nix +++ b/flake.nix @@ -135,6 +135,20 @@ ]; }; + # titan — ASUS Zenbook Pro Duo UX581 laptop; same Hyprland workstation + # as terra (profiles/workstation.nix). See hosts/titan/*. + titan = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { inherit inputs; }; + modules = [ + disko.nixosModules.disko + sops-nix.nixosModules.sops + home-manager.nixosModules.home-manager + inputs.nix-flatpak.nixosModules.nix-flatpak + ./hosts/titan/configuration.nix + ]; + }; + # mars — on-site x86_64 box: Hermes Agent, plus the LAN web apps luna # hosts herself (hosts/mars/luna-sites.nix). See hosts/mars/*. mars = nixpkgs.lib.nixosSystem { @@ -543,7 +557,7 @@ # `nix develop` — hot-reload loop for dotfiles/quickshell. # - # hosts/terra/home.nix ships the shell as a store copy (`xdg.configFile`), + # home/desktop/default.nix ships the shell as a store copy (`xdg.configFile`), # which only hot-reloads its own frozen files; pointing at the working # tree with `qs -p` restores edit-save-see without a rebuild. # diff --git a/home/common.nix b/home/common.nix index e43d1d0..4dffb3d 100644 --- a/home/common.nix +++ b/home/common.nix @@ -1,7 +1,7 @@ # Shared home-manager profile for darman, applied on every host via -# common.nix. Host-specific extras (terra's desktop/dev tooling) layer on +# common.nix. Workstation extras (terra, titan: home/desktop) layer on # top via their own home-manager.users.darman.imports entry, same pattern -# used here — see hosts/terra/configuration.nix + hosts/terra/home.nix. +# used here — see profiles/workstation.nix + home/desktop/default.nix. { ... }: { home.stateVersion = "26.05"; diff --git a/hosts/terra/home.nix b/home/desktop/default.nix similarity index 96% rename from hosts/terra/home.nix rename to home/desktop/default.nix index 8527653..51564f6 100644 --- a/hosts/terra/home.nix +++ b/home/desktop/default.nix @@ -45,10 +45,10 @@ let }; in { + # Desktop profile shared by terra and titan (profiles/workstation.nix). # home.stateVersion, programs.home-manager.enable, programs.zsh.enable all - # come from home/common.nix (shared across every host) via - # configuration.nix's home-manager.users.darman.imports. - imports = [ ./home/hyprland.nix ./home/theme.nix ]; + # come from home/common.nix (every host). + imports = [ ./options.nix ./hyprland.nix ./theme.nix ]; home.keyboard.layout = "de"; diff --git a/hosts/terra/home/hyprland.nix b/home/desktop/hyprland.nix similarity index 91% rename from hosts/terra/home/hyprland.nix rename to home/desktop/hyprland.nix index b5e884f..8f5aaa1 100644 --- a/hosts/terra/home/hyprland.nix +++ b/home/desktop/hyprland.nix @@ -1,7 +1,8 @@ -{ lib, pkgs, config, inputs, ... }: +{ lib, pkgs, config, osConfig, inputs, ... }: let lua = lib.generators.mkLuaInline; + cfg = config.homelab.desktop; # Cursor theme+size live in home.pointerCursor (theme.nix) so the name is # in one place; hyprland.lua is what actually gets them into the graphical @@ -9,11 +10,6 @@ let cursorName = config.home.pointerCursor.name; cursorSize = toString config.home.pointerCursor.size; - # Wallpapers aren't checked into this repo (binaries) — pulled from the - # Wallhaven library on /mnt/hdd_01. Picked once here since hyprpaper has - # no built-in "random" mode. - wallpaper = "/mnt/hdd_01/data/Pictures/Wallhaven/wallhaven-mlwz78.png"; - # Dispatchers → the new hl.dsp.* API (signatures verified against hyprland # 0.55's src/config/lua/bindings/LuaBindingsDispatchers.cpp). dsp = { @@ -50,16 +46,13 @@ let ]; in { - services.hyprpaper = { + services.hyprpaper = lib.mkIf (cfg.wallpaper != null) { enable = true; settings = { ipc = "on"; splash = false; - preload = [ wallpaper ]; - wallpaper = [ - { monitor = "DP-2"; path = wallpaper; } - { monitor = "HDMI-A-1"; path = wallpaper; } - ]; + preload = [ cfg.wallpaper ]; + wallpaper = map (m: { monitor = m.output; path = cfg.wallpaper; }) cfg.monitors; }; }; @@ -76,10 +69,7 @@ in bg_accent = { _var = "rgba(963c38ff)"; }; # ---- monitors ---- - monitor = [ - { output = "DP-2"; mode = "2560x1440@144"; position = "1920x0"; scale = 1; } - { output = "HDMI-A-1"; mode = "1920x1080@60"; position = "0x360"; scale = 1; } - ]; + monitor = cfg.monitors; # ---- variables (general/decoration/input/misc/...) ---- config = { @@ -169,6 +159,9 @@ in { _args = [ "XDG_SESSION_DESKTOP" "Hyprland" ]; } { _args = [ "XDG_SESSION_TYPE" "wayland" ]; } { _args = [ "QT_QPA_PLATFORMTHEME" "qt6ct" ]; } + # Read by the quickshell bar/OSD/debug stage to pick their monitor. + { _args = [ "QS_PRIMARY_OUTPUT" cfg.primaryOutput ]; } + { _args = [ "QS_SECONDARY_OUTPUT" cfg.secondaryOutput ]; } ]; # ---- keybinds (keybinds.conf) ---- @@ -195,16 +188,18 @@ in # expand / collapse the hyprchrome bar as a whole (bind "SUPER + A" (dsp.global "quickshell:chrome")) - # mute / unmute your mic for luna (services/desktop/luna-voice.nix); - # never cuts off a reply she is already giving. - # Runs the CLI rather than a quickshell GlobalShortcut so the mic can - # still be switched off while the shell is reloading. + ] + # mute / unmute your mic for luna (services/desktop/luna-voice.nix); + # never cuts off a reply she is already giving. + # Runs the CLI rather than a quickshell GlobalShortcut so the mic can + # still be switched off while the shell is reloading. + ++ lib.optional (osConfig.homelab.lunaVoice.enable or false) (bind "SUPER + V" (dsp.exec "luna-voice toggle")) - + ++ [ (bind "SUPER + B" (dsp.exec "vivaldi")) (bind "SUPER + E" (dsp.exec "cosmic-files")) (bind "SUPER + SHIFT + G" (dsp.workspaceRef "game")) - (bind "SUPER + S" (dsp.exec "grim -o DP-2 ~/screenshot.png")) + (bind "SUPER + S" (dsp.exec "grim -o ${cfg.primaryOutput} ~/screenshot.png")) (bind "SUPER + SHIFT + S" (dsp.exec "grimblast copy area --freeze")) (bind "Print" (dsp.exec "rishot")) (bind "SUPER + L" (dsp.exec "hyprlock")) @@ -279,7 +274,7 @@ in # ---- workspace rules (workspacerules.conf) ---- workspace_rule = [ - { workspace = "name:game"; monitor = "DP-2"; decorate = false; } + { workspace = "name:game"; monitor = cfg.primaryOutput; decorate = false; } { workspace = "special:terminal"; on_created_empty = "alacritty"; gaps_out = 256; } { workspace = "special:communications"; on_created_empty = "${config.home.homeDirectory}/.config/scripts/start-communications.sh"; gaps_out = 128; } { workspace = "special:music"; on_created_empty = "com.blitzfc.qbz"; gaps_out = 128; } diff --git a/home/desktop/options.nix b/home/desktop/options.nix new file mode 100644 index 0000000..4d76604 --- /dev/null +++ b/home/desktop/options.nix @@ -0,0 +1,26 @@ +{ lib, ... }: + +# Per-host knobs for the shared desktop; set via +# home-manager.users.darman.homelab.desktop in hosts//configuration.nix. +{ + options.homelab.desktop = { + monitors = lib.mkOption { + type = lib.types.listOf lib.types.attrs; + description = "hl.monitor() tables; the greeter reuses them."; + }; + primaryOutput = lib.mkOption { + type = lib.types.str; + description = "Connector that gets the bar, OSDs, the game workspace and the greeter."; + }; + secondaryOutput = lib.mkOption { + type = lib.types.str; + default = ""; + description = "Connector for the debug widget stage; empty = last screen."; + }; + wallpaper = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + description = "Image path for hyprpaper; null leaves hyprpaper off."; + }; + }; +} diff --git a/hosts/terra/home/theme.nix b/home/desktop/theme.nix similarity index 70% rename from hosts/terra/home/theme.nix rename to home/desktop/theme.nix index 4e9c82c..ba4b883 100644 --- a/hosts/terra/home/theme.nix +++ b/home/desktop/theme.nix @@ -2,14 +2,19 @@ # Global Dracula theming (GTK + Qt) let - azureGlassyDarkIcons = pkgs.callPackage ../../../pkgs/azure-glassy-dark-icons.nix { }; - amyDarkIcons = pkgs.callPackage ../../../pkgs/amy-dark-icons.nix { }; - slotBeautyDarkIcons = pkgs.callPackage ../../../pkgs/slot-beauty-dark-icons.nix { }; - hyprchromeCursors = pkgs.callPackage ../../../pkgs/hyprchrome-cursors.nix { }; + azureGlassyDarkIcons = pkgs.callPackage ../../pkgs/azure-glassy-dark-icons.nix { }; + amyDarkIcons = pkgs.callPackage ../../pkgs/amy-dark-icons.nix { }; + slotBeautyDarkIcons = pkgs.callPackage ../../pkgs/slot-beauty-dark-icons.nix { }; + hyprchromeCursors = pkgs.callPackage ../../pkgs/hyprchrome-cursors.nix { }; - iconTheme = "Amy-Dark-Icons"; - iconThemePackage = amyDarkIcons; - iconThemeFolder = "${iconThemePackage}/share/icons/${iconTheme}"; + # HyprChrome folders on top, Amy for everything else (Inherits=). + # "HyprChrome-Folders-Solid" is the same set in the solid finish. + baseIconTheme = "Amy-Dark-Icons"; + baseIconThemePackage = amyDarkIcons; + iconTheme = "HyprChrome-Folders"; + iconThemePackage = pkgs.callPackage ../../pkgs/hyprchrome-folders.nix { + baseTheme = baseIconTheme; + }; in { gtk = { @@ -42,7 +47,11 @@ in # Flatpak auto-exposes ~/.themes and ~/.icons read-only as the workaround. home.file.".themes/Dracula".source = "${pkgs.dracula-theme}/share/themes/Dracula"; - home.file.".icons/${iconTheme}".source = iconThemeFolder; + home.file.".icons/${iconTheme}".source = + "${iconThemePackage}/share/icons/${iconTheme}"; + home.file.".icons/${baseIconTheme}".source = + "${baseIconThemePackage}/share/icons/${baseIconTheme}"; + home.packages = [ baseIconThemePackage ]; dconf.settings."org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; diff --git a/hosts/terra/configuration.nix b/hosts/terra/configuration.nix index ec6b88a..1786644 100644 --- a/hosts/terra/configuration.nix +++ b/hosts/terra/configuration.nix @@ -1,27 +1,14 @@ # ---- TERRA ---- { config, pkgs, lib, inputs, ... }: -let - unstable = import inputs.nixpkgs-unstable { - inherit (pkgs.stdenv.hostPlatform) system; - config = pkgs.config; - }; -in { imports = [ ./hardware-configuration.nix ./disk-config.nix ./secrets.nix ../../common.nix - ../../services/containers.nix - ../../services/vpn/tailscale.nix - ../../services/monitoring/node-exporter.nix - ../../services/desktop/desktop-hyprland.nix - ../../services/desktop/desktop-apps.nix - ../../services/desktop/claude-desktop.nix - ../../services/desktop/librechat.nix + ../../profiles/workstation.nix ../../services/desktop/luna-voice.nix - ../../services/identity/pass-broker.nix ../../services/dev/turtle-beach-re.nix inputs.turtle-beach-swarm-re.nixosModules.release inputs.tbctl.nixosModules.tbctl @@ -40,7 +27,7 @@ in }; # Talk to luna (Hermes Agent on mars) with SUPER+V — see - # hosts/terra/home/hyprland.nix for the push-to-talk binds. + # home/desktop/hyprland.nix for the push-to-talk binds. homelab.lunaVoice = { enable = true; hermesKeyFile = config.sops.secrets.hermes_api_server_key.path; @@ -84,100 +71,23 @@ in networking.hostName = "terra"; - homelab.greeter = { - monitors = config.home-manager.users.darman.wayland.windowManager.hyprland.settings.monitor; - primaryOutput = "DP-2"; - defaultUser = "darman"; - keyboardLayout = "de"; - cursor = { inherit (config.home-manager.users.darman.home.pointerCursor) name size package; }; - }; - - services.flatpak = { - enable = true; - remotes = [{ name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; }]; - packages = [ - { appId = "com.github.tchx84.Flatseal"; origin = "flathub"; } - { appId = "com.blitzfc.qbz"; origin = "flathub"; } - { appId = "com.discordapp.Discord"; origin = "flathub"; } - { appId = "org.telegram.desktop"; origin = "flathub"; } - { appId = "com.bambulab.BambuStudio"; origin = "flathub"; } - { appId = "md.obsidian.Obsidian"; origin = "flathub"; } + home-manager.users.darman.homelab.desktop = { + monitors = [ + { output = "DP-2"; mode = "2560x1440@144"; position = "1920x0"; scale = 1; } + { output = "HDMI-A-1"; mode = "1920x1080@60"; position = "0x360"; scale = 1; } ]; + primaryOutput = "DP-2"; + secondaryOutput = "HDMI-A-1"; + # Not checked into this repo (binaries) — from the Wallhaven library on + # /mnt/hdd_01. hyprpaper has no "random" mode, so it's picked here. + wallpaper = "/mnt/hdd_01/data/Pictures/Wallhaven/wallhaven-mlwz78.png"; }; - environment.systemPackages = [ unstable.proton-pass-cli ]; - - # Proton Pass for scripts/deploy and Claude, one Telegram tap per use. Your - # own pass-cli stays logged out here: the broker's session is the only one. - homelab.passBroker = { - enable = true; - passCli = unstable.proton-pass-cli; - patFile = config.sops.secrets.pass_broker_pat.path; - telegram.tokenFile = config.sops.secrets.pass_broker_telegram_token.path; - telegram.chatIdFile = config.sops.secrets.darman_telegram_user_id.path; - }; - - # run0 waits on systemd over D-Bus, whose 25s default call timeout runs out - # while the polkit dialog is still open (slow typing, a vault lookup). - # Scoped to run0 so a hung systemctl doesn't also wait 5min. - programs.zsh.shellAliases.run0 = "SYSTEMD_BUS_TIMEOUT=5min run0"; - - # ---- nix-ld: lets generic dynamically-linked Linux binaries run as-is — - # needed for editor extensions (Zed/VSCode LSPs, debuggers, etc.) that - # download prebuilt binaries not built for NixOS. See - # https://nix.dev/permalink/stub-ld ---- - programs.nix-ld.enable = true; - - # JetBrains IDEs installed via Toolbox bundle a JBR that aborts with - # `libX11.so.6: cannot open shared object file` under the default (X11-less) - # nix-ld set. Additive — merges with the module's own base list (zlib etc). - programs.nix-ld.libraries = with pkgs; [ - freetype - fontconfig - libGL - libxkbcommon - wayland - libsecret - libx11 - libxext - libxi - libxrender - libxtst - libxcursor - libxrandr - libxinerama - libxcb - icu - ]; - - # NixOS only ships /bin/sh; envfs serves /bin and /usr/bin from PATH so - # third-party scripts hardcoding `#!/bin/bash` (e.g. JetBrains Toolbox's - # generated launchers) still resolve. - services.envfs.enable = true; - - # ---- home-manager (user-level config for darman) ---- - # Base settings + shared zsh baseline live in common.nix + home/common.nix - # (every host); this layers terra's desktop profile on top (imports merge). - home-manager.extraSpecialArgs = { inherit unstable inputs; }; - home-manager.users.darman.imports = [ ./home.nix ]; - - # ---- Boot (UEFI) ---- - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; hardware.cpu.amd.updateMicrocode = true; - # Lets `nix build` target mercury (aarch64) from here — see CLAUDE.md's - # aarch64 gotcha. - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; - # ---- GPU (Radeon RX 6800 XT / Navi 21) ---- - hardware.enableRedistributableFirmware = true; boot.initrd.kernelModules = [ "amdgpu" ]; - # /dev/dri/renderD128 is root:render 0660 — host user needs render group for - # rootless podman GPU containers (Vulkan whisper.cpp/llama.cpp). - users.users.darman.extraGroups = [ "render" "video" ]; - # ---- Dev-data disks — NOT in disko, mounted read-write, never wiped ---- fileSystems."/mnt/hdd_01" = { device = "/dev/disk/by-uuid/b8445126-ec6d-4f88-818a-d9e13031d9a4"; @@ -190,22 +100,5 @@ in options = [ "nofail" ]; }; - # jupiter's samba share (services/network/samba.nix) — mounted on demand so - # terra doesn't stall boot/login when jupiter is off or unreachable. - fileSystems."/mnt/jupiter" = { - device = "//jupiter/data"; - fsType = "cifs"; - options = [ - "credentials=${config.sops.templates."jupiter-smb.credentials".path}" - "uid=1000" - "gid=100" - "nofail" - "x-systemd.automount" - "x-systemd.idle-timeout=60" - "x-systemd.mount-timeout=10s" - "_netdev" - ]; - }; - system.stateVersion = "26.05"; } diff --git a/hosts/terra/secrets.nix b/hosts/terra/secrets.nix index 3f0b90d..5db0652 100644 --- a/hosts/terra/secrets.nix +++ b/hosts/terra/secrets.nix @@ -4,6 +4,7 @@ # decrypted with terra's own SSH host key (recipient in ../../.sops.yaml). # The host key is pre-generated on the laptop and shipped at install # (nixos-anywhere --extra-files -> /etc/ssh/ssh_host_ed25519_key). +# samba + pass-broker secrets are declared in profiles/workstation.nix. { sops.defaultSopsFile = ../../secrets/terra.yaml; sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; @@ -13,20 +14,6 @@ sops.secrets.darman_password.neededForUsers = true; users.users.darman.hashedPasswordFile = config.sops.secrets.darman_password.path; - # Credentials file for the //jupiter/data cifs mount (see configuration.nix). - # samba_password mirrors jupiter's own samba_password secret (services/network/samba.nix) — - # same value, just also encrypted to terra so it can authenticate as the same smb user. - sops.secrets.samba_password = { }; - sops.templates."jupiter-smb.credentials".content = '' - username=darman - password=${config.sops.placeholder.samba_password} - ''; - - # LibreChat's CREDS_KEY/IV encrypt stored user credentials (linked 3rd-party - # API keys etc) at rest in mongo; JWT_SECRET/JWT_REFRESH_SECRET sign session - # tokens. All four are random, generated once with `sops --set` (see - # CLAUDE.md) — losing/rotating them just invalidates existing sessions and - # any saved per-user API keys, nothing else depends on their value. # luna-voiced (services/desktop/luna-voice.nix) runs as a USER service, so # these cannot stay root:root 0400 — a user manager cannot read them and # LoadCredential does not bridge that gap either. Hence owner, not mode. @@ -38,16 +25,4 @@ # files; see CLAUDE.md. sops.secrets.hermes_api_server_key.owner = "darman"; sops.secrets.elevenlabs_api_key.owner = "darman"; - - # pass-broker (services/identity/pass-broker.nix): the agent PAT and its - # dedicated Telegram bot. Owner pass-broker, so darman cannot read them. - sops.secrets.pass_broker_pat.owner = "pass-broker"; - sops.secrets.pass_broker_telegram_token.owner = "pass-broker"; - # Not broker-specific; a second reader needs a sops.templates copy, not a new owner. - sops.secrets.darman_telegram_user_id.owner = "pass-broker"; - - sops.secrets.librechat_creds_key = { }; - sops.secrets.librechat_creds_iv = { }; - sops.secrets.librechat_jwt_secret = { }; - sops.secrets.librechat_jwt_refresh_secret = { }; } diff --git a/hosts/titan/configuration.nix b/hosts/titan/configuration.nix new file mode 100644 index 0000000..edf56c1 --- /dev/null +++ b/hosts/titan/configuration.nix @@ -0,0 +1,55 @@ +# ---- TITAN ---- +# ASUS Zenbook Pro Duo UX581LV: i7/i9 10th gen (UHD 630) + RTX 2060, +# 4K OLED + ScreenPad Plus. Same workstation as terra (profiles/workstation.nix). +{ config, pkgs, lib, inputs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ./disk-config.nix + ./secrets.nix + ../../common.nix + ../../profiles/workstation.nix + ]; + + networking.hostName = "titan"; + + # Connector names are a first guess; check `hyprctl monitors` after the + # first boot. The catch-all rule keeps any unlisted output usable. + home-manager.users.darman.homelab.desktop = { + monitors = [ + { output = "eDP-1"; mode = "3840x2160@60"; position = "0x0"; scale = 2; } + { output = ""; mode = "preferred"; position = "auto"; scale = "auto"; } + ]; + primaryOutput = "eDP-1"; + }; + + hardware.cpu.intel.updateMicrocode = true; + services.thermald.enable = true; + + # ---- GPU: Intel iGPU drives the panels, RTX 2060 on demand ---- + # Run something on the dGPU with `nvidia-offload `. + hardware.graphics.extraPackages = [ pkgs.intel-media-driver ]; + services.xserver.videoDrivers = [ "modesetting" "nvidia" ]; + hardware.nvidia = { + open = true; # Turing is supported by the open module + modesetting.enable = true; + powerManagement.enable = true; + powerManagement.finegrained = true; # dGPU powers off when idle + prime = { + offload.enable = true; + offload.enableOffloadCmd = true; + # Usual UX581 values; confirm with `lspci | grep -E 'VGA|3D'`. + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + }; + + # ---- laptop ---- + hardware.bluetooth.enable = true; + services.power-profiles-daemon.enable = true; + services.upower.enable = true; + zramSwap.enable = true; + + system.stateVersion = "26.05"; +} diff --git a/hosts/titan/disk-config.nix b/hosts/titan/disk-config.nix new file mode 100644 index 0000000..5a78753 --- /dev/null +++ b/hosts/titan/disk-config.nix @@ -0,0 +1,40 @@ +{ ... }: + +# Declarative OS-disk layout (disko), same as terra: GPT, ESP + btrfs root, +# whole internal NVMe, NixOS only. See hosts/terra/disk-config.nix for why +# each partition wipes its old signature first. +# +# ⚠️ This disk is WIPED on install. `device` is a deliberate non-path until +# the real id is filled in from the laptop (`ls -l /dev/disk/by-id/`), so +# an install fails before touching anything rather than guessing a disk. +{ + disko.devices.disk.os = { + type = "disk"; + device = "/dev/disk/by-id/FILL-ME-IN-titan-nvme"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + preCreateHook = ''wipefs --all --force "$device"''; + }; + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + mountpoint = "/"; + preCreateHook = ''wipefs --all --force "$device"''; + }; + }; + }; + }; + }; +} diff --git a/hosts/titan/hardware-configuration.nix b/hosts/titan/hardware-configuration.nix new file mode 100644 index 0000000..e35ca40 --- /dev/null +++ b/hosts/titan/hardware-configuration.nix @@ -0,0 +1,21 @@ +# PLACEHOLDER — replaced on install. +# +# disko (disk-config.nix) owns "/" and "/boot", so this file only carries +# kernel modules + platform. nixos-anywhere regenerates it via: +# nixos-generate-config --no-filesystems +# Fallback for the UX581 (10th-gen Intel, NVMe): `vmd` in case the firmware +# has Intel VMD/RST on, which hides the NVMe from stage 1 without it. +{ config, lib, pkgs, modulesPath, ... }: + +{ + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + # NO fileSystems here — disko defines "/" and "/boot". + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/titan/secrets.nix b/hosts/titan/secrets.nix new file mode 100644 index 0000000..60806cf --- /dev/null +++ b/hosts/titan/secrets.nix @@ -0,0 +1,16 @@ +{ config, ... }: + +# sops-nix wiring for titan (laptop). Encrypted values in ../../secrets/titan.yaml, +# decrypted with titan's own SSH host key (recipient in ../../.sops.yaml). +# samba + pass-broker secrets are declared in profiles/workstation.nix. +# pass_broker_telegram_token must be titan's OWN bot: getUpdates has one +# consumer, so sharing terra's would split approval taps between the two. +{ + sops.defaultSopsFile = ../../secrets/titan.yaml; + sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + + sops.secrets.tailscale_authkey = { }; + + sops.secrets.darman_password.neededForUsers = true; + users.users.darman.hashedPasswordFile = config.sops.secrets.darman_password.path; +} diff --git a/pkgs/hyprchrome-folders.nix b/pkgs/hyprchrome-folders.nix new file mode 100644 index 0000000..cee8776 --- /dev/null +++ b/pkgs/hyprchrome-folders.nix @@ -0,0 +1,229 @@ +{ lib, stdenvNoCC, gtk3, baseTheme }: + +# HyprChrome folders, drawn as the first artboard of the "HyprChrome Folders" +# design canvas (claude.ai/artifact/W2jmmhXLUzt2isUpGEraB6): 20 folder icons on +# a 32px grid in its two finishes, each shipped as its own theme. Only folders +# are drawn; everything else comes from baseTheme via Inherits=. +let + accent = "#e8722a"; + accentHot = "#ff6b4a"; + + # LIT: accent tab over a selection-grey hull, accent emblems. + # SOLID: accent hull, surface-ink emblems. + themes = { + "HyprChrome-Folders" = acc: { + inherit acc; + tab = acc; hull = "#1a1c1f"; seam = ''stroke="#dedede" stroke-opacity="0.12"''; + ink = acc; sub = ''stroke="#858585"''; hole = "#1a1c1f"; + }; + "HyprChrome-Folders-Solid" = acc: { + inherit acc; + tab = "#292c30"; hull = acc; seam = ''stroke="#0a0a0a" stroke-opacity="0.35"''; + ink = "#0a0a0a"; sub = ''stroke="#0a0a0a" stroke-opacity="0.5"''; hole = acc; + }; + }; + + bases = { + closed = f: '' + + + + + ''; + open = f: '' + + + + + + + + ''; + }; + + # the canvas's k / kf / sb / hl classes + paint = f: { + k = ''fill="none" stroke="${f.ink}"''; + kf = ''fill="${f.ink}"''; + sb = ''fill="none" ${f.sub}''; + hl = ''fill="${f.hole}"''; + }; + + can = p: '' + + + + ''; + + emblems = { + none = p: ""; + homelab = p: '' + + + + + + + ''; + home = p: '' + + + ''; + desktop = p: '' + + + + + ''; + documents = p: '' + + + ''; + download = p: '' + + + ''; + music = p: '' + + + + ''; + pictures = p: '' + + + + ''; + videos = p: '' + + + + ''; + templates = p: '' + + + + ''; + publicshare = p: '' + + + + + ''; + git = p: '' + + + + + ''; + projects = p: '' + + + ''; + remote = p: '' + + + + + ''; + saved-search = p: '' + + + ''; + locked = p: '' + + + + ''; + important = p: '' + + + + ''; + trash = p: can p + '' + + ''; + trash-full = p: can p + '' + + + ''; + }; + + # aliases: the other names apps (and baseTheme) use for the same folder, so + # those don't fall through to baseTheme's own drawing. + icons = { + folder = { emblem = "none"; aliases = [ "inode-directory" "gtk-directory" "gnome-fs-directory" "gnome-folder" "stock_folder" ]; }; + folder-open = { base = "open"; emblem = "none"; aliases = [ "folder-drag-accept" "folder-visiting" "gnome-fs-directory-accept" ]; }; + folder-homelab = { emblem = "homelab"; }; + user-home = { emblem = "home"; aliases = [ "folder-home" "folder_home" "gnome-fs-home" ]; }; + user-desktop = { emblem = "desktop"; aliases = [ "folder-desktop" "gnome-fs-desktop" ]; }; + folder-documents = { emblem = "documents"; }; + folder-download = { emblem = "download"; aliases = [ "folder-downloads" ]; }; + folder-music = { emblem = "music"; }; + folder-pictures = { emblem = "pictures"; aliases = [ "folder-images" "folder-image" "folder-picture" ]; }; + folder-videos = { emblem = "videos"; aliases = [ "folder-video" ]; }; + folder-templates = { emblem = "templates"; }; + folder-publicshare = { emblem = "publicshare"; aliases = [ "folder-public" ]; }; + folder-git = { emblem = "git"; }; + folder-projects = { emblem = "projects"; aliases = [ "folder-development" ]; }; + folder-remote = { emblem = "remote"; aliases = [ "folder-network" ]; }; + folder-saved-search = { emblem = "saved-search"; }; + folder-locked = { emblem = "locked"; aliases = [ "folder-encrypted" ]; }; + folder-important = { emblem = "important"; hot = true; }; + user-trash = { emblem = "trash"; aliases = [ "trash-empty" "gnome-fs-trash-empty" ]; }; + user-trash-full = { emblem = "trash-full"; aliases = [ "gnome-fs-trash-full" ]; }; + }; + + svg = finish: name: { emblem, base ? "closed", hot ? false, ... }: + let f = finish (if hot then accentHot else accent); in + builtins.toFile "${name}.svg" '' + + ${bases.${base} f}${emblems.${emblem} (paint f)} + ''; + + buildTheme = theme: finish: '' + dir="$out/share/icons/${theme}" + mkdir -p "$dir/places/scalable" + cat > "$dir/index.theme" <=1 entry even though fetch=true overwrites this at - # runtime with whatever's pulled (hosts/terra/configuration.nix) — - # kept roughly in sync so the UI has sane names before the first fetch. - default = [ "gemma4:12b" "qwen3.6:35b-a3b" "VladimirGav/qwen3.8-27B-14GB-IQ4:latest" ]; - fetch = true; # pull the model list from ollama at startup - }; - titleConvo = true; - } - ]; - - # Persistent memory is opt-in at the config level — omitting this block - # leaves it off regardless of the user's Settings > Personalization toggle. - # `agent.provider` must match endpoints.custom[].name above exactly. - memory = { - personalize = true; # still needs a per-user opt-in toggle in the UI - # instructions REPLACES the default extraction prompt, not appends to it — - # needed because the smaller llama3.2:3b (since dropped) kept saving its - # own assistant boilerplate as memories, a capability ceiling rather than - # a prompting gap. validKeys whitelists what can be stored. - validKeys = [ "user_preferences" "personal_info" "ongoing_projects" "technical_context" ]; - agent = { - enabled = true; - provider = "Ollama"; - # same model as the chat endpoint's primary driver — when that's - # the active chat model, extraction needs no second model swapped - # into VRAM alongside it. - model = "gemma4:12b"; - instructions = '' - Save memory ONLY using the keys below, and only when the user's - message states something durable and genuinely useful to recall - in a LATER, unrelated conversation. Small talk, greetings, and - anything about what the assistant said or is capable of are NOT - memories — if nothing meets the bar, save nothing. - - set_memory REPLACES the entire value stored at a key — it does - NOT append to it. Before calling set_memory for a key, check the - "Existing memory" section below. If that key already has a - value, your new value MUST merge the old and new information - into one complete sentence or short paragraph — calling - set_memory with only the newest fact silently ERASES everything - already stored under that key. Only drop prior details if the - user is explicitly correcting or replacing them. - - - user_preferences: explicitly stated preferences (tools, formats, style). - - personal_info: durable facts about the user (name, role, timezone). - - ongoing_projects: projects or tasks the user is actively working on. - - technical_context: durable facts about the user's setup/stack - relevant to future answers (e.g. "runs NixOS", "GPU is AMD ROCm"). - ''; - }; - }; - }; - }; -}