From 5f0834f30cb07fcde8d560c98402ff158a634349 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Sun, 12 Apr 2026 22:32:44 +0100 Subject: [PATCH] refactor: consolidate app configurations and utility scripts - Move 32+ app-specific scripts from features/apps/scripts/ to features/scripts/utils/ for centralized packaging. - Create individual Nix modules for orphaned app configurations (btop, kitty, tmux, etc.) in features/apps/ using xdg.configFile. - Fix broken paths in core/system/makima.nix and features/apps/vscode.nix. - Update VSCode configuration to use the modern 'profiles.default.userSettings' API, resolving deprecation warnings. - Merge duplicate 'nomarchy-launch-walker' scripts into a single robust utility. - Remove stale root 'config/' directory. - Update README.md and docs/creating-themes.md to reflect the new architecture and keybindings. - Ensure all modules are correctly imported and verified via nix flake check. --- README.md | 22 +- core/default.nix | 21 +- .../default/hypr/bindings/utilities.conf | 6 +- core/home/default.nix | 14 ++ {features/apps => core/system}/browser.nix | 0 core/system/default.nix | 22 ++ {features/apps => core/system}/makima.nix | 2 +- docs/creating-themes.md | 230 ++++++++++++++++++ features/apps/btop/default.nix | 5 + features/apps/chromium/default.nix | 5 + features/apps/elephant/default.nix | 5 + features/apps/ghostty/default.nix | 5 + features/apps/kitty/default.nix | 5 + features/apps/lazygit/default.nix | 5 + features/apps/opencode/default.nix | 5 + features/apps/scripts/nomarchy-launch-walker | 15 -- features/apps/tmux/default.nix | 5 + features/apps/vscode.nix | 8 +- features/default.nix | 26 +- .../desktop/hyprland/config/bindings.conf | 2 +- .../utils}/nomarchy-launch-about | 0 .../utils}/nomarchy-launch-audio | 0 .../utils}/nomarchy-launch-bluetooth | 0 .../utils}/nomarchy-launch-browser | 0 .../utils}/nomarchy-launch-editor | 0 ...launch-floating-terminal-with-presentation | 0 .../utils}/nomarchy-launch-or-focus | 0 .../utils}/nomarchy-launch-or-focus-tui | 0 .../utils}/nomarchy-launch-or-focus-webapp | 0 .../utils}/nomarchy-launch-screensaver | 0 .../utils}/nomarchy-launch-tui | 0 features/scripts/utils/nomarchy-launch-walker | 9 +- .../utils}/nomarchy-launch-webapp | 0 .../utils}/nomarchy-launch-wifi | 0 features/scripts/utils/nomarchy-menu | 3 +- .../utils}/nomarchy-restart-app | 0 .../utils}/nomarchy-restart-btop | 0 .../utils}/nomarchy-restart-opencode | 0 .../utils}/nomarchy-restart-terminal | 0 .../utils}/nomarchy-restart-tmux | 0 .../utils}/nomarchy-tui-install | 0 .../utils}/nomarchy-tui-remove | 0 .../utils}/nomarchy-tui-remove-all | 0 .../utils}/nomarchy-voxtype-config | 0 .../utils}/nomarchy-voxtype-install | 0 .../utils}/nomarchy-voxtype-model | 0 .../utils}/nomarchy-voxtype-remove | 0 .../utils}/nomarchy-voxtype-status | 0 .../utils}/nomarchy-webapp-handler-hey | 0 .../utils}/nomarchy-webapp-handler-zoom | 0 .../utils}/nomarchy-webapp-install | 0 .../utils}/nomarchy-webapp-remove | 0 .../utils}/nomarchy-webapp-remove-all | 0 .../utils}/nomarchy-windows-vm | 0 hosts/installer-iso.nix | 7 + installer/install.sh | 12 +- themes/engine/files.nix | 21 +- .../{summer-night.png => 1-summer-night.png} | Bin .../{summer-day.png => 2-summer-day.png} | Bin 59 files changed, 382 insertions(+), 78 deletions(-) create mode 100644 core/home/default.nix rename {features/apps => core/system}/browser.nix (100%) create mode 100644 core/system/default.nix rename {features/apps => core/system}/makima.nix (91%) create mode 100644 docs/creating-themes.md create mode 100644 features/apps/btop/default.nix create mode 100644 features/apps/chromium/default.nix create mode 100644 features/apps/elephant/default.nix create mode 100644 features/apps/ghostty/default.nix create mode 100644 features/apps/kitty/default.nix create mode 100644 features/apps/lazygit/default.nix create mode 100644 features/apps/opencode/default.nix delete mode 100755 features/apps/scripts/nomarchy-launch-walker create mode 100644 features/apps/tmux/default.nix rename features/{apps/scripts => scripts/utils}/nomarchy-launch-about (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-audio (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-bluetooth (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-browser (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-editor (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-floating-terminal-with-presentation (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-or-focus (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-or-focus-tui (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-or-focus-webapp (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-screensaver (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-tui (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-webapp (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-launch-wifi (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-restart-app (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-restart-btop (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-restart-opencode (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-restart-terminal (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-restart-tmux (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-tui-install (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-tui-remove (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-tui-remove-all (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-voxtype-config (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-voxtype-install (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-voxtype-model (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-voxtype-remove (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-voxtype-status (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-webapp-handler-hey (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-webapp-handler-zoom (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-webapp-install (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-webapp-remove (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-webapp-remove-all (100%) rename features/{apps/scripts => scripts/utils}/nomarchy-windows-vm (100%) rename themes/palettes/summer-night/backgrounds/{summer-night.png => 1-summer-night.png} (100%) rename themes/palettes/summer-night/backgrounds/{summer-day.png => 2-summer-day.png} (100%) diff --git a/README.md b/README.md index eb4d9d9..39c0777 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,14 @@ ## πŸ“‚ Component-Based Architecture -Nomarchy uses a **Feature-Centric Directory Structure**. Instead of grouping files by type (e.g., all scripts in one folder, all configs in another), everything related to a specific component is colocated. +Nomarchy uses a **Feature-Centric Directory Structure**. Configuration, modules, and utilities are strictly organized to maintain sanity as the system grows. -- **`core/`**: Foundational OS & User defaults (Bootloader, Audio, Bluetooth, basic shell). -- **`features/`**: Isolated modules containing Nix logic, raw dotfiles, and scripts for a specific app or service (e.g., `features/desktop/waybar/`). -- **`themes/`**: The global theming engine. It holds pure color data and logic. *Theme-specific app layouts* (like a custom Waybar layout for `summer-night`) are stored directly inside the app's feature folder (`features/desktop/waybar/themes/`), solving the matrix problem of theming. +- **`core/`**: Foundational OS & User defaults (Bootloader, Audio, Bluetooth, core system features). +- **`features/`**: Isolated modules containing Nix logic and raw dotfiles. + - **`features/apps/`**: App-specific configs (e.g., `features/apps/btop/`, `features/apps/kitty/`), each containing their own `default.nix` and standalone `config/` directory mapped via Home Manager. + - **`features/desktop/`**: Desktop environment components (e.g., Hyprland, Waybar). + - **`features/scripts/utils/`**: Consolidated repository for all custom Nomarchy bash scripts, centrally packaged and injected into the user's `PATH` with correct dependencies. +- **`themes/`**: The global theming engine. It holds pure color data and logic. *Theme-specific app layouts* (like a custom Waybar layout) are stored directly inside the app's feature folder, solving the matrix problem of theming. --- @@ -89,18 +92,19 @@ env-update # Reloads your Home Manager environment (Runs: home-manager switch - | Keybinding | Action | | :--- | :--- | -| `Super + Alt + Space` | **Theme Selector** (Walker) | -| `Super + Ctrl + Space` | **Font Selector** | -| `Super + Shift + Space`| **Wallpaper Selector** | | `Super + Space` | **App Launcher** (Walker) | +| `Super + Shift + Space` | **Nomarchy Menu** (Walker) | +| `Super + Ctrl + Space` | **Background Selector** (Walker) | +| `Super + Shift + Ctrl + Space` | **Theme Selector** (Walker) | +| `Super + Alt + Space` | **Toggle Top Bar** (Waybar) | | `Super + Return` | Open Terminal | | `Super + Q` | Close Window | ### Utility Scripts -Nomarchy includes 150+ productivity scripts available in your PATH: +Nomarchy includes dozens of productivity scripts available in your PATH. Some highlights: - `nomarchy-sync push `: Backup your setup to Git. - `nomarchy-theme-bg-next`: Cycle to the next wallpaper in the current theme. -- `nomarchy-doctor`: (Coming Soon) Diagnose system health and state. +- `nomarchy-menu`: The central hub for all utilities and pickers. --- *Built with ❀️ using NixOS, Hyprland, Stylix, and the spirit of Omarchy.* diff --git a/core/default.nix b/core/default.nix index 408aefa..0f9b667 100644 --- a/core/default.nix +++ b/core/default.nix @@ -1,22 +1,5 @@ -{ config, lib, pkgs, ... }: +{ ... }: { - imports = [ - ./system/options.nix - ./system/state.nix - ./system/systemd.nix - ./system/virtualization.nix - ./system/fonts.nix - ../themes/engine/plymouth.nix - ../themes/engine/sddm.nix - ./system/hardware.nix - ./system/audio.nix - ./system/bluetooth.nix - ./system/network.nix - ../features/apps/browser.nix - ./system/impermanence.nix - ../features/apps/makima.nix - ]; - - time.timeZone = lib.mkDefault config.nomarchy.system.timezone; + imports = [ ./system ]; } diff --git a/core/home/config/nomarchy/default/hypr/bindings/utilities.conf b/core/home/config/nomarchy/default/hypr/bindings/utilities.conf index e884bf9..5ba3d34 100644 --- a/core/home/config/nomarchy/default/hypr/bindings/utilities.conf +++ b/core/home/config/nomarchy/default/hypr/bindings/utilities.conf @@ -1,16 +1,16 @@ # Menus -bindd = SUPER, SPACE, Launch apps, exec, nomarchy-menu +bindd = SUPER, SPACE, Launch apps, exec, nomarchy-launch-walker bindd = SUPER CTRL, E, Emoji picker, exec, nomarchy-menu symbols bindd = SUPER CTRL, C, Capture menu, exec, nomarchy-menu capture bindd = SUPER CTRL, O, Toggle menu, exec, nomarchy-menu toggle -bindd = SUPER ALT, SPACE, Nomarchy menu, exec, nomarchy-menu +bindd = SUPER ALT, SPACE, Toggle top bar, exec, nomarchy-toggle-waybar bindd = SUPER, ESCAPE, System menu, exec, nomarchy-menu system bindld = , XF86PowerOff, Power menu, exec, nomarchy-menu system bindd = SUPER, K, Show key bindings, exec, nomarchy-menu-keybindings bindd = , XF86Calculator, Calculator, exec, gnome-calculator # Aesthetics -bindd = SUPER SHIFT, SPACE, Toggle top bar, exec, nomarchy-toggle-waybar +bindd = SUPER SHIFT, SPACE, Nomarchy menu, exec, nomarchy-menu bindd = SUPER CTRL, SPACE, Theme background menu, exec, nomarchy-menu background bindd = SUPER SHIFT CTRL, SPACE, Theme menu, exec, nomarchy-menu theme bindd = SUPER, BACKSPACE, Toggle window transparency, exec, nomarchy-hyprland-active-window-transparency-toggle diff --git a/core/home/default.nix b/core/home/default.nix new file mode 100644 index 0000000..df56913 --- /dev/null +++ b/core/home/default.nix @@ -0,0 +1,14 @@ +{ ... }: + +{ + imports = [ + ./options.nix + ./state.nix + ./overrides.nix + ./behavior.nix + ./fonts.nix + ./configs.nix + ./security.nix + ./bash.nix + ]; +} diff --git a/features/apps/browser.nix b/core/system/browser.nix similarity index 100% rename from features/apps/browser.nix rename to core/system/browser.nix diff --git a/core/system/default.nix b/core/system/default.nix new file mode 100644 index 0000000..f6ed12a --- /dev/null +++ b/core/system/default.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./options.nix + ./state.nix + ./systemd.nix + ./virtualization.nix + ./fonts.nix + ./hardware.nix + ./audio.nix + ./bluetooth.nix + ./network.nix + ./impermanence.nix + ./browser.nix + ./makima.nix + ../../themes/engine/plymouth.nix + ../../themes/engine/sddm.nix + ]; + + time.timeZone = lib.mkDefault config.nomarchy.system.timezone; +} diff --git a/features/apps/makima.nix b/core/system/makima.nix similarity index 91% rename from features/apps/makima.nix rename to core/system/makima.nix index 05208d2..6d60eea 100644 --- a/features/apps/makima.nix +++ b/core/system/makima.nix @@ -9,7 +9,7 @@ in # this will install it. Otherwise, it will fail evaluation if not available in nixpkgs. environment.systemPackages = [ pkgs.makima-bin ]; - environment.etc."makima/AT Translated Set 2 keyboard.toml".source = ../../assets/makima + "/AT Translated Set 2 keyboard.toml"; + environment.etc."makima/AT Translated Set 2 keyboard.toml".source = ../../features/apps/makima + "/AT Translated Set 2 keyboard.toml"; systemd.services.makima = { description = "Makima key remapping service"; diff --git a/docs/creating-themes.md b/docs/creating-themes.md new file mode 100644 index 0000000..2c5bca1 --- /dev/null +++ b/docs/creating-themes.md @@ -0,0 +1,230 @@ +# Creating a Nomarchy Theme + +This guide walks through creating a new theme for Nomarchy from scratch. + +## Theme Directory Structure + +Each theme lives in `themes/palettes//` with the following structure: + +``` +themes/palettes/my-theme/ +β”œβ”€β”€ colors.toml # REQUIRED - Color palette definition +β”œβ”€β”€ icons.theme # REQUIRED - GTK icon theme name (single line) +β”œβ”€β”€ light.mode # Optional - Empty marker file for light themes +β”œβ”€β”€ preview.png # Optional - Preview image for the theme selector +β”œβ”€β”€ backgrounds/ # Optional - Wallpaper images +β”‚ β”œβ”€β”€ 1-primary.jpg # Numbered prefix controls default order +β”‚ β”œβ”€β”€ 2-alternate.png +β”‚ └── ... +└── apps/ # Optional - App-specific themed configs + β”œβ”€β”€ btop.theme # btop color theme + β”œβ”€β”€ neovim.lua # Neovim colorscheme plugin spec + β”œβ”€β”€ vscode.json # VS Code theme extension reference + └── hyprland.conf # Hyprland visual overrides (colors, decorations, animations) +``` + +## Step 1: Create the Color Palette + +Create `colors.toml` with all 24 required color fields. Every color must be a hex value with a `#` prefix. + +```toml +# UI colors +accent = "#83b6af" +cursor = "#d3c6aa" +foreground = "#d3c6aa" +background = "#2d353b" +selection_foreground = "#d3c6aa" +selection_background = "#505a60" + +# ANSI 16-color palette (color0-15) +# Normal colors +color0 = "#3c474d" # Black +color1 = "#e68183" # Red +color2 = "#a7c080" # Green +color3 = "#d9bb80" # Yellow +color4 = "#83b6af" # Blue +color5 = "#d39bb6" # Magenta +color6 = "#87c095" # Cyan +color7 = "#868d80" # White + +# Bright colors +color8 = "#868d80" # Bright Black +color9 = "#e68183" # Bright Red +color10 = "#a7c080" # Bright Green +color11 = "#d9bb80" # Bright Yellow +color12 = "#83b6af" # Bright Blue +color13 = "#d39bb6" # Bright Magenta +color14 = "#87c095" # Bright Cyan +color15 = "#868d80" # Bright White +``` + +These colors are mapped to a Base16 palette automatically: + +| Base16 Slot | Source Field | Typical Role | +|-------------|---------------|----------------------------| +| base00 | background | Default background | +| base01 | color0 | Lighter background | +| base02 | color8 | Selection background | +| base03 | color8 | Comments, invisibles | +| base04 | color7 | Dark foreground | +| base05 | foreground | Default foreground | +| base06 | color15 | Light foreground | +| base07 | color15 | Lightest foreground | +| base08 | color1 | Red (errors, deletions) | +| base09 | color3 | Orange | +| base0A | color3 | Yellow (warnings) | +| base0B | color2 | Green (success, additions) | +| base0C | color6 | Cyan (info) | +| base0D | color4 | Blue (primary accent) | +| base0E | color5 | Magenta (keywords) | +| base0F | color1 | Brown (deprecated) | + +## Step 2: Set the Icon Theme + +Create `icons.theme` with a single line containing the GTK icon theme name: + +``` +Yaru-blue +``` + +Common options from the `yaru-theme` package: `Yaru-blue`, `Yaru-purple`, `Yaru-red`, `Yaru-sage`, `Yaru-olive`, `Yaru-magenta`, `Yaru-yellow`, `Yaru-gray`, `Yaru-grey`, `Yaru-wartybrown`. + +## Step 3: Add Backgrounds (Optional) + +Place wallpaper images in a `backgrounds/` directory. Use numbered prefixes to control the default selection order -- the first file alphabetically becomes the default wallpaper. + +``` +backgrounds/ +β”œβ”€β”€ 1-main-wallpaper.jpg # Default wallpaper (first alphabetically) +β”œβ”€β”€ 2-alternate.png # Additional option +└── 3-minimal.jpg # Another option +``` + +Supported formats: `.jpg`, `.png`, `.jpeg`. + +If no backgrounds are provided, the system falls back to the catppuccin default wallpaper. + +## Step 4: Light Theme (Optional) + +For light themes, create an empty `light.mode` marker file: + +```bash +touch themes/palettes/my-theme/light.mode +``` + +This controls Stylix polarity (`light` vs `dark`) and affects GTK theming, browser color scheme, and other system-wide dark/light detection. + +### Step 5: App-Specific Configs (Optional) + +These theme-specific files are automatically picked up by the respective application modules in `features/apps//default.nix` during theme switching. + +### `apps/btop.theme` + +A btop color theme file. See existing themes for the format, or generate one from your palette colors. + +### `apps/neovim.lua` + +A lazy.nvim plugin spec for the matching Neovim colorscheme: + +```lua +return { + { "sainnhe/everforest" }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "everforest", + }, + }, +} +``` + +### `apps/vscode.json` + +VS Code theme extension reference: + +```json +{ + "name": "Everforest Dark", + "extension": "sainnhe.everforest" +} +``` + +### `apps/hyprland.conf` + +Hyprland visual overrides for this theme. This can include custom border colors, gaps, decorations, blur, and animations. The file is sourced after the default settings, so values here override the defaults. + +```conf +$activeBorderColor = rgb(d3c6aa) + +general { + col.active_border = $activeBorderColor + gaps_in = 6 + gaps_out = 12 + border_size = 3 +} + +decoration { + rounding = 10 + blur { + enabled = true + size = 5 + passes = 3 + } +} +``` + +## Step 6: Template Variables + +Nomarchy has a template system that generates app configs from your `colors.toml`. Templates in `themes/templates/*.tpl` use placeholder syntax: + +| Syntax | Example Value | Description | +|---------------------|---------------|--------------------------------| +| `{{ background }}` | `#2d353b` | Color value as-is (with `#`) | +| `{{ background_strip }}` | `2d353b` | Color value without `#` | +| `{{ background_rgb }}` | `45,53,59` | Color as decimal RGB | + +Every key from `colors.toml` is available as a template variable. Templates are processed automatically by `nomarchy-theme-set-templates` when switching themes. + +To add custom templates, place `.tpl` files in `~/.config/nomarchy/themed/`. User templates take priority over built-in ones. + +## Step 7: Preview Image (Optional) + +Add a `preview.png` screenshot of the theme in action. This is displayed in the theme selector menu (`nomarchy-menu theme`). + +## Applying Your Theme + +### During development (runtime switch) + +```bash +nomarchy-theme-set my-theme +``` + +This updates `~/.config/nomarchy/state.json`, processes templates, and triggers a Home Manager rebuild. + +### Setting as default (Nix configuration) + +In your `home.nix`: + +```nix +{ + nomarchy.theme = "my-theme"; +} +``` + +Then rebuild: `env-update` (or `sys-update` for system-wide changes). + +## Theme Discovery + +The system automatically discovers themes by scanning `themes/palettes/` for directories containing a `colors.toml` file. No registration step is needed -- just create the directory with a valid `colors.toml` and the theme is available. + +## Checklist + +- [ ] `colors.toml` with all 24 color fields +- [ ] `icons.theme` with a valid GTK icon theme name +- [ ] `backgrounds/` with at least one numbered wallpaper +- [ ] `light.mode` if it's a light theme +- [ ] `apps/neovim.lua` with colorscheme plugin spec +- [ ] `apps/vscode.json` with theme extension reference +- [ ] `apps/btop.theme` with terminal monitor colors +- [ ] `apps/hyprland.conf` if custom decorations/animations are desired +- [ ] `preview.png` for the theme selector diff --git a/features/apps/btop/default.nix b/features/apps/btop/default.nix new file mode 100644 index 0000000..cef2689 --- /dev/null +++ b/features/apps/btop/default.nix @@ -0,0 +1,5 @@ +{ config, pkgs, lib, ... }: + +{ + xdg.configFile."btop".source = ./config; +} diff --git a/features/apps/chromium/default.nix b/features/apps/chromium/default.nix new file mode 100644 index 0000000..8ced294 --- /dev/null +++ b/features/apps/chromium/default.nix @@ -0,0 +1,5 @@ +{ config, pkgs, lib, ... }: + +{ + xdg.configFile."chromium".source = ./config; +} diff --git a/features/apps/elephant/default.nix b/features/apps/elephant/default.nix new file mode 100644 index 0000000..b52ae2f --- /dev/null +++ b/features/apps/elephant/default.nix @@ -0,0 +1,5 @@ +{ config, pkgs, lib, ... }: + +{ + xdg.configFile."elephant".source = ./config; +} diff --git a/features/apps/ghostty/default.nix b/features/apps/ghostty/default.nix new file mode 100644 index 0000000..d0e8525 --- /dev/null +++ b/features/apps/ghostty/default.nix @@ -0,0 +1,5 @@ +{ config, pkgs, lib, ... }: + +{ + xdg.configFile."ghostty".source = ./config; +} diff --git a/features/apps/kitty/default.nix b/features/apps/kitty/default.nix new file mode 100644 index 0000000..f58d0d3 --- /dev/null +++ b/features/apps/kitty/default.nix @@ -0,0 +1,5 @@ +{ config, pkgs, lib, ... }: + +{ + xdg.configFile."kitty".source = ./config; +} diff --git a/features/apps/lazygit/default.nix b/features/apps/lazygit/default.nix new file mode 100644 index 0000000..c7cde14 --- /dev/null +++ b/features/apps/lazygit/default.nix @@ -0,0 +1,5 @@ +{ config, pkgs, lib, ... }: + +{ + xdg.configFile."lazygit".source = ./config; +} diff --git a/features/apps/opencode/default.nix b/features/apps/opencode/default.nix new file mode 100644 index 0000000..9a5531c --- /dev/null +++ b/features/apps/opencode/default.nix @@ -0,0 +1,5 @@ +{ config, pkgs, lib, ... }: + +{ + xdg.configFile."opencode".source = ./config; +} diff --git a/features/apps/scripts/nomarchy-launch-walker b/features/apps/scripts/nomarchy-launch-walker deleted file mode 100755 index 8b239f1..0000000 --- a/features/apps/scripts/nomarchy-launch-walker +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Launch the Walker application launcher while ensuring that it's data provider (called elephant) is running first. - -# Ensure elephant is running before launching walker -if ! pgrep -x elephant > /dev/null; then - setsid uwsm-app -- elephant & -fi - -# Ensure walker service is running -if ! pgrep -f "walker --gapplication-service" > /dev/null; then - setsid uwsm-app -- walker --gapplication-service & -fi - -exec walker --width 644 --maxheight 300 --minheight 300 "$@" diff --git a/features/apps/tmux/default.nix b/features/apps/tmux/default.nix new file mode 100644 index 0000000..f1372c7 --- /dev/null +++ b/features/apps/tmux/default.nix @@ -0,0 +1,5 @@ +{ config, pkgs, lib, ... }: + +{ + xdg.configFile."tmux".source = ./config; +} diff --git a/features/apps/vscode.nix b/features/apps/vscode.nix index 93c6858..a85e2fe 100644 --- a/features/apps/vscode.nix +++ b/features/apps/vscode.nix @@ -1,7 +1,11 @@ { config, pkgs, lib, ... }: let - themeConfig = builtins.fromJSON (builtins.readFile (../../themes/palettes + "/${config.nomarchy.theme}/vscode.json")); + themePath = ../../themes/palettes + "/${config.nomarchy.theme}/apps/vscode.json"; + themeConfig = if builtins.pathExists themePath then + builtins.fromJSON (builtins.readFile themePath) + else + { name = "Default Dark Modern"; }; # Development extensions that match the system theme devExtensions = with pkgs.vscode-extensions; [ @@ -40,7 +44,7 @@ in programs.vscode = { enable = lib.mkDefault true; package = lib.mkDefault pkgs.vscode; - userSettings = lib.mkDefault { + profiles.default.userSettings = lib.mkDefault { "update.mode" = "none"; "workbench.colorTheme" = themeConfig.name; "window.titleBarStyle" = "custom"; diff --git a/features/default.nix b/features/default.nix index 31e3471..9d3b086 100644 --- a/features/default.nix +++ b/features/default.nix @@ -15,28 +15,30 @@ in imports = [ inputs.nix-colors.homeManagerModules.default inputs.walker.homeManagerModules.default + ../core/home ../themes/engine/stylix-compat.nix - ../core/home/options.nix - ../core/home/state.nix - ../core/home/overrides.nix - ../core/home/behavior.nix ../themes/engine/loader.nix ../themes/engine/files.nix - ../core/home/fonts.nix + ../themes/engine/stylix.nix + ../themes/engine/switcher.nix ./apps/alacritty/default.nix + ./apps/btop/default.nix + ./apps/chromium/default.nix + ./apps/elephant/default.nix + ./apps/ghostty/default.nix + ./apps/kitty/default.nix + ./apps/lazygit/default.nix + ./apps/opencode/default.nix + ./apps/tmux/default.nix + ./apps/vscode.nix + ./apps/walker.nix + ./apps/swayosd.nix ./desktop/nightlight.nix ./desktop/idle.nix - ../themes/engine/stylix.nix ./desktop/hyprland/default.nix ./desktop/waybar/default.nix - ./apps/walker.nix - ../themes/engine/switcher.nix ./scripts/default.nix - ../core/home/configs.nix - ./apps/swayosd.nix - ../core/home/security.nix ./scripts/battery-monitor.nix - ../core/home/bash.nix ]; diff --git a/features/desktop/hyprland/config/bindings.conf b/features/desktop/hyprland/config/bindings.conf index 2e55d45..ca15e82 100644 --- a/features/desktop/hyprland/config/bindings.conf +++ b/features/desktop/hyprland/config/bindings.conf @@ -29,6 +29,6 @@ bindd = SUPER SHIFT ALT, X, X Post, exec, nomarchy-launch-webapp "https://x.com/ # Add extra bindings # bind = SUPER SHIFT, R, exec, alacritty -e ssh your-server -# Overwrite existing bindings, like putting Nomarchy Menu on Super + Space +# Overwrite existing bindings, like putting Nomarchy Menu back on Super + Space # unbind = SUPER, SPACE # bindd = SUPER, SPACE, Nomarchy menu, exec, nomarchy-menu diff --git a/features/apps/scripts/nomarchy-launch-about b/features/scripts/utils/nomarchy-launch-about similarity index 100% rename from features/apps/scripts/nomarchy-launch-about rename to features/scripts/utils/nomarchy-launch-about diff --git a/features/apps/scripts/nomarchy-launch-audio b/features/scripts/utils/nomarchy-launch-audio similarity index 100% rename from features/apps/scripts/nomarchy-launch-audio rename to features/scripts/utils/nomarchy-launch-audio diff --git a/features/apps/scripts/nomarchy-launch-bluetooth b/features/scripts/utils/nomarchy-launch-bluetooth similarity index 100% rename from features/apps/scripts/nomarchy-launch-bluetooth rename to features/scripts/utils/nomarchy-launch-bluetooth diff --git a/features/apps/scripts/nomarchy-launch-browser b/features/scripts/utils/nomarchy-launch-browser similarity index 100% rename from features/apps/scripts/nomarchy-launch-browser rename to features/scripts/utils/nomarchy-launch-browser diff --git a/features/apps/scripts/nomarchy-launch-editor b/features/scripts/utils/nomarchy-launch-editor similarity index 100% rename from features/apps/scripts/nomarchy-launch-editor rename to features/scripts/utils/nomarchy-launch-editor diff --git a/features/apps/scripts/nomarchy-launch-floating-terminal-with-presentation b/features/scripts/utils/nomarchy-launch-floating-terminal-with-presentation similarity index 100% rename from features/apps/scripts/nomarchy-launch-floating-terminal-with-presentation rename to features/scripts/utils/nomarchy-launch-floating-terminal-with-presentation diff --git a/features/apps/scripts/nomarchy-launch-or-focus b/features/scripts/utils/nomarchy-launch-or-focus similarity index 100% rename from features/apps/scripts/nomarchy-launch-or-focus rename to features/scripts/utils/nomarchy-launch-or-focus diff --git a/features/apps/scripts/nomarchy-launch-or-focus-tui b/features/scripts/utils/nomarchy-launch-or-focus-tui similarity index 100% rename from features/apps/scripts/nomarchy-launch-or-focus-tui rename to features/scripts/utils/nomarchy-launch-or-focus-tui diff --git a/features/apps/scripts/nomarchy-launch-or-focus-webapp b/features/scripts/utils/nomarchy-launch-or-focus-webapp similarity index 100% rename from features/apps/scripts/nomarchy-launch-or-focus-webapp rename to features/scripts/utils/nomarchy-launch-or-focus-webapp diff --git a/features/apps/scripts/nomarchy-launch-screensaver b/features/scripts/utils/nomarchy-launch-screensaver similarity index 100% rename from features/apps/scripts/nomarchy-launch-screensaver rename to features/scripts/utils/nomarchy-launch-screensaver diff --git a/features/apps/scripts/nomarchy-launch-tui b/features/scripts/utils/nomarchy-launch-tui similarity index 100% rename from features/apps/scripts/nomarchy-launch-tui rename to features/scripts/utils/nomarchy-launch-tui diff --git a/features/scripts/utils/nomarchy-launch-walker b/features/scripts/utils/nomarchy-launch-walker index 579e59b..be63abd 100644 --- a/features/scripts/utils/nomarchy-launch-walker +++ b/features/scripts/utils/nomarchy-launch-walker @@ -3,10 +3,17 @@ # Wrapper to launch walker with elephant provider, or fallback to rofi if walker is missing. if command -v walker >/dev/null 2>&1; then + # Ensure elephant is running before launching walker if ! pgrep -x elephant > /dev/null; then setsid uwsm-app -- elephant & fi - exec uwsm-app -- walker "$@" + + # Ensure walker service is running + if ! pgrep -f "walker --gapplication-service" > /dev/null; then + setsid uwsm-app -- walker --gapplication-service & + fi + + exec uwsm-app -- walker --width 644 --maxheight 300 --minheight 300 "$@" elif command -v rofi >/dev/null 2>&1; then # Convert walker arguments to rofi arguments if possible # This is a very basic mapping for --dmenu diff --git a/features/apps/scripts/nomarchy-launch-webapp b/features/scripts/utils/nomarchy-launch-webapp similarity index 100% rename from features/apps/scripts/nomarchy-launch-webapp rename to features/scripts/utils/nomarchy-launch-webapp diff --git a/features/apps/scripts/nomarchy-launch-wifi b/features/scripts/utils/nomarchy-launch-wifi similarity index 100% rename from features/apps/scripts/nomarchy-launch-wifi rename to features/scripts/utils/nomarchy-launch-wifi diff --git a/features/scripts/utils/nomarchy-menu b/features/scripts/utils/nomarchy-menu index 550e594..4b815ee 100755 --- a/features/scripts/utils/nomarchy-menu +++ b/features/scripts/utils/nomarchy-menu @@ -348,8 +348,9 @@ show_main_menu() { go_to_menu() { case "${1,,}" in - *apps*) walker -p "Launch…" ;; + *apps*) nomarchy-launch-walker ;; *learn*) show_learn_menu ;; + *symbols*) nomarchy-launch-walker -m symbols ;; *trigger*) show_trigger_menu ;; *toggle*) show_toggle_menu ;; *share*) show_share_menu ;; diff --git a/features/apps/scripts/nomarchy-restart-app b/features/scripts/utils/nomarchy-restart-app similarity index 100% rename from features/apps/scripts/nomarchy-restart-app rename to features/scripts/utils/nomarchy-restart-app diff --git a/features/apps/scripts/nomarchy-restart-btop b/features/scripts/utils/nomarchy-restart-btop similarity index 100% rename from features/apps/scripts/nomarchy-restart-btop rename to features/scripts/utils/nomarchy-restart-btop diff --git a/features/apps/scripts/nomarchy-restart-opencode b/features/scripts/utils/nomarchy-restart-opencode similarity index 100% rename from features/apps/scripts/nomarchy-restart-opencode rename to features/scripts/utils/nomarchy-restart-opencode diff --git a/features/apps/scripts/nomarchy-restart-terminal b/features/scripts/utils/nomarchy-restart-terminal similarity index 100% rename from features/apps/scripts/nomarchy-restart-terminal rename to features/scripts/utils/nomarchy-restart-terminal diff --git a/features/apps/scripts/nomarchy-restart-tmux b/features/scripts/utils/nomarchy-restart-tmux similarity index 100% rename from features/apps/scripts/nomarchy-restart-tmux rename to features/scripts/utils/nomarchy-restart-tmux diff --git a/features/apps/scripts/nomarchy-tui-install b/features/scripts/utils/nomarchy-tui-install similarity index 100% rename from features/apps/scripts/nomarchy-tui-install rename to features/scripts/utils/nomarchy-tui-install diff --git a/features/apps/scripts/nomarchy-tui-remove b/features/scripts/utils/nomarchy-tui-remove similarity index 100% rename from features/apps/scripts/nomarchy-tui-remove rename to features/scripts/utils/nomarchy-tui-remove diff --git a/features/apps/scripts/nomarchy-tui-remove-all b/features/scripts/utils/nomarchy-tui-remove-all similarity index 100% rename from features/apps/scripts/nomarchy-tui-remove-all rename to features/scripts/utils/nomarchy-tui-remove-all diff --git a/features/apps/scripts/nomarchy-voxtype-config b/features/scripts/utils/nomarchy-voxtype-config similarity index 100% rename from features/apps/scripts/nomarchy-voxtype-config rename to features/scripts/utils/nomarchy-voxtype-config diff --git a/features/apps/scripts/nomarchy-voxtype-install b/features/scripts/utils/nomarchy-voxtype-install similarity index 100% rename from features/apps/scripts/nomarchy-voxtype-install rename to features/scripts/utils/nomarchy-voxtype-install diff --git a/features/apps/scripts/nomarchy-voxtype-model b/features/scripts/utils/nomarchy-voxtype-model similarity index 100% rename from features/apps/scripts/nomarchy-voxtype-model rename to features/scripts/utils/nomarchy-voxtype-model diff --git a/features/apps/scripts/nomarchy-voxtype-remove b/features/scripts/utils/nomarchy-voxtype-remove similarity index 100% rename from features/apps/scripts/nomarchy-voxtype-remove rename to features/scripts/utils/nomarchy-voxtype-remove diff --git a/features/apps/scripts/nomarchy-voxtype-status b/features/scripts/utils/nomarchy-voxtype-status similarity index 100% rename from features/apps/scripts/nomarchy-voxtype-status rename to features/scripts/utils/nomarchy-voxtype-status diff --git a/features/apps/scripts/nomarchy-webapp-handler-hey b/features/scripts/utils/nomarchy-webapp-handler-hey similarity index 100% rename from features/apps/scripts/nomarchy-webapp-handler-hey rename to features/scripts/utils/nomarchy-webapp-handler-hey diff --git a/features/apps/scripts/nomarchy-webapp-handler-zoom b/features/scripts/utils/nomarchy-webapp-handler-zoom similarity index 100% rename from features/apps/scripts/nomarchy-webapp-handler-zoom rename to features/scripts/utils/nomarchy-webapp-handler-zoom diff --git a/features/apps/scripts/nomarchy-webapp-install b/features/scripts/utils/nomarchy-webapp-install similarity index 100% rename from features/apps/scripts/nomarchy-webapp-install rename to features/scripts/utils/nomarchy-webapp-install diff --git a/features/apps/scripts/nomarchy-webapp-remove b/features/scripts/utils/nomarchy-webapp-remove similarity index 100% rename from features/apps/scripts/nomarchy-webapp-remove rename to features/scripts/utils/nomarchy-webapp-remove diff --git a/features/apps/scripts/nomarchy-webapp-remove-all b/features/scripts/utils/nomarchy-webapp-remove-all similarity index 100% rename from features/apps/scripts/nomarchy-webapp-remove-all rename to features/scripts/utils/nomarchy-webapp-remove-all diff --git a/features/apps/scripts/nomarchy-windows-vm b/features/scripts/utils/nomarchy-windows-vm similarity index 100% rename from features/apps/scripts/nomarchy-windows-vm rename to features/scripts/utils/nomarchy-windows-vm diff --git a/hosts/installer-iso.nix b/hosts/installer-iso.nix index defa133..a4bad7b 100644 --- a/hosts/installer-iso.nix +++ b/hosts/installer-iso.nix @@ -89,6 +89,13 @@ # Ensure we have a proper shell environment programs.bash.completion.enable = true; + # Auto-launch installer on the main TTY (tty1) + programs.bash.loginShellInit = '' + if [ "$(tty)" = "/dev/tty1" ]; then + nomarchy-install + fi + ''; + # Include documentation documentation.enable = true; documentation.man.enable = true; diff --git a/installer/install.sh b/installer/install.sh index feafa1e..4743e51 100755 --- a/installer/install.sh +++ b/installer/install.sh @@ -21,6 +21,7 @@ BOLD='\033[1m' NOMARCHY_REPO="" TARGET_DRIVE="" USERNAME="" +LUKS_PASSWORD="" USER_PASSWORD="" TIMEZONE="UTC" HARDWARE_MODULES="" @@ -151,7 +152,7 @@ get_luks_passphrase() { pass2=$(gum input --password --placeholder "Confirm passphrase") if [[ "$pass1" == "$pass2" ]]; then - USER_PASSWORD="$pass1" + LUKS_PASSWORD="$pass1" break else error "Passphrases do not match. Try again." @@ -331,15 +332,14 @@ execute_installation() { # 9.1 Partition with disko info "Partitioning disk..." - local escaped_drive disko_file tmp_disko - escaped_drive=$(printf '%s\n' "$TARGET_DRIVE" | sed 's/[[\.*^$()+?{|]/\\&/g') + local disko_file tmp_disko disko_file="$NOMARCHY_REPO/installer/disko-golden.nix" tmp_disko=$(mktemp --suffix=.nix) - sed "s|@TARGET_DRIVE@|$escaped_drive|g" "$disko_file" > "$tmp_disko" + sed "s|@TARGET_DRIVE@|${TARGET_DRIVE}|g" "$disko_file" > "$tmp_disko" - # For LUKS, we need to provide the passphrase - echo -n "$USER_PASSWORD" | disko --mode disko "$tmp_disko" + # Provide the LUKS passphrase via stdin for disk encryption + echo -n "$LUKS_PASSWORD" | disko --mode disko "$tmp_disko" success "Disk partitioned" # 9.2 Generate hardware config diff --git a/themes/engine/files.nix b/themes/engine/files.nix index 032e7b9..2f0e029 100644 --- a/themes/engine/files.nix +++ b/themes/engine/files.nix @@ -5,9 +5,16 @@ let themePath = ../palettes + "/${config.nomarchy.theme}"; themeAppsPath = themePath + "/apps"; nordAppsPath = ../../features/desktop/hyprland/themes/nord; + hyprlandThemePath = ../../features/desktop/hyprland/themes + "/${config.nomarchy.theme}"; - # Check if theme has apps/hyprland.conf + # Check if theme has hyprland.conf in palette apps/ or feature themes/ hasHyprlandConf = builtins.pathExists (themeAppsPath + "/hyprland.conf"); + hasHyprlandFeatureConf = builtins.pathExists (hyprlandThemePath + "/hyprland.conf"); + + hyprlandConfSource = + if hasHyprlandConf then themeAppsPath + "/hyprland.conf" + else if hasHyprlandFeatureConf then hyprlandThemePath + "/hyprland.conf" + else nordAppsPath + "/hyprland.conf"; # Get palette for dynamic CSS generation palette = nomarchyLib.getPalette config.nomarchy.theme; @@ -26,18 +33,16 @@ in @define-color accent #${palette.base0D}; ''; - # Ensure theme-specific hyprland config exists, fallback to nord if not - # Now checking in apps/ subdirectory + # Ensure theme-specific hyprland config exists + # Lookup priority: palette apps/ > feature themes/ > nord fallback xdg.configFile."nomarchy/current/theme/apps/hyprland.conf" = lib.mkIf (!hasHyprlandConf) { - source = nordAppsPath + "/hyprland.conf"; + source = if hasHyprlandFeatureConf then hyprlandThemePath + "/hyprland.conf" + else nordAppsPath + "/hyprland.conf"; }; # Legacy compatibility: symlink apps/hyprland.conf to root for scripts expecting old path xdg.configFile."nomarchy/current/theme/hyprland.conf" = { - source = - if hasHyprlandConf - then themeAppsPath + "/hyprland.conf" - else nordAppsPath + "/hyprland.conf"; + source = hyprlandConfSource; }; xdg.configFile."nomarchy/current/theme.name".text = config.nomarchy.theme; diff --git a/themes/palettes/summer-night/backgrounds/summer-night.png b/themes/palettes/summer-night/backgrounds/1-summer-night.png similarity index 100% rename from themes/palettes/summer-night/backgrounds/summer-night.png rename to themes/palettes/summer-night/backgrounds/1-summer-night.png diff --git a/themes/palettes/summer-night/backgrounds/summer-day.png b/themes/palettes/summer-night/backgrounds/2-summer-day.png similarity index 100% rename from themes/palettes/summer-night/backgrounds/summer-day.png rename to themes/palettes/summer-night/backgrounds/2-summer-day.png