diff --git a/CHANGELOG.md b/CHANGELOG.md index 269eda2..b5c7c1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,442 +5,145 @@ --- -# 🚀 **Current Release - ZaneyOS v2.6.1** +# 🚀 **Current Release - ZaneyOS v3.0** -- Removed `discord` and `discord-canary` - - They use an outdated `electron` - - That build uses and `openssl v1.1.1w` - - That ius OEL and marked insecure in NIXOS - - Users can use an alternativve client until discord is updated -- Disabled `zen browser` in `zaneyos/modules/home/default.nix` - - Needs to be migrated to being enabled via host variable -- Changed from `zen` to `latest` kernel - - Linux kernel v7.0 is much better than 6.19_zen -- Disabled `vfr = true;` in hyprland config - - It's not supportorted after `v54.3` - - Disabling now to avoid error on next update -- Added `awww` as flake input for installs < 25.11 -- Fixed eval warnings: - - `gtk.gtk4.theme` set to `null` - - `git.signing.format` set to `null` -- `nixvim` lualine theme set to `auto` -- Changed to NixOS unstable branch -- Ported `DropTerminal` from `KoolDots` to ZaneyOS - - Replaces pyprland and some python dependencies -- Hyprland updated to v0.54 - - Added support for scrolling and monocle layouts - - Fixed hyprland float-all bindings - - Updated Window Rules for new Hyprland format -- Disabled steam by default -- Removed `adb.enable` no longer supported and not needed for ZaneyOS -- Changed `nixfmt-rfc-style` package for updated `nitfmt` - - `nixfmt-rfc-style` no longer supported -- Fixed other evaluation warnings with `Xorg` package changes +#### 📅 **Updated: April 25th, 2026** -# 🚀 **Current Release - ZaneyOS v2.6.0** +- Moved from `zen` to `latest` kernel + - Kernel v7.0.x is a better kernel than 6.19.zen +- Disabled `vfr` in Hyprland config + - Not supported post Hyprland v0.54.3 +- `nixvim.nix` disabled `noice` + - Caused `press any key` popup after nevoim update +- Created wrtitable directory for neovim project.nvim + - A format update failed to update history + +#### 📅 **Updated: April 7rd, 2026** + +- Improved GPU detection in `install-zaneyos.sh` and `zcli` +- Added `hyprshutdown` + - Not yet wired in +- Changed `zos-next` version to 3.0 +- Added `awww` to flake input + - Had issues installing from nixpkgs on older NixOS versions #### 📅 **Updated: April 3rd, 2026** - Swapped `awww` for `swww` - `swww` is no longer maintained - - removed `--format xrgb` flag also no needed + - removed `--format xrgb` flag also not needed + - Added flake for `awww` was getting error on 25.11 installs of ZOS + +#### 📅 **Updated: March 24th, 2026** + +- Fixed `nixvim` config error + - `lualine` theme set to auto +- Fixed evaluation warnings + - `gtk.gtk4` theme set to `null` + - `git.signing.format` set to `null` + +#### 📅 **Updated: March 16th, 2026** + +- Fixed issues with `qs-wallpaper,qs-wlogout` + - Forced Qt/QML logs to console in qs-wallpapers, qs-vid-wallpapers, and qs-wlogout + - Soo the wrapper scripts can parse selections/commands when launched from Waybar/Rofi. + - Made disown non‑fatal in qs-wallpapers-apply, qs-vid-wallpapers-apply, and qs-wallpapers-restore. + +#### 📅 **Updated: March 4th, 2026** + +- Fixed eval warnings + - for XORG name changes + - `nixfmt-rfc-style` moved to `nixfmt` + - ZSH `dotDir` change in Home Manager +- Ported `DropTerminal` from KoolDots + - Replaces pyprland +- Moved to unstable branch, v26.05 + - Recent upstream issues kept forcing me to patch to resolve + - Otherwise many large packages would build from source +- Fixed "Float All Windows" with Hyprland v0.54+ +- Remapped `legacy keybinds menu` binding to Quickshell menu +- Fixed windowrule for Picture-in-Picture +- `$modifier` was in wrong location in config file. + - It was in the `general{}` section needs to be outside +- Updated the Window Rules for the new format in Hyprland v0.53+ +- Removed the overlays and fixes needed when on Stable branch #### 📅 **Updated: February 19th, 2026** -- Fixed `zcli` GPU detection for newer AMD GPUs - - Fixed the fix to properly detect VMs -- `nixvim.nix` changes - - Disabled Zig language server - - Disabled marksman language server - - Caused dotnet lib to be compiled (takes hours) +- Updated `zcli` GPU detection for newer AMD GPUs +- `nixvim.nix` Changes: + - Disabled Zig Language Server + - Wasn't using it + - Disabled Marksmand Language Server + - Caused dotnet libs to build from source (takes hours) #### 📅 **Updated: February 16th, 2026** -- Removed `hyprpanel` - - No longer maintained - - Vendor created `wayle` to replace it - - Replaced in ZaneyOS with 'noctalia-shell' - - `webkitgtk` being built from source - Removed audacity is called `wxwidgets` - Created overlay for `tumbler` to disable `libepub` - These caused the build from source issue - Building `webkitgtk` takes hours every rebuild/update - -#### 📅 **Updated: January 31st, 2026** - -- Changed default login manager to `TUI` - - Issues recently (again) with SDDM and some GPUs - - Often related to SDDM wayland support option - - Some GPUs need it enabled, others disabled - -#### 📅 **Updated: January 28th, 2026** - -- Disabled gnome in stylix. Caused install failure - -#### 📅 **Updated: January 26th, 2026** - -- `noctalia-shell` regression: - - Removed `noctalia-shell` systemd service - - Caused old version of `noctalia-shell` - - Adjusted `noctalia-shell` bindings to match change -- Default applications now settable - - Globally for all hosts - - `zaneyos/modules/home/xdg.nix` - - Per host - - `zaneyos/hosts/HOSTNAME/variables.nix` - - Host settings override `xdg.nix` settings - -#### 📅 **Updated: January 23rd, 2026** - -- Added additional fonts -- Fixed issue with Hypridle and Home Manager - - Added `systemdTarget = "hyprland-session.target";` - - Thank you `Yang Kexuan` for the fix - - Reference issue: [5899](https://github.com/nix-community/home-manager/issues/5899) - -#### 📅 **Updated: January 5th, 2026** - -- Removed extra newline in `exec-once.nix` -- Fixed typo in `noctalia.nix` -- Added docs reference per systemd spec -- Improved code overall - - Thanks `lichen.gel.calm` for finding these issues -- Disabled `noctalia-shell` systemd service - - Caused older revision of `noctalia-shell` to load - - Now started from hyprland - -#### 📅 **Updated: December 29th, 2025** - -- Removed extra `noctalia-shell` startup -- Added initial support for AMD, NVIDIA Hybrid laptops -- Keypress to recover from DPMS now enabled by default - -#### 📅 **Updated: December 21st, 2025** - -- Added user systemd service for `noctalia-shell` -- Updated Hyprland bindings to accomodate change -- Updated `nixvim` - -## `nixvim` Features Migrated from Bugsvim - -#### Custom Diagnostic Icons - - ```lua - Error = " " - Warn = " " - Hint = "" - Info = "" - ``` - - Custom unicode symbols for each diagnostic severity level - - Integrated into vim.diagnostic.config() for gutter display - -#### Diagnostic Display Options - - - **Sign Column**: Shows diagnostic icons in the gutter with custom text and highlight groups - - **Virtual Text**: Inline diagnostics with custom prefix (`●`) and 2-space spacing - - **Virtual Lines**: Enhanced visibility for error context without cluttering - - **Underline**: Visual underline for error locations - - **Floating Window**: Hover diagnostics with rounded borders and source attribution - - **Severity Sorting**: Errors prioritized over warnings - -### 2. Text Yank Highlighting - - **Migration**: Highlight yanked text for 200ms (IncSearch highlight group) - - Autocmd-based implementation in extraConfigLua - - Uses vim.hl.on_yank for smooth visual feedback - -### 3. LSP Attachment Keybindings - - **Enhanced LSP Integration** with on-attach callbacks: - ``` - K - Hover documentation - gd - Goto definition - gD - Goto declaration - gi - Goto implementation - gr - References - rn - Rename symbol - ca - Code action - ``` - - Buffer-local scope prevents global pollution - - Guard against multiple registrations with flag check - -### 4. Startup Dashboard - - **Migration**: alpha-nvim with custom banner generation - -#### Dynamic Header Generation - - - Primary: `toilet -f ansi-shadow NIXOS` - - Secondary: `figlet -f "ANSI Shadow" NIXOS` - - Tertiary: `figlet NIXOS` - - Fallback: ASCII art banner (9 lines) - -#### Dashboard Buttons - - | Shortcut | Action | Command | - |----------|--------|---------| - | `f` | Find file | Telescope find_files | - | `r` | Recent files | Telescope oldfiles | - | `g` | Live grep | Telescope live_grep | - | `n` | New file | :enew | - | `e` | File browser | Neotree toggle | - | `q` | Quit | :qa | - -#### Footer - - Dynamic version display: `NixVim • Neovim X.Y.Z` - -### 5. Theme Integration - - **Migration**: Tokyo Night colorscheme with Stylix integration - - Tokyo Night colors for status line (lualine) - - Notify background color tied to Stylix palette: `#${config.lib.stylix.colors.base01}` - - Consistent color management across UI components - -## Comprehensive Feature Set - -### UI/Visuals Migrated - - - Lualine status line (Tokyo Night theme) - - Bufferline for buffer management - - Indent-blankline for visual indentation - - Colorizer for inline color display - - Illuminate for reference highlighting - - Which-key for keybinding discovery (Helix preset) - -### Core Editing - - - Treesitter for syntax highlighting - - Neo-tree file browser - - Telescope fuzzy finder with media_files extension - - Project.nvim for project management - - Hop/Leap motion plugins - - vim-surround for text manipulation - - Comment.nvim for toggle comments - -### Advanced Features - - - snacks.nvim ecosystem (terminal, scratch buffers, zen mode, git integration, notifier) - - Noice for enhanced UI/messages - - Notify for notifications - - todo-comments for task navigation - - nvim-autopairs with Treesitter support - -### Language Support - - **LSP Servers**: nil_ls, lua_ls, pyright, ts_ls, html, cssls, clangd, zls, marksman, hyprls, tailwindcss, bashls - - **Formatters**: - - Nix: alejandra - - Lua: stylua - - JavaScript/TypeScript: prettierd - - Shell: shfmt - - **Completion**: blink-cmp with luasnip snippets - -### Development Tools - - - Git integration: gitsigns + diffview - - Markdown preview - - Trouble diagnostics panel - - Terminal: toggleterm with float direction - -## Implementation Details - -### Module Structure - - - **File**: `modules/home/editors/nixvim.nix` (743 lines) - - **Framework**: Nixvim home-manager module - - **Theme**: Tokyo Night (primary), Catppuccin (fallback) - - **Runtime Tools**: 23+ packages (bat, chafa, fd, figlet, lazygit, prettierd, ripgrep, etc.) - -## Keybinding Highlights - - ``` - jk - Exit insert mode - ff - Find files - fm - Find media files - lg - Live grep - fe - File explorer toggle - t - Toggle terminal - . - Toggle comment (line/visual) - z - Zen mode - Z - Zoom - gg - Lazygit - - Terminal (via snacks) - ]t / [t - Next/prev TODO comment - n - Notification history - ``` - -#### 📅 **Updated: December 21st, 2025** - -- Added user systemd service for `noctalia-shell` -- Updated Hyprland bindings to accomodate change -- Updated `nixvim` - -## `nixvim` Features Migrated from Bugsvim - -#### Custom Diagnostic Icons - - ```lua - Error = " " - Warn = " " - Hint = "" - Info = "" - ``` - - Custom unicode symbols for each diagnostic severity level - - Integrated into vim.diagnostic.config() for gutter display - -#### Diagnostic Display Options - - - **Sign Column**: Shows diagnostic icons in the gutter with custom text and highlight groups - - **Virtual Text**: Inline diagnostics with custom prefix (`●`) and 2-space spacing - - **Virtual Lines**: Enhanced visibility for error context without cluttering - - **Underline**: Visual underline for error locations - - **Floating Window**: Hover diagnostics with rounded borders and source attribution - - **Severity Sorting**: Errors prioritized over warnings - -### 2. Text Yank Highlighting - - **Migration**: Highlight yanked text for 200ms (IncSearch highlight group) - - Autocmd-based implementation in extraConfigLua - - Uses vim.hl.on_yank for smooth visual feedback - -### 3. LSP Attachment Keybindings - - **Enhanced LSP Integration** with on-attach callbacks: - ``` - K - Hover documentation - gd - Goto definition - gD - Goto declaration - gi - Goto implementation - gr - References - rn - Rename symbol - ca - Code action - ``` - - Buffer-local scope prevents global pollution - - Guard against multiple registrations with flag check - -### 4. Startup Dashboard - - **Migration**: alpha-nvim with custom banner generation - -#### Dynamic Header Generation - - - Primary: `toilet -f ansi-shadow NIXOS` - - Secondary: `figlet -f "ANSI Shadow" NIXOS` - - Tertiary: `figlet NIXOS` - - Fallback: ASCII art banner (9 lines) - -#### Dashboard Buttons - - | Shortcut | Action | Command | - |----------|--------|---------| - | `f` | Find file | Telescope find_files | - | `r` | Recent files | Telescope oldfiles | - | `g` | Live grep | Telescope live_grep | - | `n` | New file | :enew | - | `e` | File browser | Neotree toggle | - | `q` | Quit | :qa | - -#### Footer - - Dynamic version display: `NixVim • Neovim X.Y.Z` - -### 5. Theme Integration - - **Migration**: Tokyo Night colorscheme with Stylix integration - - Tokyo Night colors for status line (lualine) - - Notify background color tied to Stylix palette: `#${config.lib.stylix.colors.base01}` - - Consistent color management across UI components - -## Comprehensive Feature Set - -### UI/Visuals Migrated - - - Lualine status line (Tokyo Night theme) - - Bufferline for buffer management - - Indent-blankline for visual indentation - - Colorizer for inline color display - - Illuminate for reference highlighting - - Which-key for keybinding discovery (Helix preset) - -### Core Editing - - - Treesitter for syntax highlighting - - Neo-tree file browser - - Telescope fuzzy finder with media_files extension - - Project.nvim for project management - - Hop/Leap motion plugins - - vim-surround for text manipulation - - Comment.nvim for toggle comments - -### Advanced Features - - - snacks.nvim ecosystem (terminal, scratch buffers, zen mode, git integration, notifier) - - Noice for enhanced UI/messages - - Notify for notifications - - todo-comments for task navigation - - nvim-autopairs with Treesitter support - -### Language Support - - **LSP Servers**: nil_ls, lua_ls, pyright, ts_ls, html, cssls, clangd, zls, marksman, hyprls, tailwindcss, bashls - - **Formatters**: - - Nix: alejandra - - Lua: stylua - - JavaScript/TypeScript: prettierd - - Shell: shfmt - - **Completion**: blink-cmp with luasnip snippets - -### Development Tools - - - Git integration: gitsigns + diffview - - Markdown preview - - Trouble diagnostics panel - - Terminal: toggleterm with float direction - -## Implementation Details - -### Module Structure - - - **File**: `modules/home/editors/nixvim.nix` (743 lines) - - **Framework**: Nixvim home-manager module - - **Theme**: Tokyo Night (primary), Catppuccin (fallback) - - **Runtime Tools**: 23+ packages (bat, chafa, fd, figlet, lazygit, prettierd, ripgrep, etc.) - -## Keybinding Highlights - - ``` - jk - Exit insert mode - ff - Find files - fm - Find media files - lg - Live grep - fe - File explorer toggle - t - Toggle terminal - . - Toggle comment (line/visual) - z - Zen mode - Z - Zoom - gg - Lazygit - - Terminal (via snacks) - ]t / [t - Next/prev TODO comment - n - Notification history - ``` - -#### 📅 **Updated: December 21st, 2025** - -- Updated: - - `nixvim.nix` now uses `blink-cmp` for completion/suggestions - - This replaces `nvim-cmp` - - `blink-cmp` is better, integrated in nixvim - - Removed LUA code related to `nvim-cmp` - +- Removed `hyprpanel` + - Not being maintained + - Vendor is building it's replacement `wayle` + - It's been replaced by `noctalia-shell` + +#### 📅 **Updated: January 6th, 2026** + +- Disabled `noctalia-shell` service + - Caused old version to be loaded + - Re-Added `noctalia-shell` to Hyprland startup +- Removed `pypr` from Hyprland startup + - `pyprland` isn't used by default anymore +- Fixed error in waybar file +- Fixed `alejandra` error running `nix fmt` + - As a result of changing to `nix-systems` + +#### 📅 **Updated: January 3rd, 2026** + +- Changed: + - moved to `nix-systems` + - better management of Architecture types - Fixed: - - Output of `zcli list-gens` corrected - - Thanks `@codingismy11to71` + - Pressing a key now also does DPMS wakeup + - Noctalia Shell started twice + - Removed it from hyprland exec-once + - It runs as systemctl user service + - Corrected the keybinds to work with systemd user service +- Cleanup: + - Home mgr packages + +#### 📅 **Updated: December 24th, 2025** + +- Added: +- Option to disable/enable scanners +- Hardware clock options enhanced +- Moved flatpak to own config file and out of flake.nix + - Thnaks [codingismy11to7](https://github.com/codingismy11to7) +- `Caligula` TUI for writing ISOs + +#### 📅 **Updated: December 22th, 2025** + +- Huge refactor in flake and how variables are handled + - Huge shout out to [codingismy11to7](https://github.com/codingismy11to7) + - Using hostname for flake, not GPU profile + - Greatly simplied functions to reference per-host variables + - Install script updated and now also uses Python for better text handling + - Same commands as before using `zcli` util. + - Removed redundant git clones during install + - Hosts are saved in the flake no need to `zcli update-host` + - Updated `zcli` `add-host` and `del-host` updated ' + - New feature `zcli list-hosts` added + +#### 📅 **Updated: December 20th, 2025** + +- Refactored: + - Introduced `modules/options.nix` as a central location for `zaneyos` option definitions. + - Updated `flake.nix` to import `modules/core` directly. +- Documentation: + - Updated `README.md`, `WARP.md`, `FAQ.md`, and `cheatsheets/project-guide.md` to reflect the new structure. + - Updated Spanish documentation (`README.es.md`, `FAQ.es.md`, etc.). #### 📅 **Updated: December 14th, 2025** diff --git a/FAQ.es.md b/FAQ.es.md index 5a08953..8b6f029 100644 --- a/FAQ.es.md +++ b/FAQ.es.md @@ -1,6 +1,6 @@ [English](FAQ.md) | [Español](FAQ.es.md) -# 💬 Preguntas frecuentes de ZaneyOS +# 💬 Preguntas frecuentes de ZaneyOS para v2.5.6 - **Fecha:** 14 de deciembre de 2025 @@ -139,32 +139,6 @@ zcli doom status # Verifica estado de instalación -
-**¿Cómo configuro aplicaciones predeterminadas (PDF, navegador) por host?** - -- Edita `~/zaneyos/hosts//variables.nix` y descomenta `mimeDefaultApps`. -- Home Manager usará esto vía `modules/home/xdg.nix` para escribir tu `~/.config/mimeapps.list`. -- Usa IDs `.desktop` reales de `/usr/share/applications` o `~/.local/share/applications`. - -```nix -# hosts//variables.nix -# Aplicaciones predeterminadas a nivel de host (consumidas por xdg.mimeApps) -# mimeDefaultApps = { -# # PDFs -# "application/pdf" = ["okular.desktop"]; -# "application/x-pdf" = ["okular.desktop"]; -# # Navegador web -# "x-scheme-handler/http" = ["google-chrome.desktop"]; # o brave-browser.desktop, firefox.desktop -# "x-scheme-handler/https" = ["google-chrome.desktop"]; -# "text/html" = ["google-chrome.desktop"]; -# # Archivos -# "inode/directory" = ["thunar.desktop"]; # gestor de archivos -# "text/plain" = ["nvim.desktop"]; # o code.desktop -# }; -``` - -
- ## Atajos Principales de Hyprland A continuación se muestran los atajos de teclado para Hyprland, formateados para @@ -190,7 +164,7 @@ fácil referencia. - `$modifier + C` → Ejecutar `hyprpicker -a` - `$modifier + G` → Abrir `GIMP` - `$modifier + V` → Mostrar historial de portapapeles vía `cliphist` -- `$modifier + T` → Alternar terminal con `pypr` +- `$modifier + Shift + T` → Alternar terminal desplegable con `DropTerminal` - `$modifier + M` → Abrir `pavucontrol` ## Gestión de Ventanas @@ -264,6 +238,34 @@ fácil referencia.
+
+**¿Cómo configuro aplicaciones predeterminadas (PDF, navegador) por host?** + +- Edita `~/zaneyos/hosts//variables.nix` dentro del bloque `zaneyos = { ... }` y descomenta `mimeDefaultApps`. +- Home Manager consume `zaneyos.mimeDefaultApps` vía `modules/home/xdg.nix` para escribir `~/.config/mimeapps.list`. +- Usa IDs `.desktop` reales de `/usr/share/applications` o `~/.local/share/applications`. + +```nix +zaneyos = { + # ... otros ajustes ... + # Aplicaciones predeterminadas (consumidas por xdg.mimeApps) + # mimeDefaultApps = { + # # PDFs + # "application/pdf" = ["okular.desktop"]; + # "application/x-pdf" = ["okular.desktop"]; + # # Navegador web + # "x-scheme-handler/http" = ["google-chrome.desktop"]; # o brave-browser.desktop, firefox.desktop + # "x-scheme-handler/https" = ["google-chrome.desktop"]; + # "text/html" = ["google-chrome.desktop"]; + # # Archivos + # "inode/directory" = ["thunar.desktop"]; # gestor de archivos + # "text/plain" = ["nvim.desktop"]; # o code.desktop + # }; +}; +``` + +
+
**¿Cómo agrego flatpaks?** @@ -413,9 +415,9 @@ Edita la línea `extraMonitorSettings`. **Ejemplos:** - Monitor Único: `extraMonitorSettings = "monitor=eDP-1,1920x1080@60,auto,1";` - Monitores Múltiples: `extraMonitorSettings = " - monitor=eDP-1,1920x1080@60,auto,auto - monitor=HDMI-A-1,2560x1440@75,auto,auto - ";` + monitor=eDP-1,1920x1080@60,auto,auto + monitor=HDMI-A-1,2560x1440@75,auto,auto + ";` - Para configuraciones multi-monitor más complejas, puedes usar la aplicación GUI, `nwg-displays` Esta mostrará tus monitores conectados actualmente @@ -479,7 +481,7 @@ agrega tus paquetes. ncdu nvtopPackages.full oh-my-posh - pyprland + DropTerminal shellcheck multimarkdown nodejs_23 @@ -838,7 +840,7 @@ settings = { "killall -q swaync;sleep .5 && swaync" "nm-applet --indicator" "lxqt-policykit-agent" - "pypr &" + "DropTerminal --spawn-only" #"sleep 1.5 && awww img /home/${username}/Pictures/Wallpapers/zaney-wallpaper.jpg" "sleep 1 && wallsetter" ]; diff --git a/FAQ.md b/FAQ.md index 32c6708..cd9fca1 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1,6 +1,6 @@ [English](FAQ.md) | [Español](FAQ.es.md) -# 💬 ZaneyOS FAQ +# 💬 ZaneyOS FAQ for v2.5.6 - **Date:** 14-Decemnber-2025 @@ -160,7 +160,7 @@ Below are the keybindings for Hyprland, formatted for easy reference. - `$modifier + C` → Run `hyprpicker -a` - `$modifier + G` → Open `GIMP` - `$modifier + V` → Show clipboard history via `cliphist` -- `$modifier + T` → Toggle terminal with `pypr` +- `$modifier + Shift + T` → Toggle dropdown terminal with `DropTerminal` - `$modifier + M` → Open `pavucontrol` ## Window Management @@ -231,25 +231,27 @@ Below are the keybindings for Hyprland, formatted for easy reference.
**How do I set default apps (PDF, browser) per host?** -- Edit `~/zaneyos/hosts//variables.nix` and uncomment `mimeDefaultApps`. -- Home Manager will consume these via `modules/home/xdg.nix` to write your `~/.config/mimeapps.list`. +- Edit `~/zaneyos/hosts//variables.nix` inside the `zaneyos = { ... }` block and uncomment `mimeDefaultApps`. +- Home Manager consumes `zaneyos.mimeDefaultApps` via `modules/home/xdg.nix` and writes `~/.config/mimeapps.list`. - Use real `.desktop` IDs from `/usr/share/applications` or `~/.local/share/applications`. ```nix -# hosts//variables.nix -# Host-level default applications (picked up by Home Manager xdg.mimeApps) -# mimeDefaultApps = { -# # PDFs -# "application/pdf" = ["okular.desktop"]; -# "application/x-pdf" = ["okular.desktop"]; -# # Web browser -# "x-scheme-handler/http" = ["google-chrome.desktop"]; # or brave-browser.desktop, firefox.desktop -# "x-scheme-handler/https" = ["google-chrome.desktop"]; -# "text/html" = ["google-chrome.desktop"]; -# # Files -# "inode/directory" = ["thunar.desktop"]; # file manager -# "text/plain" = ["nvim.desktop"]; # or code.desktop -# }; +zaneyos = { + # ... other settings ... + # Default applications (picked up by HM xdg.mimeApps) + # mimeDefaultApps = { + # # PDFs + # "application/pdf" = ["okular.desktop"]; + # "application/x-pdf" = ["okular.desktop"]; + # # Web browser + # "x-scheme-handler/http" = ["google-chrome.desktop"]; # or brave-browser.desktop, firefox.desktop + # "x-scheme-handler/https" = ["google-chrome.desktop"]; + # "text/html" = ["google-chrome.desktop"]; + # # Files + # "inode/directory" = ["thunar.desktop"]; # file manager + # "text/plain" = ["nvim.desktop"]; # or code.desktop + # }; +}; ```
@@ -401,9 +403,9 @@ Edit the `extraMonitorSettings` line. **Examples:** - Single Monitor: `extraMonitorSettings = "monitor=eDP-1,1920x1080@60,auto,1";` - Multiple Monitors: `extraMonitorSettings = " - monitor=eDP-1,1920x1080@60,auto,auto - monitor=HDMI-A-1,2560x1440@75,auto,auto - ";` + monitor=eDP-1,1920x1080@60,auto,auto + monitor=HDMI-A-1,2560x1440@75,auto,auto + ";` - For more complex, multi-monitor configurations, you may wish to use the GUI application, `nwg-displays` This will show your currently connected monitors @@ -467,7 +469,7 @@ packages. ncdu nvtopPackages.full oh-my-posh - pyprland + DropTerminal shellcheck multimarkdown nodejs_23 @@ -824,7 +826,7 @@ settings = { "killall -q swaync;sleep .5 && swaync" "nm-applet --indicator" "lxqt-policykit-agent" - "pypr &" + "DropTerminal --spawn-only" #"sleep 1.5 && awww img /home/${username}/Pictures/Wallpapers/zaney-wallpaper.jpg" "sleep 1 && wallsetter" ]; @@ -1596,9 +1598,9 @@ Edit the `extraMonitorSettings` line. **Examples:** - Single Monitor: `extraMonitorSettings = "monitor=eDP-1,1920x1080@60,auto,1";` - Multiple Monitors: `extraMonitorSettings = " - monitor=eDP-1,1920x1080@60,auto,auto - monitor=HDMI-A-1,2560x1440@75,auto,auto - ";` + monitor=eDP-1,1920x1080@60,auto,auto + monitor=HDMI-A-1,2560x1440@75,auto,auto + ";` - For more complex, multi-monitor configurations, you may wish to use the GUI application, `nwg-displays` This will show your currently connected monitors @@ -1662,7 +1664,7 @@ packages. ncdu nvtopPackages.full oh-my-posh - pyprland + DropTerminal shellcheck multimarkdown nodejs_23 @@ -2015,7 +2017,7 @@ settings = { "killall -q swaync;sleep .5 && swaync" "nm-applet --indicator" "lxqt-policykit-agent" - "pypr &" + "DropTerminal --spawn-only" #"sleep 1.5 && awww img /home/${username}/Pictures/Wallpapers/zaney-wallpaper.jpg" "sleep 1 && wallsetter" ]; diff --git a/README.es.md b/README.es.md index 1e83376..44b2f4a 100644 --- a/README.es.md +++ b/README.es.md @@ -4,7 +4,7 @@ ## ZaneyOS 🟰 Mejores Configs ❄️ NixOS -\*\* Actualizado: 16 de enero de 2026 +\*\* Actualizado: 8 de deciembre de 2025 ZaneyOS es una forma sencilla de reproducir mi configuración en cualquier sistema NixOS. Incluye el fondo de pantalla, scripts, aplicaciones, archivos de configuración y más. @@ -47,6 +47,13 @@ Incluye el fondo de pantalla, scripts, aplicaciones, archivos de configuración - Guía para Principiantes de Nix: [English](cheatsheets/nix-beginner-guide.md) | [Español](cheatsheets/nix-beginner-guide.es.md) - Guía de Personalización de Hyprland: [English](cheatsheets/hyprland-customization-guide.md) | [Español](cheatsheets/hyprland-customization-guide.es.md) +### Ten en cuenta: + +> **Este proyecto tiene un [Wiki](https://zaney.org/wiki/zaneyos-2.3/). ¡Aprende a usar ZaneyOS aquí!** +> **ddubs ha puesto mucho esfuerzo en el +> [FAQ](https://zaney.org/wiki/zaneyos-2.3/faq), así que debería ser preciso. +> Sin embargo, si notas que algo está mal, crea un issue o contáctanos en Discord.** + #### 🍖 Requisitos - Debes estar ejecutando NixOS, versión 23.11+. @@ -82,6 +89,13 @@ Incluye el fondo de pantalla, scripts, aplicaciones, archivos de configuración - Muchas personas pacientes y con ganas de ayudar te apoyan usando ZaneyOS. - No dudes en pasar por el Discord para pedir ayuda. +
+ +Hazte un favor y +[lee el wiki](https://zaney.org/wiki/zaneyos-2.3/). + +
+ #### 📦 ¿Cómo instalo paquetes? - Puedes buscar en [Nix Packages](https://search.nixos.org/packages?) y @@ -95,7 +109,9 @@ Incluye el fondo de pantalla, scripts, aplicaciones, archivos de configuración - Siéntete libre de abrir un issue en el repo. Por favor etiqueta las solicitudes de funcionalidades comenzando el título con [feature request], ¡gracias! -- Contáctanos también en [Discord](https://discord.gg/XhZmNTnhtp) para una respuesta potencialmente más rápida. +- Contáctanos también en [Discord](https://discord.gg/2cRdBs8) para una respuesta potencialmente más rápida. + +- No olvides revisar el [FAQ](https://zaney.org/wiki/zaneyos-2.3/faq) # Atajos de Hyprland @@ -123,7 +139,7 @@ A continuación los atajos de Hyprland, en formato de referencia rápida. La col - `$modifier + O` → Lanzar `OBS Studio` - `$modifier + Alt + C` → Selector de color - `$modifier + G` → Abrir `GIMP` -- `$modifier + T` → Alternar terminal con `pypr` +- `$modifier + Shift + T` → Alternar terminal desplegable con `DropTerminal` - `$modifier + Alt + M` → Abrir `pavucontrol` ### Gestión de ventanas @@ -224,7 +240,7 @@ Luego: ![Comando del script de instalación de ZaneyOS](img/install-script.jpg) ``` -sh <(curl -L https://gitlab.com/Zaney/zaneyos/-/raw/main/install-zaneyos.sh) +sh <(curl -L https://gitlab.com/Zaney/zaneyos/-/raw/stable-2.4/install-zaneyos.sh) ``` #### El proceso de instalación se verá así: @@ -255,7 +271,7 @@ nix-shell -p git vim 2. Clona este repo y entra: ``` -cd && git clone https://gitlab.com/zaney/zaneyos.git -b main --depth=1 ~/zaneyos +cd && git clone https://gitlab.com/zaney/zaneyos.git -b stable-2.4 --depth=1 ~/zaneyos cd zaneyos También puedes ejecutar el script `install.sh` si quieres. @@ -295,9 +311,8 @@ Ahora, cuando quieras reconstruir, tienes el alias `fr` que reconstruye el flake Gracias por toda su ayuda -- KoolDots https://github.com/LinuxBeginnings - Jakookit https://github.com/jakookit -- Justaguylinux https://codeberg.org/Justaguylinux +- Justaguylinux https://github.com/drewgrif - Jerry Starke https://github.com/JerrySM64 ## ¡Disfruta! diff --git a/README.md b/README.md index 375ced2..84f5b15 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## ZaneyOS 🟰 Best ❄️ NixOS Configs -\*\* Updated: January 16th, 2026 +\*\* Updated: December 8th,2025 ZaneyOS is a simple way of reproducing my configuration on any NixOS system. This includes the wallpaper, scripts, applications, config files, and more. @@ -55,6 +55,14 @@ This includes the wallpaper, scripts, applications, config files, and more. [English](cheatsheets/hyprland-customization-guide.md) | [Español](cheatsheets/hyprland-customization-guide.es.md) +### Please note: + +> **This project has a [Wiki](https://zaney.org/wiki/zaneyos-2.3/). Find out how +> to use ZaneyOS here!** **ddubs has put a lot of effort into the +> [FAQ](https://zaney.org/wiki/zaneyos-2.3/faq) so it should be accurate. +> However, please if you notice that something is wrong with it create an issue +> or reach out to us on Discord.** + #### 🍖 Requirements - You must be running on NixOS, version 24.05+. @@ -94,6 +102,13 @@ This includes the wallpaper, scripts, applications, config files, and more. running ZaneyOS. - Feel free to reach out on the Discord for any help with anything. +
+ +Please do yourself a favor and +[read the wiki](https://zaney.org/wiki/zaneyos-2.3/). + +
+ #### 📦 How To Install Packages? - You can search the [Nix Packages](https://search.nixos.org/packages?) & @@ -108,9 +123,11 @@ This includes the wallpaper, scripts, applications, config files, and more. - Please feel free to raise an issue on the repo, please label a feature request with the title beginning with [feature request], thank you! -- Contact us on [Discord](https://discord.gg/XhZmNTnhtp) as well, for a potentially +- Contact us on [Discord](https://discord.gg/2cRdBs8) as well, for a potentially faster response. +- Don't forget to checkout the [FAQ](https://zaney.org/wiki/zaneyos-2.3/faq) + # Hyprland Keybindings Below are the keybindings for Hyprland, formatted for easy reference. The right @@ -139,7 +156,7 @@ when `barChoice = "noctalia"`). - `$modifier + O` → Launch `OBS Studio` - `$modifier + Alt + C` → Color Picker - `$modifier + G` → Open `GIMP` -- `$modifier + T` → Toggle terminal with `pypr` +- `$modifier + Shift + T` → Toggle dropdown terminal with `DropTerminal` - `$modifier + Alt + M` → Open `pavucontrol` ### Window Management @@ -245,7 +262,7 @@ Then: ![ZaneyOS Install Script Command](img/install-script.jpg) ``` -sh <(curl -L https://gitlab.com/Zaney/zaneyos/-/raw/main/install-zaneyos.sh) +sh <(curl -L https://gitlab.com/Zaney/zaneyos/-/raw/stable-2.4/install-zaneyos.sh) ``` #### The install process will look something like this: @@ -276,7 +293,7 @@ nix-shell -p git vim 2. Clone this repo & enter it: ``` -cd && git clone https://gitlab.com/zaney/zaneyos.git -b main --depth=1 ~/zaneyos +cd && git clone https://gitlab.com/zaney/zaneyos.git -b stable-2.4 --depth=1 ~/zaneyos cd zaneyos You can still run the `install.sh` script if you want to. @@ -291,33 +308,36 @@ cp -r hosts/default hosts/ git add . ``` -4. Edit `hosts//variables.nix` - ```nixos-generate-config --show-hardware-config > hosts//hardware.nix``` +4. Edit `hosts//variables.nix`. +5. Edit `flake.nix` and fill in your username, profile, and hostname. + +6. Generate your hardware.nix like so: + +``` +nixos-generate-config --show-hardware-config > hosts//hardware.nix ``` 7. Run this to enable flakes and install the flake replacing hostname with profile. I.e. `intel`, `nvidia`, `nvidia-laptop`, `amd-hybrid`, or `vm` ``` - NIX_CONFIG="experimental-features = nix-command flakes" sudo nixos-rebuild switch --flake .#profile - ``` Now when you want to rebuild the configuration you have access to an alias called `fr` that will rebuild the flake and you do not have to be in the `zaneyos` folder for it to work. +
+ ### Special Recognitions: Thank you for all your assistance -- KoolDots https://github.com/LinuxBeginnings -- JakKoolit https://github.com/Jakoolit -- Justaguylinux https://codeberg.org/Justaguylinux +- Jakookit https://github.com/jakookit +- Justaguylinux https://github.com/drewgrif - Jerry Starke https://github.com/JerrySM64 ## Hope you enjoy! -``` diff --git a/WARP.md b/WARP.md index abdb5a9..8e69544 100644 --- a/WARP.md +++ b/WARP.md @@ -54,6 +54,8 @@ High-level architecture (big picture) - hosts// - default.nix imports hardware.nix and host-packages.nix. - variables.nix is the primary control surface (display manager, terminal/browser defaults, waybarChoice, stylix image, 24h clock, Thunar/printing/NFS flags, intel/nvidia Bus IDs, etc.). +|- modules/options.nix + - Defines the schema for `zaneyos` configuration options (e.g. enable flags, theme choices). |- modules/core - Composes NixOS modules: boot, flatpak, fonts, hardware, network, nfs, nh, quickshell, packages, printing, display manager (greetd/sddm), security, services (PipeWire/SSH/Bluetooth/fstrim; smartd conditional), steam, stylix, syncthing, system (nix settings, locales, env), thunar, user (Home Manager), virtualization, xserver. - quickshell.nix installs quickshell with Qt6 dependencies and required environment variables (needed for noctalia-shell). diff --git a/ZaneyOS-zos-next-PreMerge-check-1-8.25.md b/ZaneyOS-zos-next-PreMerge-check-1-8.25.md new file mode 100644 index 0000000..965c874 --- /dev/null +++ b/ZaneyOS-zos-next-PreMerge-check-1-8.25.md @@ -0,0 +1,25 @@ +# Pre-Merge Check — zos-next vs main (2026-01-08) + +## Merge blockers + +- `flake.nix` no longer passes `system` into `nixpkgs.lib.nixosSystem`; evaluation will fail. Add `system = "";`. +- `specialArgs` no longer includes `host`, but `modules/core/user.nix` still expects it. Re-add `host` to `specialArgs` (and pass to HM). +- `nixosConfigurations` keys changed from GPU-profile names to host names; scripts/docs (fr/fu, README examples) that call `.#amd`, `.#nvidia`, etc., will break unless updated. + +## Design changes to verify + +- New options schema (`modules/options.nix`); every host must set `zaneyos.gpuProfile` and `zaneyos.hostName`. +- Display manager selection via `zaneyos.displayManager`; both `ly` and `sddm` are imported and guarded by `mkIf`. +- Scanning moved to new `modules/core/scanners.nix`, gated by `zaneyos.scannerEnable` (default true) and adds `scanner` group. +- Boot logic now arch-aware: `systemd-boot` only on x86_64; `generic-extlinux-compatible` on aarch64; non-x86 uses generic kernel (not zen). +- `smartd` now follows `zaneyos.enableSmartD` (default true); set false for VMs to match old behavior. +- Host variables now live under `zaneyos = { … };` in each `hosts//variables.nix`. +- Home modules are always imported but gated (`tmuxEnable`, `weztermEnable`, `alacrittyEnable`, `ghosttyEnable`, `vscodeEnable`, `doomEmacsEnable`, etc.). +- `overlays.nix` adds `pkgs.unstable`; `packages.nix` includes an empty `unstablePkgs` list (currently unused). + +## Recommended actions before merging + +- Patch `flake.nix`: restore `system` and `host` in `specialArgs`, then run `nix flake check`. +- Update docs/aliases/scripts to the new host-based outputs or add compatibility wrappers for old profile targets. +- For VM hosts, set `zaneyos.enableSmartD = false`. +- Smoke-test on x86_64 and (if applicable) aarch64 to confirm bootloader/kernels. diff --git a/cheatsheets/add-gnome.md b/cheatsheets/add-gnome.md deleted file mode 100644 index b36cdc5..0000000 --- a/cheatsheets/add-gnome.md +++ /dev/null @@ -1,58 +0,0 @@ -# Add GNOME Desktop (overview) - -This guide gives **basic steps** and **which files to edit** to add GNOME to ZaneyOS. - -In NixOS, you enable it through NixOS options in a module (a `.nix` file), then pick a display manager (login screen). -This repo already has **SDDM** (graphical) and **LY** (text) login support. You can keep using either — both can start GNOME sessions. - -## Files to edit (minimal list) - -1. `modules/core/default.nix` - - Import your new GNOME module so it becomes part of the system config. - -2. `modules/core/xserver.nix` - - GNOME needs `services.xserver.enable = true;` (this file currently disables X11). - -3. `modules/core/gnome.nix` (new file you create) - - Turn on GNOME’s desktop manager. - -4. `hosts//variables.nix` - - Make sure your `displayManager` is set to either `"sddm"` or `"tui"` (for LY), since those are already supported here. - -## Suggested minimal GNOME module (example) - -```nix path=null start=null -{ ... }: -{ - services.xserver = { - enable = true; - desktopManager.gnome.enable = true; - }; -} -``` - -## Where to import the GNOME module - -In `modules/core/default.nix`, add your GNOME file to the imports list: - -```nix path=null start=null -imports = [ - # ... - ./gnome.nix - # ... -]; -``` - -## Flatpak: GNOME Extensions Manager - -To add the Flatpak app **Extension Manager** (for GNOME extensions), edit `modules/core/flatpak.nix` and add its ID: - -```nix path=null start=null -services.flatpak.packages = [ - "com.mattjakeman.ExtensionManager" -]; -``` - -## `git add .` and rebuild - -Once you have the file created. In the ZaneyOS directory run `git add . ` then `zcli rebuild` diff --git a/cheatsheets/hyprland-customization-guide.es.md b/cheatsheets/hyprland-customization-guide.es.md index 74c7605..ff55d44 100644 --- a/cheatsheets/hyprland-customization-guide.es.md +++ b/cheatsheets/hyprland-customization-guide.es.md @@ -50,7 +50,7 @@ Ejemplo: Añadir copyq al inicio # ... exec-once = [ # ... - "pypr &" + "DropTerminal --spawn-only" "copyq" ]; # ... diff --git a/cheatsheets/hyprland-customization-guide.md b/cheatsheets/hyprland-customization-guide.md index 481b8f9..5f46f68 100644 --- a/cheatsheets/hyprland-customization-guide.md +++ b/cheatsheets/hyprland-customization-guide.md @@ -50,7 +50,7 @@ Example: Add copyq to autostart # ... exec-once = [ # ... - "pypr &" + "DropTerminal --spawn-only" "copyq" ]; # ... diff --git a/cheatsheets/hyprland/hyprland-customization-guide.es.md b/cheatsheets/hyprland/hyprland-customization-guide.es.md index 920efa5..ec11f21 100644 --- a/cheatsheets/hyprland/hyprland-customization-guide.es.md +++ b/cheatsheets/hyprland/hyprland-customization-guide.es.md @@ -50,7 +50,7 @@ Lista de aplicaciones/comandos que se lanzan al iniciar Hyprland. # ... exec-once = [ # ... - "pypr &" # pyprland para terminal desplegable SUPERSHIFT + T + "DropTerminal --spawn-only" # precarga terminal desplegable (Super+Shift+T) "copyq" ]; # ... diff --git a/cheatsheets/hyprland/hyprland-customization-guide.md b/cheatsheets/hyprland/hyprland-customization-guide.md index c226428..3ad10f3 100644 --- a/cheatsheets/hyprland/hyprland-customization-guide.md +++ b/cheatsheets/hyprland/hyprland-customization-guide.md @@ -72,7 +72,7 @@ If you want to start the `copyq` application every time you log in, you can add # ... exec-once = [ # ... - "pypr &" # pyprland for drop down term SUPERSHIFT + T + "DropTerminal --spawn-only" # preload dropdown terminal (Super+Shift+T) ]; # ... ``` @@ -83,7 +83,7 @@ If you want to start the `copyq` application every time you log in, you can add # ... exec-once = [ # ... - "pypr &" # pyprland for drop down term SUPERSHIFT + T + "DropTerminal --spawn-only" # preload dropdown terminal (Super+Shift+T) "copyq" ]; # ... diff --git a/flake.lock b/flake.lock index e53589f..7e5f702 100644 --- a/flake.lock +++ b/flake.lock @@ -1,27 +1,5 @@ { "nodes": { - "alejandra": { - "inputs": { - "fenix": "fenix", - "flakeCompat": "flakeCompat", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1777149230, - "narHash": "sha256-pu6dVB6NrIj90rrqCgJ5pPlBzS76pW4WA6rE1rD1Gp8=", - "owner": "kamadorueda", - "repo": "alejandra", - "rev": "8c4a4a572bee519b04e9bb9207e7d993f55ecb4f", - "type": "github" - }, - "original": { - "owner": "kamadorueda", - "repo": "alejandra", - "type": "github" - } - }, "antigravity-nix": { "inputs": { "flake-utils": "flake-utils", @@ -133,28 +111,6 @@ "type": "github" } }, - "fenix": { - "inputs": { - "nixpkgs": [ - "alejandra", - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1768113825, - "narHash": "sha256-f09fAifGPEuRrz1DFY910jexq0DaBuQBbq7WcxQIUgs=", - "owner": "nix-community", - "repo": "fenix", - "rev": "55106e04d905c6a7726d0f6be77ed39a99f66a61", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, "firefox-gnome-theme": { "flake": false, "locked": { @@ -284,22 +240,6 @@ "type": "github" } }, - "flakeCompat": { - "flake": false, - "locked": { - "lastModified": 1767039857, - "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "fromYaml": { "flake": false, "locked": { @@ -444,45 +384,15 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1774386573, - "narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1777268161, - "narHash": "sha256-bxrdOn8SCOv8tN4JbTF/TXq7kjo9ag4M+C8yzzIRYbE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1c3fe55ad329cbcb28471bb30f05c9827f724c76", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixvim": { "inputs": { "flake-parts": "flake-parts", "nixpkgs": [ "nixpkgs" ], - "systems": "systems_2" + "systems": [ + "systems" + ] }, "locked": { "lastModified": 1778510615, @@ -525,7 +435,7 @@ "noctalia", "nixpkgs" ], - "systems": "systems_3", + "systems": "systems_2", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -573,8 +483,12 @@ "flake-parts": "flake-parts_2", "mnw": "mnw", "ndg": "ndg", - "nixpkgs": "nixpkgs_2", - "systems": "systems_4" + "nixpkgs": [ + "nixpkgs" + ], + "systems": [ + "systems" + ] }, "locked": { "lastModified": 1778408907, @@ -592,7 +506,6 @@ }, "root": { "inputs": { - "alejandra": "alejandra", "antigravity-nix": "antigravity-nix", "awww": "awww", "home-manager": "home-manager", @@ -602,26 +515,10 @@ "noctalia": "noctalia", "nvf": "nvf", "stylix": "stylix", + "systems": "systems_3", "zen-browser": "zen-browser" } }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1768083390, - "narHash": "sha256-TGWPJq2mXwxfAe83iZ18DIqXC4sOSj7RkW9b59h6Ox4=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "e42e8ff582ba12a88b6845525d08b6428e6d0fb9", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - }, "rust-overlay": { "inputs": { "nixpkgs": [ @@ -652,9 +549,13 @@ "firefox-gnome-theme": "firefox-gnome-theme", "flake-parts": "flake-parts_3", "gnome-shell": "gnome-shell", - "nixpkgs": "nixpkgs_3", + "nixpkgs": [ + "nixpkgs" + ], "nur": "nur", - "systems": "systems_5", + "systems": [ + "systems" + ], "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", "tinted-tmux": "tinted-tmux", @@ -692,16 +593,16 @@ }, "systems_2": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -720,36 +621,6 @@ "type": "github" } }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_5": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tinted-kitty": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 9ca5d5b..a88b2e0 100644 --- a/flake.nix +++ b/flake.nix @@ -2,13 +2,22 @@ description = "ZaneyOS"; inputs = { + systems.url = "github:nix-systems/default-linux"; home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; }; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nvf.url = "github:notashelf/nvf"; - stylix.url = "github:danth/stylix/master"; + nvf = { + url = "github:notashelf/nvf"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.systems.follows = "systems"; + }; + stylix = { + url = "github:danth/stylix/master"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.systems.follows = "systems"; + }; nix-flatpak.url = "github:gmodena/nix-flatpak?ref=latest"; noctalia = { @@ -20,6 +29,7 @@ nixvim = { url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; + inputs.systems.follows = "systems"; }; # Google Antigravity (IDE) @@ -32,13 +42,9 @@ url = "github:0xc000022070/zen-browser-flake/beta"; inputs.nixpkgs.follows = "nixpkgs"; }; - alejandra = { - url = "github:kamadorueda/alejandra"; - inputs.nixpkgs.follows = "nixpkgs"; - }; awww = { - url = "git+https://codeberg.org/LGFae/awww"; - inputs.nixpkgs.follows = "nixpkgs"; + url = "git+https://codeberg.org/LGFae/awww"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -47,40 +53,41 @@ home-manager, nixvim, nix-flatpak, - alejandra, + systems, ... } @ inputs: let - system = "x86_64-linux"; - host = "zaneyos-24-vm"; - profile = "vm"; username = "dwilliams"; + forAllSystems = nixpkgs.lib.genAttrs (import systems); + # Deduplicate nixosConfigurations while preserving the top-level 'profile' - mkNixosConfig = gpuProfile: + mkNixosConfig = host: nixpkgs.lib.nixosSystem { - inherit system; specialArgs = { inherit inputs; inherit username; - inherit host; - inherit profile; # keep using the let-bound profile for modules/scripts }; modules = [ - ./modules/core/overlays.nix - ./profiles/${gpuProfile} - nix-flatpak.nixosModules.nix-flatpak + ./modules/core + ./modules/drivers + ./hosts/${host} + ./profiles ]; }; - in { - nixosConfigurations = { - amd = mkNixosConfig "amd"; - nvidia = mkNixosConfig "nvidia"; - nvidia-laptop = mkNixosConfig "nvidia-laptop"; - amd-nvidia-hybrid = mkNixosConfig "amd-nvidia-hybrid"; - intel = mkNixosConfig "intel"; - vm = mkNixosConfig "vm"; - }; - formatter.x86_64-linux = inputs.alejandra.packages.x86_64-linux.default; + hosts = [ + "zaneyos-next" + "default" + "zaneyos-24-vm" + "zaneyos-oem" + ]; + in { + nixosConfigurations = builtins.listToAttrs (map (host: { + name = host; + value = mkNixosConfig host; + }) + hosts); + + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); }; } diff --git a/hosts/default/default.nix b/hosts/default/default.nix index 6faad47..bdd5f44 100644 --- a/hosts/default/default.nix +++ b/hosts/default/default.nix @@ -2,5 +2,6 @@ imports = [ ./hardware.nix ./host-packages.nix + ./variables.nix ]; } diff --git a/hosts/default/host-packages.nix b/hosts/default/host-packages.nix index 8f9f927..3b344d8 100644 --- a/hosts/default/host-packages.nix +++ b/hosts/default/host-packages.nix @@ -1,16 +1,7 @@ -{configs, pkgs, ...}: { +{config,pkgs, ...}: { environment.systemPackages = with pkgs; [ - # Add local pacakaged here ]; - # Add host specific flatpaks here - services = { - flatpak = { - packages = [ - ]; - }; - }; - services.auto-cpufreq.enable = false; services.auto-cpufreq.settings = { @@ -24,5 +15,4 @@ }; }; - } diff --git a/hosts/default/variables.nix b/hosts/default/variables.nix index 8badf01..e0a1737 100644 --- a/hosts/default/variables.nix +++ b/hosts/default/variables.nix @@ -1,148 +1,141 @@ -{ - # Git Configuration ( For Pulling Software Repos ) - gitUsername = "Don Williams"; - gitEmail = "don.e.williams@gmail.com"; +_: { + # Welcome to your ZaneyOS configuration! + # This block is where you can customize your NixOS experience. + # + # For a comprehensive list of all available options, their descriptions, + # and default values, please refer to the following file: + # ../../modules/options.nix + # + # You can override any of those options here. Most settings are optional + # and can be removed to use the project defaults. + zaneyos = { + # Git Configuration + gitUsername = "Tyler Kelley"; + gitEmail = "tylerzanekelley@gmail.com"; - # Set Displau Manager - # `tui` for Text login - # `sddm` for graphical GUI (default) - # SDDM background is set with stylixImage - displayManager = "tui"; + # does not have to be the same as the directory name, but + # would be common + hostName = "my-hostname"; - # Emable/disable bundled applications - tmuxEnable = false; - alacrittyEnable = false; - weztermEnable = false; - ghosttyEnable = false; - vscodeEnable = false; - antigravityEnable = false; # Google port of vscodium - # Note: This is evil-helix with VIM keybindings by default - helixEnable = false; - #To install: Enable here, zcli rebuild, then run zcli doom install - doomEmacsEnable = false; + gpuProfile = "vm"; - # Python development tools are included by default + # Set Display Manager + # `tui` for Text login + # `sddm` for graphical GUI (default) + # SDDM background is set with stylixImage + displayManager = "sddm"; - # Hyprland Settings - # Examples: - # extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1"; - # extraMonitorSettings = "monitor = HDMI-A-1,1920x1080@60,auto,1"; - # You can configure multiple monitors. - # Inside the quotes, create a new line for each monitor. - extraMonitorSettings = " - monitor = Virtual-1,1920x1080@60,auto,1 - "; + # Emable/disable bundled applications + tmuxEnable = false; + alacrittyEnable = false; + weztermEnable = false; + ghosttyEnable = false; + vscodeEnable = false; + antigravityEnable = false; # Google port of vscodium + # Note: This is evil-helix with VIM keybindings by default + helixEnable = false; + #To install: Enable here, zcli rebuild, then run zcli doom install + doomEmacsEnable = false; + # Neovim config: "nixvim" | "nvf" + neovimConfig = "nixvim"; - # Bar/Shell Settings - # Choose between noctalia or waybar - barChoice = "noctalia"; + # Bar/Shell Settings + # Choose between noctalia or waybar + barChoice = "noctalia"; - # Waybar Settings (used when barChoice = "waybar") - clock24h = false; + # Waybar Settings (used when barChoice = "waybar") + clock24h = false; - # Program Options - # Set Default Browser (google-chrome-stable for google-chrome) - # This does NOT install your browser - # You need to install it by adding it to the `packages.nix` - # or as a flatpak - browser = "brave"; + # Program Options + # Set Default Browser (google-chrome-stable for google-chrome) + # This does NOT install your browser + # You need to install it by adding it to the `packages.nix` + # or as a flatpak + browser = "brave"; - # Host-level default applications (picked up by Home Manager xdg.mimeApps) - # Uncomment and adjust the .desktop IDs to set per-host defaults. - # mimeDefaultApps = { - # # PDFs - # "application/pdf" = ["okular.desktop"]; - # "application/x-pdf" = ["okular.desktop"]; - # # Web browser - # "x-scheme-handler/http" = ["google-chrome.desktop"]; # or brave-browser.desktop, firefox.desktop - # "x-scheme-handler/https" = ["google-chrome.desktop"]; - # "text/html" = ["google-chrome.desktop"]; - # # Files - # "inode/directory" = ["thunar.desktop"]; # file manager - # "text/plain" = ["nvim.desktop"]; # or code.desktop - # }; + # Default applications for this host (written to ~/.config/mimeapps.list) + # Uncomment and adjust to set per-host defaults. + # mimeDefaultApps = { + # # PDFs + # "application/pdf" = ["okular.desktop"]; + # "application/x-pdf" = ["okular.desktop"]; + # # Web browser + # "x-scheme-handler/http" = ["google-chrome.desktop"]; # or brave-browser.desktop, firefox.desktop + # "x-scheme-handler/https" = ["google-chrome.desktop"]; + # "text/html" = ["google-chrome.desktop"]; + # # Text files + # "text/plain" = ["nvim.desktop"]; # or code.desktop, org.gnome.TextEditor.desktop + # # Images and video + # "image/png" = ["imv.desktop"]; # or org.gnome.eog.desktop + # "video/mp4" = ["mpv.desktop"]; # or vlc.desktop + # # Folders (file manager) + # "inode/directory" = ["thunar.desktop"]; # Thunar; or org.gnome.Nautilus.desktop, org.kde.dolphin.desktop + # }; - # Available Options: - # Kitty, ghostty, wezterm, aalacrity - # Note: kitty, wezterm, alacritty have to be enabled in `variables.nix` - # Setting it here does not enable it. Kitty is installed by default - terminal = "kitty"; # Set Default System Terminal + # Available Options: + # Kitty, ghostty, wezterm, aalacrity + # Note: kitty, wezterm, alacritty have to be enabled in `variables.nix` + # Setting it here does not enable it. Kitty is installed by default + terminal = "kitty"; # Set Default System Terminal - keyboardLayout = "us"; - keyboardVariant = ""; - consoleKeyMap = "us"; + keyboardLayout = "us"; + keyboardVariant = ""; + consoleKeyMap = "us"; - # For hybrid support (Intel/NVIDIA Prime or AMD/NVIDIA) - intelID = "PCI:1:0:0"; - amdgpuID = "PCI:5:0:0"; - nvidiaID = "PCI:0:2:0"; + # Themes, waybar and animation. + # Set Stylix Image + # This will set your color palette + # Default background + # Add new images to ~/zaneyos/wallpapers + stylixImage = ../../wallpapers/mountainscapedark.jpg; + #stylixImage = ../../wallpapers/AnimeGirlNightSky.jpg; + #stylixImage = ../../wallpapers/Anime-Purple-eyes.png; + #stylixImage = ../../wallpapers/Rainnight.jpg; + #stylixImage = ../../wallpapers/zaney-wallpaper.jpg; + #stylixImage = ../../wallpapers/nix-wallpapers-strips-logo.jpg; + #stylixImage = ../../wallpapers/beautifulmountainscape.jpg; - # Enable NFS - enableNFS = true; + # Set Waybar + # Available Options: + waybarChoice = ../../modules/home/waybar/waybar-jak-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-ddubs-2.nix; + #waybarChoice = ../../modules/home/waybar/waybar-curved.nix; + #waybarChoice = ../../modules/home/waybar/waybar-ddubs.nix; + #waybarChoice = ../../modules/home/waybar/waybar-simple.nix; + #waybarChoice = ../../modules/home/waybar/waybar-dwm.nix; + #waybarChoice = ../../modules/home/waybar/waybar-dwm-2.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jerry.nix; + #waybarChoice = ../../modules/home/waybar/waybar-nekodyke.nix; + #waybarChoice = ../../modules/home/waybar/waybar-TheBlackDon.nix; + #waybarChoice = ../../modules/home/waybar/waybar-tony.nix; + #waybarChoice = ../../modules/home/waybar/waybar-ddubsos-v1.nix; + #waybarChoice = ../../modules/home/waybar/waybar-mecha.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jak-ml4w-modern.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jak-oglo-simple.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-transparent.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-ultradark.nix; + #waybarChoice = ../../modules/home/waybar/waybar-pctrade-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-mangowc-jak-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-old-ddubsos.nix; - # Enable Printing Support - printEnable = false; + # Set Animation style + # Available options are: + #animChoice = ../../modules/home/hyprland/animations-def.nix; + animChoice = ../../modules/home/hyprland/animations-end4.nix; + #animChoice = ../../modules/home/hyprland/animations-end4-slide.nix; + #animChoice = ../../modules/home/hyprland/animations-end-slide.nix; + #animChoice = ../../modules/home/hyprland/animations-dynamic.nix; + #animChoice = ../../modules/home/hyprland/animations-moving.nix; + #animChoice = ../../modules/home/hyprland/animations-hyde-optimized.nix; + #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-1.nix; + #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-2.nix; + #animChoice = ../../modules/home/hyprland/animations-ml4w-classic.nix; + #animChoice = ../../modules/home/hyprland/animations-ml4w-fast.nix; + #animChoice = ../../modules/home/hyprland/animations-ml4w-high.nix; - # Enable Thunar GUI File Manager - # Yazi is alternate File Manager - thunarEnable = true; - - # Themes, waybar and animation. - # Only uncomment your selection - # The others much be commented out. - - # Set Stylix Image - # This will set your color palette - # Default background - # Add new images to ~/zaneyos/wallpapers - #stylixImage = ../../wallpapers/mountainscapedark.jpg; - #stylixImage = ../../wallpapers/AnimeGirlNightSky.jpg; - #stylixImage = ../../wallpapers/Anime-Purple-eyes.png; - stylixImage = ../../wallpapers/Rainnight.jpg; - #stylixImage = ../../wallpapers/zaney-wallpaper.jpg; - #stylixImage = ../../wallpapers/nix-wallpaper-stripes-logo.png; - #stylixImage = ../../wallpapers/beautifulmountainscape.jpg; - - # Set Waybar - # Available Options: - #waybarChoice = ../../modules/home/waybar/waybar-curved.nix; - #waybarChoice = ../../modules/home/waybar/waybar-ddubs.nix; - #waybarChoice = ../../modules/home/waybar/waybar-ddubs-2.nix; - #waybarChoice = ../../modules/home/waybar/waybar-simple.nix; - #waybarChoice = ../../modules/home/waybar/waybar-dwm.nix; - #waybarChoice = ../../modules/home/waybar/waybar-dwm-2.nix; - #waybarChoice = ../../modules/home/waybar/waybar-nekodyke.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jerry.nix; - #waybarChoice = ../../modules/home/waybar/waybar-TheBlackDon.nix; - #waybarChoice = ../../modules/home/waybar/waybar-tony.nix; - #waybarChoice = ../../modules/home/waybar/waybar-ddubsos-v1.nix; - #waybarChoice = ../../modules/home/waybar/waybar-mecha.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jak-catppuccin.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jak-ml4w-modern.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jak-oglo-simple.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jwt-catppuccin.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jwt-transparent.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jwt-ultradark.nix; - #waybarChoice = ../../modules/home/waybar/waybar-pctrade-catppuccin.nix; - waybarChoice = ../../modules/home/waybar/waybar-mangowc-jak-catppuccin.nix; - #waybarChoice = ../../modules/home/waybar/waybar-old-ddubsos.nix; - - # Set Animation style - # Available options are: - #animChoice = ../../modules/home/hyprland/animations-def.nix; - #animChoice = ../../modules/home/hyprland/animations-end4.nix; - #animChoice = ../../modules/home/hyprland/animations-end4-slide.nix; - #animChoice = ../../modules/home/hyprland/animations-end-slide.nix; - #animChoice = ../../modules/home/hyprland/animations-dynamic.nix; - #animChoice = ../../modules/home/hyprland/animations-moving.nix; - #animChoice = ../../modules/home/hyprland/animations-hyde-optimized.nix; - #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-1.nix; - #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-2.nix; - animChoice = ../../modules/home/hyprland/animations-ml4w-classic.nix; - #animChoice = ../../modules/home/hyprland/animations-ml4w-fast.nix; - #animChoice = ../../modules/home/hyprland/animations-ml4w-high.nix; - - # Set network hostId if required (needed for zfs) - # Otherwise leave as-is - hostId = "5ab03f50"; + # Set network hostId if required (needed for zfs) + # Otherwise leave as-is + hostId = "5ab03f50"; + }; } diff --git a/hosts/zaneyos-24-vm/default.nix b/hosts/zaneyos-24-vm/default.nix index 6faad47..bdd5f44 100644 --- a/hosts/zaneyos-24-vm/default.nix +++ b/hosts/zaneyos-24-vm/default.nix @@ -2,5 +2,6 @@ imports = [ ./hardware.nix ./host-packages.nix + ./variables.nix ]; } diff --git a/hosts/zaneyos-24-vm/variables.nix b/hosts/zaneyos-24-vm/variables.nix index ab6507d..1950491 100644 --- a/hosts/zaneyos-24-vm/variables.nix +++ b/hosts/zaneyos-24-vm/variables.nix @@ -1,149 +1,172 @@ -{ - # Git Configuration ( For Pulling Software Repos ) - gitUsername = "dwilliams"; - gitEmail = "don.e.williams@gmail.com"; +_: { + # Welcome to your ZaneyOS configuration! + # This block is where you can customize your NixOS experience. + # + # For a comprehensive list of all available options, their descriptions, + # and default values, please refer to the following file: + # ../../modules/options.nix + # + # You can override any of those options here. Most settings are optional + # and can be removed to use the project defaults. + zaneyos = { + # Git Configuration ( For Pulling Software Repos ) + gitUsername = "dwilliams"; + gitEmail = "don.e.williams@gmail.com"; - # Set Displau Manager - # `tui` for Text login - # `sddm` for graphical GUI (default) - # SDDM background is set with stylixImage - displayManager = "tui"; + hostName = "zaneyos-24-vm"; - # Emable/disable bundled applications - tmuxEnable = true; - alacrittyEnable = true; - weztermEnable = true; - ghosttyEnable = true; - vscodeEnable = true; - antigravityEnable = true; # Google port of vscodium - # Note: This is evil-helix with VIM keybindings by default - helixEnable = true; - #To install: Enable here, zcli rebuild, then run zcli doom install - doomEmacsEnable = true; + enableSmartD = false; - # Python development tools - pythonEnable = false; + gpuProfile = "vm"; - # Hyprland Settings - # Examples: - # extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1"; - # extraMonitorSettings = "monitor = HDMI-A-1,1920x1080@60,auto,1"; - # You can configure multiple monitors. - # Inside the quotes, create a new line for each monitor. - extraMonitorSettings = " + # Set Displau Manager + # `tui` for Text login + # `sddm` for graphical GUI (default) + # SDDM background is set with stylixImage + displayManager = "tui"; + + # Emable/disable bundled applications + tmuxEnable = true; + alacrittyEnable = true; + weztermEnable = true; + ghosttyEnable = true; + vscodeEnable = true; + antigravityEnable = true; # Google port of vscodium + # Note: This is evil-helix with VIM keybindings by default + helixEnable = true; + #To install: Enable here, zcli rebuild, then run zcli doom install + doomEmacsEnable = true; + # Neovim config: "nixvim" | "nvf" + neovimConfig = "nixvim"; + + # Python development tools + pythonEnable = true; + + # Hyprland Settings + # Examples: + # extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1"; + # extraMonitorSettings = "monitor = HDMI-A-1,1920x1080@60,auto,1"; + # You can configure multiple monitors. + # Inside the quotes, create a new line for each monitor. + extraMonitorSettings = " "; - # Bar/Shell Settings - # Choose between noctalia or waybar - barChoice = "noctalia"; + # Bar/Shell Settings + # Choose between noctalia or waybar + barChoice = "waybar"; - # Waybar Settings (used when barChoice = "waybar") - clock24h = false; + # Waybar Settings (used when barChoice = "waybar") + clock24h = false; - # Program Options - # Set Default Browser (google-chrome-stable for google-chrome) - # This does NOT install your browser - # You need to install it by adding it to the `packages.nix` - # or as a flatpak - browser = "google-chrome"; + # Program Options + # Set Default Browser (google-chrome-stable for google-chrome) + # This does NOT install your browser + # You need to install it by adding it to the `packages.nix` + # or as a flatpak + browser = "brave"; - # Host-level default applications (picked up by Home Manager xdg.mimeApps) - # Uncomment and adjust the .desktop IDs to set per-host defaults. - # mimeDefaultApps = { - # # PDFs - # "application/pdf" = ["okular.desktop"]; - # "application/x-pdf" = ["okular.desktop"]; - # # Web browser - # "x-scheme-handler/http" = ["google-chrome.desktop"]; # or brave-browser.desktop, firefox.desktop - # "x-scheme-handler/https" = ["google-chrome.desktop"]; - # "text/html" = ["google-chrome.desktop"]; - # # Files - # "inode/directory" = ["thunar.desktop"]; # file manager - # "text/plain" = ["nvim.desktop"]; # or code.desktop - # }; + # Default applications for this host (written to ~/.config/mimeapps.list) + # Uncomment and adjust to set per-host defaults. + # mimeDefaultApps = { + # # PDFs + # "application/pdf" = ["okular.desktop"]; + # "application/x-pdf" = ["okular.desktop"]; + # # Web browser + # "x-scheme-handler/http" = ["google-chrome.desktop"]; # or brave-browser.desktop, firefox.desktop + # "x-scheme-handler/https" = ["google-chrome.desktop"]; + # "text/html" = ["google-chrome.desktop"]; + # # Text files + # "text/plain" = ["nvim.desktop"]; # or code.desktop, org.gnome.TextEditor.desktop + # # Images and video + # "image/png" = ["imv.desktop"]; # or org.gnome.eog.desktop + # "video/mp4" = ["mpv.desktop"]; # or vlc.desktop + # # Folders (file manager) + # "inode/directory" = ["thunar.desktop"]; # Thunar; or org.gnome.Nautilus.desktop, org.kde.dolphin.desktop + # }; - # Available Options: - # Kitty, ghostty, wezterm, aalacrity - # Note: kitty, wezterm, alacritty have to be enabled in `variables.nix` - # Setting it here does not enable it. Kitty is installed by default - terminal = "kitty"; # Set Default System Terminal + # Available Options: + # Kitty, ghostty, wezterm, aalacrity + # Note: kitty, wezterm, alacritty have to be enabled in `variables.nix` + # Setting it here does not enable it. Kitty is installed by default + terminal = "kitty"; # Set Default System Terminal - keyboardLayout = "us"; - keyboardVariant = ""; - consoleKeyMap = "us"; + keyboardLayout = "us"; + keyboardVariant = ""; + consoleKeyMap = "us"; - # For hybrid support (Intel/NVIDIA Prime or AMD/NVIDIA) - intelID = "PCI:1:0:0"; - amdgpuID = "PCI:5:0:0"; - nvidiaID = "PCI:0:2:0"; + # For hybrid support (Intel/NVIDIA Prime or AMD/NVIDIA) + intelID = "PCI:1:0:0"; + amdgpuID = "PCI:5:0:0"; + nvidiaID = "PCI:0:2:0"; - # Enable NFS - enableNFS = true; + # Enable NFS + enableNFS = true; - # Enable Printing Support - printEnable = false; + # Enable Printing Support + printEnable = false; - # Enable Thunar GUI File Manager - # Yazi is default File Manager - thunarEnable = true; + # Enable Thunar GUI File Manager + # Yazi is default File Manager + thunarEnable = true; - # Themes, waybar and animation. - # Only uncomment your selection - # The others much be commented out. + # Themes, waybar and animation. + # Only uncomment your selection + # The others much be commented out. - # Set Stylix Image - # This will set your color palette - # Default background - # Add new images to ~/zaneyos/wallpapers - #stylixImage = ../../wallpapers/mountainscapedark.jpg; - #stylixImage = ../../wallpapers/AnimeGirlNightSky.jpg; - #stylixImage = ../../wallpapers/Anime-Purple-eyes.png; - stylixImage = ../../wallpapers/Rainnight.jpg; - #stylixImage = ../../wallpapers/zaney-wallpaper.jpg; - #stylixImage = ../../wallpapers/nix-wallpapers-strips-logo.jpg; - #stylixImage = ../../wallpapers/beautifulmountainscape.jpg; + # Set Stylix Image + # This will set your color palette + # Default background + # Add new images to ~/zaneyos/wallpapers + #stylixImage = ../../wallpapers/mountainscapedark.jpg; + #stylixImage = ../../wallpapers/AnimeGirlNightSky.jpg; + #stylixImage = ../../wallpapers/Anime-Purple-eyes.png; + #stylixImage = ../../wallpapers/Rainnight.jpg; + stylixImage = ../../wallpapers/zaney-wallpaper.jpg; + #stylixImage = ../../wallpapers/nix-wallpapers-strips-logo.jpg; + #stylixImage = ../../wallpapers/beautifulmountainscape.jpg; - # Set Waybar - # Available Options: - #waybarChoice = ../../modules/home/waybar/waybar-ddubs-2.nix; - #waybarChoice = ../../modules/home/waybar/waybar-curved.nix; - #waybarChoice = ../../modules/home/waybar/waybar-ddubs.nix; - #waybarChoice = ../../modules/home/waybar/waybar-simple.nix; - #waybarChoice = ../../modules/home/waybar/waybar-dwm.nix; - #waybarChoice = ../../modules/home/waybar/waybar-dwm-2.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jerry.nix; - #waybarChoice = ../../modules/home/waybar/waybar-nekodyke.nix; - #waybarChoice = ../../modules/home/waybar/waybar-TheBlackDon.nix; - #waybarChoice = ../../modules/home/waybar/waybar-tony.nix; - #waybarChoice = ../../modules/home/waybar/waybar-ddubsos-v1.nix; - #waybarChoice = ../../modules/home/waybar/waybar-mecha.nix; - waybarChoice = ../../modules/home/waybar/waybar-jak-catppuccin.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jak-ml4w-modern.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jak-oglo-simple.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jwt-catppuccin.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jwt-transparent.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jwt-ultradark.nix; - #waybarChoice = ../../modules/home/waybar/waybar-pctrade-catppuccin.nix; - #waybarChoice = ../../modules/home/waybar/waybar-mangowc-jak-catppuccin.nix; - #waybarChoice = ../../modules/home/waybar/waybar-old-ddubsos.nix; + # Set Waybar + # Available Options: + #waybarChoice = ../../modules/home/waybar/waybar-ddubs-2.nix; + #waybarChoice = ../../modules/home/waybar/waybar-curved.nix; + #waybarChoice = ../../modules/home/waybar/waybar-ddubs.nix; + #waybarChoice = ../../modules/home/waybar/waybar-simple.nix; + #waybarChoice = ../../modules/home/waybar/waybar-dwm.nix; + #waybarChoice = ../../modules/home/waybar/waybar-dwm-2.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jerry.nix; + #waybarChoice = ../../modules/home/waybar/waybar-nekodyke.nix; + #waybarChoice = ../../modules/home/waybar/waybar-TheBlackDon.nix; + #waybarChoice = ../../modules/home/waybar/waybar-tony.nix; + #waybarChoice = ../../modules/home/waybar/waybar-ddubsos-v1.nix; + #waybarChoice = ../../modules/home/waybar/waybar-mecha.nix; + waybarChoice = ../../modules/home/waybar/waybar-jak-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jak-ml4w-modern.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jak-oglo-simple.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-transparent.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-ultradark.nix; + #waybarChoice = ../../modules/home/waybar/waybar-pctrade-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-mangowc-jak-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-old-ddubsos.nix; - # Set Animation style - # Available options are: - #animChoice = ../../modules/home/hyprland/animations-def.nix; - #animChoice = ../../modules/home/hyprland/animations-end4.nix; - #animChoice = ../../modules/home/hyprland/animations-end4-slide.nix; - #animChoice = ../../modules/home/hyprland/animations-end-slide.nix; - #animChoice = ../../modules/home/hyprland/animations-dynamic.nix; - #animChoice = ../../modules/home/hyprland/animations-moving.nix; - #animChoice = ../../modules/home/hyprland/animations-hyde-optimized.nix; - #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-1.nix; - #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-2.nix; - animChoice = ../../modules/home/hyprland/animations-ml4w-classic.nix; - #animChoice = ../../modules/home/hyprland/animations-ml4w-fast.nix; - #animChoice = ../../modules/home/hyprland/animations-ml4w-high.nix; + # Set Animation style + # Available options are: + #animChoice = ../../modules/home/hyprland/animations-def.nix; + animChoice = ../../modules/home/hyprland/animations-end4.nix; + #animChoice = ../../modules/home/hyprland/animations-end4-slide.nix; + #animChoice = ../../modules/home/hyprland/animations-end-slide.nix; + #animChoice = ../../modules/home/hyprland/animations-dynamic.nix; + #animChoice = ../../modules/home/hyprland/animations-moving.nix; + #animChoice = ../../modules/home/hyprland/animations-hyde-optimized.nix; + #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-1.nix; + #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-2.nix; + #animChoice = ../../modules/home/hyprland/animations-ml4w-classic.nix; + #animChoice = ../../modules/home/hyprland/animations-ml4w-fast.nix; + #animChoice = ../../modules/home/hyprland/animations-ml4w-high.nix; - # Set network hostId if required (needed for zfs) - # Otherwise leave as-is - hostId = "5ab03f50"; + # Set network hostId if required (needed for zfs) + # Otherwise leave as-is + hostId = "5ab03f50"; + }; } diff --git a/hosts/zaneyos-next/default.nix b/hosts/zaneyos-next/default.nix new file mode 100644 index 0000000..bdd5f44 --- /dev/null +++ b/hosts/zaneyos-next/default.nix @@ -0,0 +1,7 @@ +{...}: { + imports = [ + ./hardware.nix + ./host-packages.nix + ./variables.nix + ]; +} diff --git a/hosts/zaneyos-next/hardware.nix b/hosts/zaneyos-next/hardware.nix new file mode 100644 index 0000000..f5e2e08 --- /dev/null +++ b/hosts/zaneyos-next/hardware.nix @@ -0,0 +1,48 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/52c176b4-8de0-4607-b52f-8ca391f8b469"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/6EA3-CBC7"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + + fileSystems."/mnt/nas" = { + device = "192.168.40.11:/volume1/DiskStation54TB"; + fsType = "nfs"; + }; + + swapDevices = []; + + zramSwap = { + enable = true; + algorithm = "zstd"; + memoryPercent = 50; + priority = 100; + }; + + security.sudo.wheelNeedsPassword = false; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/zaneyos-next/host-packages.nix b/hosts/zaneyos-next/host-packages.nix new file mode 100644 index 0000000..d57be6e --- /dev/null +++ b/hosts/zaneyos-next/host-packages.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + environment.systemPackages = with pkgs; [ + warp-terminal + ]; +} diff --git a/hosts/zaneyos-next/variables.nix b/hosts/zaneyos-next/variables.nix new file mode 100644 index 0000000..61e4041 --- /dev/null +++ b/hosts/zaneyos-next/variables.nix @@ -0,0 +1,141 @@ +_: { + # Welcome to your ZaneyOS configuration! + # This block is where you can customize your NixOS experience. + # + # For a comprehensive list of all available options, their descriptions, + # and default values, please refer to the following file: + # ../../modules/options.nix + # + # You can override any of those options here. Most settings are optional + # and can be removed to use the project defaults. + zaneyos = { + # Git Configuration + gitUsername = "Don Williams"; + gitEmail = "don.e.williams@gmail.com"; + + # does not have to be the same as the directory name, but + # would be common + hostName = "zaneyos-next"; + + gpuProfile = "vm"; + + # Set Display Manager + # `tui` for Text login + # `sddm` for graphical GUI (default) + # SDDM background is set with stylixImage + displayManager = "sddm"; + + # Emable/disable bundled applications + tmuxEnable = true; + alacrittyEnable = true; + weztermEnable = true; + ghosttyEnable = true; + vscodeEnable = true; + antigravityEnable = true; # Google port of vscodium + # Note: This is evil-helix with VIM keybindings by default + helixEnable = true; + #To install: Enable here, zcli rebuild, then run zcli doom install + doomEmacsEnable = true; + # Neovim config: "nixvim" | "nvf" + neovimConfig = "nixvim"; + + # Bar/Shell Settings + # Choose between noctalia or waybar + barChoice = "waybar"; + + # Waybar Settings (used when barChoice = "waybar") + clock24h = false; + + # Program Options + # Set Default Browser (google-chrome-stable for google-chrome) + # This does NOT install your browser + # You need to install it by adding it to the `packages.nix` + # or as a flatpak + browser = "google-chrome-stable"; + + # Default applications for this host (written to ~/.config/mimeapps.list) + # Uncomment and adjust to set per-host defaults. + # mimeDefaultApps = { + # # PDFs + # "application/pdf" = ["okular.desktop"]; + # "application/x-pdf" = ["okular.desktop"]; + # # Web browser + # "x-scheme-handler/http" = ["google-chrome.desktop"]; # or brave-browser.desktop, firefox.desktop + # "x-scheme-handler/https" = ["google-chrome.desktop"]; + # "text/html" = ["google-chrome.desktop"]; + # # Text files + # "text/plain" = ["nvim.desktop"]; # or code.desktop, org.gnome.TextEditor.desktop + # # Images and video + # "image/png" = ["imv.desktop"]; # or org.gnome.eog.desktop + # "video/mp4" = ["mpv.desktop"]; # or vlc.desktop + # # Folders (file manager) + # "inode/directory" = ["thunar.desktop"]; # Thunar; or org.gnome.Nautilus.desktop, org.kde.dolphin.desktop + # }; + + # Available Options: + # Kitty, ghostty, wezterm, aalacrity + # Note: kitty, wezterm, alacritty have to be enabled in `variables.nix` + # Setting it here does not enable it. Kitty is installed by default + terminal = "kitty"; # Set Default System Terminal + + keyboardLayout = "us"; + keyboardVariant = ""; + consoleKeyMap = "us"; + + # Themes, waybar and animation. + # Set Stylix Image + # This will set your color palette + # Default background + # Add new images to ~/zaneyos/wallpapers + #stylixImage = ../../wallpapers/mountainscapedark.jpg; + #stylixImage = ../../wallpapers/AnimeGirlNightSky.jpg; + #stylixImage = ../../wallpapers/Anime-Purple-eyes.png; + stylixImage = ../../wallpapers/Rainnight.jpg; + #stylixImage = ../../wallpapers/zaney-wallpaper.jpg; + #stylixImage = ../../wallpapers/nix-wallpapers-strips-logo.jpg; + #stylixImage = ../../wallpapers/beautifulmountainscape.jpg; + + # Set Waybar + # Available Options: + #waybarChoice = ../../modules/home/waybar/waybar-curved.nix; + waybarChoice = ../../modules/home/waybar/waybar-jak-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-ddubs-2.nix; + #waybarChoice = ../../modules/home/waybar/waybar-ddubs.nix; + #waybarChoice = ../../modules/home/waybar/waybar-simple.nix; + #waybarChoice = ../../modules/home/waybar/waybar-dwm.nix; + #waybarChoice = ../../modules/home/waybar/waybar-dwm-2.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jerry.nix; + #waybarChoice = ../../modules/home/waybar/waybar-nekodyke.nix; + #waybarChoice = ../../modules/home/waybar/waybar-TheBlackDon.nix; + #waybarChoice = ../../modules/home/waybar/waybar-tony.nix; + #waybarChoice = ../../modules/home/waybar/waybar-ddubsos-v1.nix; + #waybarChoice = ../../modules/home/waybar/waybar-mecha.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jak-ml4w-modern.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jak-oglo-simple.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-transparent.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-ultradark.nix; + #waybarChoice = ../../modules/home/waybar/waybar-pctrade-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-mangowc-jak-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-old-ddubsos.nix; + + # Set Animation style + # Available options are: + #animChoice = ../../modules/home/hyprland/animations-def.nix; + #animChoice = ../../modules/home/hyprland/animations-end4.nix; + #animChoice = ../../modules/home/hyprland/animations-end4-slide.nix; + #animChoice = ../../modules/home/hyprland/animations-end-slide.nix; + #animChoice = ../../modules/home/hyprland/animations-dynamic.nix; + #animChoice = ../../modules/home/hyprland/animations-moving.nix; + #animChoice = ../../modules/home/hyprland/animations-hyde-optimized.nix; + #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-1.nix; + #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-2.nix; + animChoice = ../../modules/home/hyprland/animations-ml4w-classic.nix; + #animChoice = ../../modules/home/hyprland/animations-ml4w-fast.nix; + #animChoice = ../../modules/home/hyprland/animations-ml4w-high.nix; + + # Set network hostId if required (needed for zfs) + # Otherwise leave as-is + hostId = "5ab03f50"; + }; +} diff --git a/hosts/zaneyos-oem/default.nix b/hosts/zaneyos-oem/default.nix index 6faad47..bdd5f44 100644 --- a/hosts/zaneyos-oem/default.nix +++ b/hosts/zaneyos-oem/default.nix @@ -2,5 +2,6 @@ imports = [ ./hardware.nix ./host-packages.nix + ./variables.nix ]; } diff --git a/hosts/zaneyos-oem/variables.nix b/hosts/zaneyos-oem/variables.nix index 937ccec..58b1dfa 100644 --- a/hosts/zaneyos-oem/variables.nix +++ b/hosts/zaneyos-oem/variables.nix @@ -1,129 +1,141 @@ -{ - # Git Configuration ( For Pulling Software Repos ) - gitUsername = "Don Williams"; - gitEmail = "don.e.williams@gmail.com"; +_: { + # Welcome to your ZaneyOS configuration! + # This block is where you can customize your NixOS experience. + # + # For a comprehensive list of all available options, their descriptions, + # and default values, please refer to the following file: + # ../../modules/options.nix + # + # You can override any of those options here. Most settings are optional + # and can be removed to use the project defaults. + zaneyos = { + # Git Configuration ( For Pulling Software Repos ) + gitUsername = "Don Williams"; + gitEmail = "don.e.williams@gmail.com"; - # Set Displau Manager - # `tui` for Text login - # `sddm` for graphical GUI - # SDDM background is set with stylixImage - displayManager = "sddm"; + gpuProfile = "vm"; - # Emable/disable bundled applications - tmuxEnable = true; - alacrittyEnable = true; - weztermEnable = true; - ghosttyEnable = true; - vscodeEnable = true; - antigravityEnable = false; # Google port of vscodium - helixEnable = true; - #To install rebuild, then run zcli doom install - doomEmacsEnable = false; + # Set Displau Manager + # `tui` for Text login + # `sddm` for graphical GUI + # SDDM background is set with stylixImage + displayManager = "sddm"; - # Python development tools - pythonEnable = false; + # Emable/disable bundled applications + tmuxEnable = true; + alacrittyEnable = true; + weztermEnable = true; + ghosttyEnable = true; + vscodeEnable = true; + antigravityEnable = false; # Google port of vscodium + helixEnable = true; + #To install rebuild, then run zcli doom install + doomEmacsEnable = false; + # Neovim config: "nixvim" | "nvf" + neovimConfig = "nixvim"; - # P10K or starship prompt - userPrompt = "starship"; + # Hyprland Settings + extraMonitorSettings = "monitor=Virtual-1,1920x1080@75,auto,1"; - # Hyprland Settings - extraMonitorSettings = "monitor=Virtual-1,1920x1080@75,auto,1"; + # Bar/Shell Settings + # Choose between noctalia or waybar + barChoice = "noctalia"; - # Bar/Shell Settings - # Choose between noctalia or waybar - barChoice = "noctalia"; + # Waybar Settings (used when barChoice = "waybar") + clock24h = false; - # Waybar Settings (used when barChoice = "waybar") - clock24h = false; + # Program Options + browser = "brave"; # Set Default Browser (google-chrome-stable for google-chrome) - # Program Options - browser = "brave"; # Set Default Browser (google-chrome-stable for google-chrome) + # Default applications for this host (written to ~/.config/mimeapps.list) + # Uncomment and adjust to set per-host defaults. + # mimeDefaultApps = { + # # PDFs + # "application/pdf" = ["okular.desktop"]; + # "application/x-pdf" = ["okular.desktop"]; + # # Web browser + # "x-scheme-handler/http" = ["google-chrome.desktop"]; # or brave-browser.desktop, firefox.desktop + # "x-scheme-handler/https" = ["google-chrome.desktop"]; + # "text/html" = ["google-chrome.desktop"]; + # # Text files + # "text/plain" = ["nvim.desktop"]; # or code.desktop, org.gnome.TextEditor.desktop + # # Images and video + # "image/png" = ["imv.desktop"]; # or org.gnome.eog.desktop + # "video/mp4" = ["mpv.desktop"]; # or vlc.desktop + # # Folders (file manager) + # "inode/directory" = ["thunar.desktop"]; # Thunar; or org.gnome.Nautilus.desktop, org.kde.dolphin.desktop + # }; + terminal = "kitty"; # Set Default System Terminal + keyboardLayout = "us"; + keyboardVariant = ""; + consoleKeyMap = "us"; - # Host-level default applications (picked up by Home Manager xdg.mimeApps) - # Uncomment and adjust the .desktop IDs to set per-host defaults. - # mimeDefaultApps = { - # # PDFs - # "application/pdf" = ["okular.desktop"]; - # "application/x-pdf" = ["okular.desktop"]; - # # Web browser - # "x-scheme-handler/http" = ["google-chrome.desktop"]; # or brave-browser.desktop, firefox.desktop - # "x-scheme-handler/https" = ["google-chrome.desktop"]; - # "text/html" = ["google-chrome.desktop"]; - # # Files - # "inode/directory" = ["thunar.desktop"]; # file manager - # "text/plain" = ["nvim.desktop"]; # or code.desktop - # }; + # For hybrid support (Intel/NVIDIA Prime or AMD/NVIDIA) + intelID = "PCI:1:0:0"; + amdgpuID = "PCI:5:0:0"; + nvidiaID = "PCI:0:2:0"; - terminal = "kitty"; # Set Default System Terminal - keyboardLayout = "us"; - keyboardVariant = ""; - consoleKeyMap = "us"; + # Enable NFS + enableNFS = true; - # For hybrid support (Intel/NVIDIA Prime or AMD/NVIDIA) - intelID = "PCI:1:0:0"; - amdgpuID = "PCI:5:0:0"; - nvidiaID = "PCI:0:2:0"; + # Enable Printing Support + printEnable = false; - # Enable NFS - enableNFS = true; + # Enable Thunar GUI File Manager + thunarEnable = true; - # Enable Printing Support - printEnable = false; + # Set Stylix Image + # This will set your color palette + # Default background + # Add new images to ~/zaneyos/wallpapers + stylixImage = ../../wallpapers/mountainscapedark.jpg; + #stylixImage = ../../wallpapers/AnimeGirlNightSky.jpg; + #stylixImage = ../../wallpapers/Anime-Purple-eyes.png; + #stylixImage = ../../wallpapers/Rainnight.jpg; + #stylixImage = ../../wallpapers/zaney-wallpaper.jpg; + #stylixImage = ../../wallpapers/nix-wallpapers-strips-logo.jpg; + #stylixImage = ../../wallpapers/beautifulmountainscape.jpg; - # Enable Thunar GUI File Manager - thunarEnable = true; + # Set Waybar + # Available options: + waybarChoice = ../../modules/home/waybar/waybar-dwm-2.nix; + #waybarChoice = ../../modules/home/waybar/waybar-simple.nix; + #waybarChoice = ../../modules/home/waybar/waybar-curved.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jerry.nix; + #waybarChoice = ../../modules/home/waybar/waybar-ddubs.nix; + #waybarChoice = ../../modules/home/waybar/waybar-ddubs-2.nix; + #waybarChoice = ../../modules/home/waybar/waybar-dwm.nix; + #waybarChoice = ../../modules/home/waybar/waybar-TheBlackDon.nix; + #waybarChoice = ../../modules/home/waybar/waybar-tony.nix; + #waybarChoice = ../../modules/home/waybar/waybar-ddubsos-v1.nix; + #waybarChoice = ../../modules/home/waybar/waybar-mecha.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jak-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jak-ml4w-modern.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jak-oglo-simple.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-transparent.nix; + #waybarChoice = ../../modules/home/waybar/waybar-jwt-ultradark.nix; + #waybarChoice = ../../modules/home/waybar/waybar-pctrade-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-mangowc-jak-catppuccin.nix; + #waybarChoice = ../../modules/home/waybar/waybar-old-ddubsos.nix; - # Set Stylix Image - # This will set your color palette - # Default background - # Add new images to ~/zaneyos/wallpapers - stylixImage = ../../wallpapers/mountainscapedark.jpg; - #stylixImage = ../../wallpapers/AnimeGirlNightSky.jpg; - #stylixImage = ../../wallpapers/Anime-Purple-eyes.png; - #stylixImage = ../../wallpapers/Rainnight.jpg; - #stylixImage = ../../wallpapers/zaney-wallpaper.jpg; - #stylixImage = ../../wallpapers/nix-wallpapers-strips-logo.jpg; - #stylixImage = ../../wallpapers/beautifulmountainscape.jpg; + # Set Animation style + # Available options are: + animChoice = ../../modules/home/hyprland/animations-end4.nix; + #animChoice = ../../modules/home/hyprland/animations-def.nix; + #animChoice = ../../modules/home/hyprland/animations-end4-slide.nix; + #animChoice = ../../modules/home/hyprland/animations-end-slide.nix; + #animChoice = ../../modules/home/hyprland/animations-dynamic.nix; + #animChoice = ../../modules/home/hyprland/animations-moving.nix; + #animChoice = ../../modules/home/hyprland/animations-hyde-optimized.nix; + #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-1.nix; + #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-2.nix; + #animChoice = ../../modules/home/hyprland/animations-ml4w-classic.nix; + #animChoice = ../../modules/home/hyprland/animations-ml4w-fast.nix; + #animChoice = ../../modules/home/hyprland/animations-ml4w-high.nix; - # Set Waybar - # Available options: - waybarChoice = ../../modules/home/waybar/waybar-dwm-2.nix; - #waybarChoice = ../../modules/home/waybar/waybar-simple.nix; - #waybarChoice = ../../modules/home/waybar/waybar-curved.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jerry.nix; - #waybarChoice = ../../modules/home/waybar/waybar-ddubs.nix; - #waybarChoice = ../../modules/home/waybar/waybar-ddubs-2.nix; - #waybarChoice = ../../modules/home/waybar/waybar-dwm.nix; - #waybarChoice = ../../modules/home/waybar/waybar-TheBlackDon.nix; - #waybarChoice = ../../modules/home/waybar/waybar-tony.nix; - #waybarChoice = ../../modules/home/waybar/waybar-ddubsos-v1.nix; - #waybarChoice = ../../modules/home/waybar/waybar-mecha.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jak-catppuccin.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jak-ml4w-modern.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jak-oglo-simple.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jwt-catppuccin.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jwt-transparent.nix; - #waybarChoice = ../../modules/home/waybar/waybar-jwt-ultradark.nix; - #waybarChoice = ../../modules/home/waybar/waybar-pctrade-catppuccin.nix; - #waybarChoice = ../../modules/home/waybar/waybar-mangowc-jak-catppuccin.nix; - #waybarChoice = ../../modules/home/waybar/waybar-old-ddubsos.nix; - - # Set Animation style - # Available options are: - animChoice = ../../modules/home/hyprland/animations-end4.nix; - #animChoice = ../../modules/home/hyprland/animations-def.nix; - #animChoice = ../../modules/home/hyprland/animations-end4-slide.nix; - #animChoice = ../../modules/home/hyprland/animations-end-slide.nix; - #animChoice = ../../modules/home/hyprland/animations-dynamic.nix; - #animChoice = ../../modules/home/hyprland/animations-moving.nix; - #animChoice = ../../modules/home/hyprland/animations-hyde-optimized.nix; - #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-1.nix; - #animChoice = ../../modules/home/hyprland/animations-mahaveer-me-2.nix; - #animChoice = ../../modules/home/hyprland/animations-ml4w-classic.nix; - #animChoice = ../../modules/home/hyprland/animations-ml4w-fast.nix; - #animChoice = ../../modules/home/hyprland/animations-ml4w-high.nix; - - # Set network hostId if required (needed for zfs) - # Otherwise leave as-is - hostId = "5ab03f50"; + # Set network hostId if required (needed for zfs) + # Otherwise leave as-is + hostId = "5ab03f50"; + }; } diff --git a/install-zaneyos.sh b/install-zaneyos.sh index 657492d..fc4934f 100755 --- a/install-zaneyos.sh +++ b/install-zaneyos.sh @@ -28,19 +28,22 @@ print_header() { echo -e "${GREEN}╚═══════════════════════════════════════════════════════════════════════╝${NC}" } -# Function to print a configuration summary +# Function to print a configuration summary (robust formatting) print_summary() { - echo -e "${CYAN}╔═══════════════════════════════════════════════════════════════════════╗${NC}" - echo -e "${CYAN}║ 📋 Installation Configuration Summary ║${NC}" - echo -e "${CYAN}╠═══════════════════════════════════════════════════════════════════════╣${NC}" - echo -e "${CYAN}║ 🖥️ Hostname: ${BLUE}${1}${NC}" - echo -e "${CYAN}║ 🎮 GPU Profile: ${BLUE}${2}${NC}" - echo -e "${CYAN}║ 👤 System Username: ${BLUE}${3}${NC}" - echo -e "${CYAN}║ 🌐 Timezone: ${BLUE}${4}${NC}" - echo -e "${CYAN}║ ⌨️ Keyboard Layout: ${BLUE}${5}${NC}" - echo -e "${CYAN}║ ⌨️ Keyboard Variant: ${BLUE}${6:-none}${NC}" - echo -e "${CYAN}║ 🖥️ Console Keymap: ${BLUE}${7:-$5}${NC}" - echo -e "${CYAN}╚═══════════════════════════════════════════════════════════════════════╝${NC}" + local hostname="$1" profile="$2" user="$3" tz="$4" layout="$5" variant="$6" console="$7" + local v + v="${variant:-none}" + printf "%b\n" "${CYAN}╔═══════════════════════════════════════════════════════════════════════╗${NC}" + printf "%b\n" "${CYAN}║ 📋 Installation Configuration Summary ║${NC}" + printf "%b\n" "${CYAN}╠═══════════════════════════════════════════════════════════════════════╣${NC}" + printf "%b\n" "${CYAN}║ 🖥️ Hostname: ${BLUE}${hostname}${NC}" + printf "%b\n" "${CYAN}║ 🎮 GPU Profile: ${BLUE}${profile}${NC}" + printf "%b\n" "${CYAN}║ 👤 System Username: ${BLUE}${user}${NC}" + printf "%b\n" "${CYAN}║ 🌐 Timezone: ${BLUE}${tz}${NC}" + printf "%b\n" "${CYAN}║ ⌨️ Keyboard Layout: ${BLUE}${layout}${NC}" + printf "%b\n" "${CYAN}║ ⌨️ Keyboard Variant: ${BLUE}${v}${NC}" + printf "%b\n" "${CYAN}║ 🖥️ Console Keymap: ${BLUE}${console:-$layout}${NC}" + printf "%b\n" "${CYAN}╚═══════════════════════════════════════════════════════════════════════╝${NC}" } # Function to print an error message @@ -87,6 +90,14 @@ if ! command -v lspci &>/dev/null; then exit 1 fi +# Check for python3 (required for helper scripts) +if ! command -v python3 &>/dev/null; then + print_error "python3 is not installed." + echo -e "Please install python3, then re-run the install script." + echo -e "Example: nix-shell -p python3" + exit 1 +fi + if [ -n "$(grep -i nixos 0) seen=1 + } + in_hosts && /\];/ { + if (!seen) print " \"" h "\"" + in_hosts=0 + } + { print } +' ./flake.nix > ./flake.nix.tmp && mv ./flake.nix.tmp ./flake.nix + +# (quiet) flake updated + +# Update timezone in system.nix (robust quoting via Python helper) cp ./modules/core/system.nix ./modules/core/system.nix.bak -awk -v newtz="$timezone" '/^ time\.timeZone = / { sub(/"[^"]*"/, "\"" newtz "\""); } { print }' ./modules/core/system.nix.bak >./modules/core/system.nix +python3 ./scripts/update_timezone.py ./modules/core/system.nix "$timezone" || { + print_error "Failed to update time.timeZone in modules/core/system.nix"; + exit 1; +} rm ./modules/core/system.nix.bak -# Update variables in host file (do all keys in one pass to avoid quoting issues) +# Update variables in host file; support both old style and new zaneyos options block cp ./hosts/$hostName/variables.nix ./hosts/$hostName/variables.nix.bak -awk -v v_user="$gitUsername" \ - -v v_email="$gitEmail" \ - -v v_kb="$keyboardLayout" \ - -v v_kv="$keyboardVariant" \ - -v v_ckm="$consoleKeyMap" ' - /^ gitUsername = / { sub(/"[^"]*"/, "\"" v_user "\"") } - /^ gitEmail = / { sub(/"[^"]*"/, "\"" v_email "\"") } - /^ keyboardLayout = / { sub(/"[^"]*"/, "\"" v_kb "\"") } - /^ keyboardVariant = / { sub(/"[^"]*"/, "\"" v_kv "\"") } - /^ consoleKeyMap = / { sub(/"[^"]*"/, "\"" v_ckm "\"") } - { print } -' ./hosts/$hostName/variables.nix.bak >./hosts/$hostName/variables.nix +python3 ./scripts/update_vars.py "./hosts/$hostName/variables.nix" \ + "$gitUsername" "$gitEmail" "$hostName" "$profile" "$keyboardLayout" "$keyboardVariant" "$consoleKeyMap" || { + print_error "Failed to update hosts/$hostName/variables.nix"; + echo "Check the file exists and the script at ./scripts/update_vars.py is present."; + exit 1; +} rm ./hosts/$hostName/variables.nix.bak echo "Configuration files updated successfully!" @@ -444,21 +422,22 @@ git add . git config --global --unset-all user.name git config --global --unset-all user.email -print_header "Generating Hardware Configuration -- Ignore ERROR: cannot access /bin" +print_header "Generating Hardware Configuration" sudo nixos-generate-config --show-hardware-config >./hosts/$hostName/hardware.nix print_header "Setting Nix Configuration" NIX_CONFIG="experimental-features = nix-command flakes" print_header "Initiating NixOS Build" -read -p "Ready to run initial build? (Y/N): " -n 1 -r -echo -if [[ ! $REPLY =~ ^[Yy]$ ]]; then +printf "%s" "Ready to run initial build? [y/N]: " +read -r REPLY +if ! [[ "$REPLY" =~ ^[Yy]$ ]]; then echo -e "${RED}Build cancelled.${NC}" exit 1 fi -sudo nixos-rebuild boot --flake ~/zaneyos/#${profile} +# Build using the selected HOST (GPU profile is configured inside the host files) +sudo nixos-rebuild boot --flake ~/zaneyos#${hostName} # Check the exit status of the last command (nixos-rebuild) if [ $? -eq 0 ]; then diff --git a/modules/core/boot.nix b/modules/core/boot.nix index 51a5da5..886e383 100644 --- a/modules/core/boot.nix +++ b/modules/core/boot.nix @@ -2,14 +2,30 @@ pkgs, config, ... -}: { +}: let + inherit (pkgs.stdenv.hostPlatform) isx86_64 isAarch64; +in { boot = { - kernelPackages = pkgs.linuxPackages_latest; + kernelPackages = + if isx86_64 + then pkgs.linuxPackages_latest + else pkgs.linuxPackages_zen; + kernelModules = ["v4l2loopback"]; extraModulePackages = [config.boot.kernelPackages.v4l2loopback]; kernel.sysctl = {"vm.max_map_count" = 2147483642;}; - loader.systemd-boot.enable = true; - loader.efi.canTouchEfiVariables = true; + + loader = { + grub.enable = false; + systemd-boot.enable = isx86_64; + efi.canTouchEfiVariables = true; + + # this is the bootloader used for raspberry pi 4. + # we will presumably need more fine-grained configuration for what + # bootloader to use. + generic-extlinux-compatible.enable = isAarch64; + }; + # Appimage Support binfmt.registrations.appimage = { wrapInterpreterInShell = false; diff --git a/modules/core/default.nix b/modules/core/default.nix index fc6f714..9127aed 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -1,12 +1,6 @@ -{ - inputs, - host, - ... -}: let - # Import the host-specific variables.nix - vars = import ../../hosts/${host}/variables.nix; -in { +{inputs, ...}: { imports = [ + ../options.nix ./boot.nix ./flatpak.nix ./fonts.nix @@ -15,14 +9,12 @@ in { ./nfs.nix ./nh.nix ./quickshell.nix + ./overlays.nix ./packages.nix ./printing.nix - # Conditionally import the display manager module - ( - if vars.displayManager == "tui" - then ./ly.nix - else ./sddm.nix - ) + ./ly.nix + ./sddm.nix + ./scanners.nix ./security.nix ./services.nix ./steam.nix diff --git a/modules/core/flatpak.nix b/modules/core/flatpak.nix index 2862127..b328411 100644 --- a/modules/core/flatpak.nix +++ b/modules/core/flatpak.nix @@ -1,9 +1,8 @@ -{pkgs, ...}: { - xdg.portal = { - enable = true; - extraPortals = [pkgs.xdg-desktop-portal-hyprland]; - configPackages = [pkgs.hyprland]; - }; +{inputs, ...}: { + imports = [ + inputs.nix-flatpak.nixosModules.nix-flatpak + ]; + services = { flatpak = { enable = true; @@ -15,7 +14,7 @@ #"com.github.tchx84.Flatseal" #Manage flatpak permissions - should always have this #"com.rtosta.zapzap" # WhatsApp client #"io.github.flattool.Warehouse" # Manage flatpaks, clean data, remove flatpaks and deps - #"it.mijorus.gearlever" # Manage and support AppImages + #"it.mijorus.gearlever" # Manage and support AppImages #"io.github.freedoom.Phase1" # Classic Doom FPS 1 #"io.github.freedoom.Phase2" # Classic Doom FPS 2 #"io.github.dvlv.boxbuddyrs" # Manage distroboxes @@ -24,7 +23,7 @@ # Add other Flatpak IDs here, e.g., "org.mozilla.firefox" ]; - # Optional: Automatically update Flatpaks when you run nixos-rebuild swit ch + # Optional: Automatically update Flatpaks when you run nixos-rebuild switch update.onActivation = true; }; }; diff --git a/modules/core/fonts.nix b/modules/core/fonts.nix index 22b9e78..ff39e01 100644 --- a/modules/core/fonts.nix +++ b/modules/core/fonts.nix @@ -9,6 +9,7 @@ ibm-plex inter jetbrains-mono + lilex material-icons maple-mono.NF minecraftia diff --git a/modules/core/hardware.nix b/modules/core/hardware.nix index f34c74d..34db9db 100644 --- a/modules/core/hardware.nix +++ b/modules/core/hardware.nix @@ -1,10 +1,5 @@ -{pkgs, ...}: { +{config, ...}: { hardware = { - sane = { - enable = true; - extraBackends = [pkgs.sane-airscan]; - disabledDefaultBackends = ["escl"]; - }; logitech.wireless.enable = false; logitech.wireless.enableGraphical = false; graphics.enable = true; diff --git a/modules/core/ly.nix b/modules/core/ly.nix index e50fb41..1f83f19 100644 --- a/modules/core/ly.nix +++ b/modules/core/ly.nix @@ -1,13 +1,9 @@ { - host, + config, lib, ... -}: let - # Import the host-specific variables.nix - vars = import ../../hosts/${host}/variables.nix; - useLy = vars.displayManager == "tui"; -in { - config = lib.mkIf useLy { +}: { + config = lib.mkIf (config.zaneyos.displayManager == "tui") { # Prefer ly when TUI is selected; avoid greetd conflicts services.greetd.enable = lib.mkDefault false; diff --git a/modules/core/network.nix b/modules/core/network.nix index 325f7a0..d56324b 100644 --- a/modules/core/network.nix +++ b/modules/core/network.nix @@ -1,14 +1,14 @@ { pkgs, - host, options, + config, ... }: let - inherit (import ../../hosts/${host}/variables.nix) hostId; + inherit (config.zaneyos) hostName hostId; in { networking = { - hostName = "${host}"; - hostId = hostId; + inherit hostName; + inherit hostId; networkmanager.enable = true; timeServers = options.networking.timeServers.default ++ ["pool.ntp.org"]; firewall = { diff --git a/modules/core/nfs.nix b/modules/core/nfs.nix index adbcde8..9b3b78c 100644 --- a/modules/core/nfs.nix +++ b/modules/core/nfs.nix @@ -1,5 +1,5 @@ -{host, ...}: let - inherit (import ../../hosts/${host}/variables.nix) enableNFS; +{config, ...}: let + inherit (config.zaneyos) enableNFS; in { services = { rpcbind.enable = enableNFS; diff --git a/modules/core/overlays.nix b/modules/core/overlays.nix index 1f473aa..4a029e1 100644 --- a/modules/core/overlays.nix +++ b/modules/core/overlays.nix @@ -2,6 +2,8 @@ nixpkgs.overlays = [ # Provide pkgs.google-antigravity via antigravity-nix overlay inputs.antigravity-nix.overlays.default + + # Build tumbler without EPUB thumbnailer (libgepub) to avoid webkitgtk (_final: prev: { xfce = prev.xfce // { diff --git a/modules/core/packages.nix b/modules/core/packages.nix index 5c7a7a9..e1ae5cd 100644 --- a/modules/core/packages.nix +++ b/modules/core/packages.nix @@ -1,21 +1,24 @@ { inputs, pkgs, - host, + config, ... }: let - vars = import ../../hosts/${host}/variables.nix; - inherit (vars) barChoice; + inherit (config.zaneyos) barChoice; + # Noctalia-specific packages + # gpu-screen-recorder requires x86_64 architecture noctaliaPkgs = - if barChoice == "noctalia" + if pkgs.stdenv.hostPlatform.isx86_64 && barChoice == "noctalia" then with pkgs; [ matugen # color palette generator needed for noctalia-shell app2unit # launcher for noctalia-shell - gpu-screen-recorder # needed for nnoctalia-shell + gpu-screen-recorder # needed for noctalia-shell + power-profiles-daemon # needed for noctalia-shell power cycle ] else []; + in { programs = { neovim = { @@ -52,20 +55,21 @@ in { appimage-run # Needed For AppImage Support brave # Brave Browser brightnessctl # For Screen Brightness Control + caligula # TUI for writing ISOs to flash cliphist # Clipboard manager using rofi menu cmatrix # Matrix Movie Effect In Terminal cowsay # Great Fun Terminal Program + discord # Stable client + discord-canary # beta client docker-compose # Allows Controlling Docker From A Single File duf # Utility For Viewing Disk Usage In Terminal dysk # Disk space util nice formattting eza # Beautiful ls Replacement ffmpeg # Terminal Video / Audio Editing file-roller # Archive Manager - gearlever # Manage / run Appimages - icu # dep for gearlever + gedit # Simple Graphical Text Editor gimp # Great Photo Editor - gpu-screen-recorder # needed for nnoctalia-shell - power-profiles-daemon # needed for noctalia-shell power cycle + google-chrome # Browser mesa-demos # needed for inxi diag util tuigreet # The Login Manager (Sometimes Referred To As Display Manager) htop # Simple Terminal Based System Monitor @@ -100,6 +104,7 @@ in { upower # noctalia shell battery uwsm # Universal Wayland Session Manager (optional must be enabled) v4l-utils # Used For Things Like OBS Virtual Camera + warp-terminal # Terminal with AI support build in waypaper # Change wallpaper wget # Tool For Fetching Files With Links ytmdl # Tool For Downloading Audio From YouTube diff --git a/modules/core/printing.nix b/modules/core/printing.nix index 982126f..7acf5d2 100644 --- a/modules/core/printing.nix +++ b/modules/core/printing.nix @@ -1,5 +1,5 @@ -{host, ...}: let - inherit (import ../../hosts/${host}/variables.nix) printEnable; +{config, ...}: let + inherit (config.zaneyos) printEnable; in { services = { printing = { diff --git a/modules/core/scanners.nix b/modules/core/scanners.nix new file mode 100644 index 0000000..e3f7708 --- /dev/null +++ b/modules/core/scanners.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + pkgs, + username, + ... +}: +lib.mkIf config.zaneyos.scannerEnable { + hardware.sane = { + enable = true; + extraBackends = [pkgs.sane-airscan]; + disabledDefaultBackends = ["escl"]; + }; + + users.users.${username}.extraGroups = ["scanner"]; +} diff --git a/modules/core/sddm.nix b/modules/core/sddm.nix index c173803..6cdce8f 100644 --- a/modules/core/sddm.nix +++ b/modules/core/sddm.nix @@ -3,7 +3,6 @@ pkgs, config, lib, - host, ... }: let foreground = config.stylix.base16Scheme.base00; @@ -62,33 +61,33 @@ }; }; in { - services.displayManager = { - sddm = { - package = pkgs.kdePackages.sddm; - extraPackages = [sddm-astronaut]; - enable = true; - wayland.enable = true; - theme = "sddm-astronaut-theme"; - settings = let - vars = import ../../hosts/${host}/variables.nix; - keyboardLayout = vars.keyboardLayout or "us"; - keyboardVariant = vars.keyboardVariant or ""; - in { - X11 = { - XkbLayout = keyboardLayout; - XkbVariant = keyboardVariant; + config = lib.mkIf (config.zaneyos.displayManager == "sddm") { + services.displayManager = { + sddm = { + package = pkgs.kdePackages.sddm; + extraPackages = [sddm-astronaut]; + enable = true; + wayland.enable = true; + theme = "sddm-astronaut-theme"; + settings = let + keyboardLayout = config.zaneyos.keyboardLayout; + keyboardVariant = config.zaneyos.keyboardVariant; + in { + X11 = { + XkbLayout = keyboardLayout; + XkbVariant = keyboardVariant; + }; }; }; }; + + # Ensure Wayland SDDM also sees XKB defaults + systemd.services.display-manager.environment = let + keyboardLayout = config.zaneyos.keyboardLayout; + keyboardVariant = config.zaneyos.keyboardVariant; + in ({XKB_DEFAULT_LAYOUT = keyboardLayout;} + // lib.optionalAttrs (keyboardVariant != "") {XKB_DEFAULT_VARIANT = keyboardVariant;}); + + environment.systemPackages = [sddm-astronaut]; }; - - # Ensure Wayland SDDM also sees XKB defaults - systemd.services.display-manager.environment = let - vars = import ../../hosts/${host}/variables.nix; - keyboardLayout = vars.keyboardLayout or "us"; - keyboardVariant = vars.keyboardVariant or ""; - in ({XKB_DEFAULT_LAYOUT = keyboardLayout;} - // lib.optionalAttrs (keyboardVariant != "") {XKB_DEFAULT_VARIANT = keyboardVariant;}); - - environment.systemPackages = [sddm-astronaut]; } diff --git a/modules/core/services.nix b/modules/core/services.nix index caf5798..3aba8c4 100644 --- a/modules/core/services.nix +++ b/modules/core/services.nix @@ -1,4 +1,6 @@ -{profile, ...}: { +{config, ...}: let + inherit (config.zaneyos) enableSmartD; +in { # Services to start services = { upower.enable = true; # noctalia shell battery @@ -20,10 +22,7 @@ gnome.gnome-keyring.enable = true; smartd = { - enable = - if profile == "vm" - then false - else true; + enable = enableSmartD; autodetect = true; }; pipewire = { diff --git a/modules/core/steam.nix b/modules/core/steam.nix index 84829ec..a23ae9b 100644 --- a/modules/core/steam.nix +++ b/modules/core/steam.nix @@ -1,4 +1,9 @@ -{pkgs, ...}: { +{ + lib, + pkgs, + ... +}: +lib.mkIf pkgs.stdenv.hostPlatform.isx86_64 { programs = { steam = { enable = false; diff --git a/modules/core/stylix.nix b/modules/core/stylix.nix index 3ed5d35..4ccff1e 100644 --- a/modules/core/stylix.nix +++ b/modules/core/stylix.nix @@ -1,9 +1,9 @@ { pkgs, - host, + config, ... }: let - inherit (import ../../hosts/${host}/variables.nix) stylixImage; + inherit (config.zaneyos) stylixImage; in { # Styling Options stylix = { diff --git a/modules/core/system.nix b/modules/core/system.nix index d728615..ece1a83 100644 --- a/modules/core/system.nix +++ b/modules/core/system.nix @@ -1,6 +1,9 @@ -{host, ...}: let - vars = import ../../hosts/${host}/variables.nix; - consoleKeyMap = vars.consoleKeyMap or "us"; +{ + config, + inputs, + ... +}: let + inherit (config.zaneyos) consoleKeyMap; in { nix = { settings = { @@ -29,9 +32,9 @@ in { }; environment.variables = { NIXOS_OZONE_WL = "1"; - ZANEYOS_VERSION = "2.6.1"; + ZANEYOS_VERSION = "3.0"; ZANEYOS = "true"; }; console.keyMap = "${consoleKeyMap}"; - system.stateVersion = "23.11"; # Do not change! + system.stateVersion = "25.11"; # Do not change! } diff --git a/modules/core/thunar.nix b/modules/core/thunar.nix index 9c82ac5..0b1aae8 100644 --- a/modules/core/thunar.nix +++ b/modules/core/thunar.nix @@ -1,16 +1,16 @@ { - host, + config, pkgs, ... }: let - inherit (import ../../hosts/${host}/variables.nix) thunarEnable; + inherit (config.zaneyos) thunarEnable; in { programs = { thunar = { enable = thunarEnable; - plugins = [ - pkgs.thunar-archive-plugin - pkgs.thunar-volman + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman ]; }; }; diff --git a/modules/core/user.nix b/modules/core/user.nix index a292018..cfd894a 100644 --- a/modules/core/user.nix +++ b/modules/core/user.nix @@ -1,19 +1,22 @@ { - pkgs, - inputs, - username, + config, host, - profile, + inputs, + pkgs, + username, ... }: let - inherit (import ../../hosts/${host}/variables.nix) gitUsername; + inherit (config.zaneyos) gitUsername; in { imports = [inputs.home-manager.nixosModules.home-manager]; home-manager = { useUserPackages = true; useGlobalPkgs = false; backupFileExtension = "backup"; - extraSpecialArgs = {inherit inputs username host profile pkgs;}; + extraSpecialArgs = { + inherit inputs username host pkgs; + inherit (config) zaneyos; + }; users.${username} = { imports = [./../home]; home = { @@ -33,7 +36,6 @@ in { "libvirtd" #Virt manager/QEMU access "lp" "networkmanager" - "scanner" "wheel" #sudo access "vboxusers" #Virtual Box ]; diff --git a/modules/core/xserver.nix b/modules/core/xserver.nix index 98f88e7..554c966 100644 --- a/modules/core/xserver.nix +++ b/modules/core/xserver.nix @@ -1,7 +1,6 @@ -{host, ...}: let - vars = import ../../hosts/${host}/variables.nix; - keyboardLayout = vars.keyboardLayout or "us"; - keyboardVariant = vars.keyboardVariant or ""; +{config, ...}: let + inherit (config.zaneyos) keyboardLayout; + inherit (config.zaneyos) keyboardVariant; # Treat only known US-based variants as implying layout = "us". usVariants = ["dvorak" "colemak" "workman" "intl" "us-intl" "altgr-intl"]; diff --git a/modules/drivers/nvidia-amd-hybrid.nix b/modules/drivers/nvidia-amd-hybrid.nix index 4bc78b6..d6e0083 100644 --- a/modules/drivers/nvidia-amd-hybrid.nix +++ b/modules/drivers/nvidia-amd-hybrid.nix @@ -25,8 +25,8 @@ in { config = mkIf cfg.enable { # Enforce kernel 6.12 when this hybrid config is selected - # Not sure this is still neeeded but leaving just in case - # boot.kernelPackages = lib.mkForce pkgs.linuxPackages_6_12; + # Not sure this is still needed leaving in just in case + #boot.kernelPackages = lib.mkForce pkgs.linuxPackages_6_12; services.xserver.videoDrivers = ["nvidia"]; diff --git a/modules/home/bash.nix b/modules/home/bash.nix index ba4de54..db4fec8 100644 --- a/modules/home/bash.nix +++ b/modules/home/bash.nix @@ -1,4 +1,6 @@ -{profile, ...}: { +{zaneyos, ...}: let + profile = zaneyos.hostName; +in { programs.bash = { enable = false; enableCompletion = true; diff --git a/modules/home/cli/btop.nix b/modules/home/cli/btop.nix index 845d758..1e05563 100644 --- a/modules/home/cli/btop.nix +++ b/modules/home/cli/btop.nix @@ -1,10 +1,21 @@ -{pkgs, ...}: { +{ + lib, + osConfig, + pkgs, + ... +}: let + package = + if (!pkgs.stdenv.hostPlatform.isx86_64) + then pkgs.btop + else + pkgs.btop.override { + rocmSupport = true; + cudaSupport = true; + }; +in { programs.btop = { enable = true; - package = pkgs.btop.override { - rocmSupport = true; - cudaSupport = true; - }; + inherit package; settings = { vim_keys = true; rounded_corners = true; diff --git a/modules/home/cli/git.nix b/modules/home/cli/git.nix index 996b394..9bef8f4 100644 --- a/modules/home/cli/git.nix +++ b/modules/home/cli/git.nix @@ -1,5 +1,5 @@ -{host, ...}: let - inherit (import ../../../hosts/${host}/variables.nix) gitUsername gitEmail; +{zaneyos, ...}: let + inherit (zaneyos) gitUsername gitEmail; in { programs.git = { enable = true; diff --git a/modules/home/default.nix b/modules/home/default.nix index 4b1a69f..1773b07 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,18 +1,7 @@ -{host, ...}: let - vars = import ../../hosts/${host}/variables.nix; - inherit - (vars) - alacrittyEnable - barChoice - ghosttyEnable - tmuxEnable - waybarChoice - weztermEnable - vscodeEnable - helixEnable - doomEmacsEnable - antigravityEnable - ; +{zaneyos, ...}: let + inherit (zaneyos) barChoice waybarChoice; + neovimConfig = zaneyos.neovimConfig or "nixvim"; + # Select bar module based on barChoice barModule = if barChoice == "noctalia" @@ -21,88 +10,57 @@ in { imports = [ - ./amfora.nix - ./bash.nix - ./bashrc-personal.nix - ./overview.nix - ./python.nix - ./cli/bat.nix - ./cli/btop.nix - ./cli/bottom.nix - ./cli/cava.nix - ./emoji.nix - ./eza.nix - ./fastfetch - ./cli/fzf.nix - ./cli/gh.nix - ./cli/git.nix - ./gtk.nix - ./cli/htop.nix - ./hyprland - ./terminals/kitty.nix - ./cli/lazygit.nix - ./obs-studio.nix - #./editors/nvf.nix - ./editors/nixvim.nix - ./editors/nano.nix - ./rofi - ./qt.nix - ./scripts - ./scripts/gemini-cli.nix - ./stylix.nix - ./swappy.nix - ./swaync.nix - ./tealdeer.nix - ./virtmanager.nix - barModule - ./wlogout - ./xdg.nix - ./yazi - #./zen-browser.nix - ./zoxide.nix - ./zsh + ./terminals/alacritty.nix + ./amfora.nix + ./editors/antigravity.nix + ./bash.nix + ./bashrc-personal.nix + ./overview.nix + ./python.nix + ./cli/bat.nix + ./cli/btop.nix + ./cli/bottom.nix + ./cli/cava.nix + ./editors/doom-emacs.nix + ./editors/doom-emacs-install.nix + ./emoji.nix + ./editors/evil-helix.nix + ./eza.nix + ./fastfetch + ./cli/fzf.nix + ./cli/gh.nix + ./terminals/ghostty.nix + ./cli/git.nix + ./gtk.nix + ./cli/htop.nix + ./hyprland + ./terminals/kitty.nix + ./cli/lazygit.nix + ./obs-studio.nix + ./editors/nano.nix + ./rofi + ./qt.nix + ./scripts + ./scripts/gemini-cli.nix + ./stylix.nix + ./swappy.nix + ./swaync.nix + ./tealdeer.nix + ./terminals/tmux.nix + ./virtmanager.nix + ./editors/vscode.nix + ./terminals/wezterm.nix + barModule + ./wlogout + ./xdg.nix + ./yazi + ./zen-browser.nix + ./zoxide.nix + ./zsh ] ++ ( - if helixEnable - then [./editors/evil-helix.nix] - else [] - ) - ++ ( - if vscodeEnable - then [./editors/vscode.nix] - else [] - ) - ++ ( - if antigravityEnable - then [./editors/antigravity.nix] - else [] - ) - ++ ( - if doomEmacsEnable - then [ - ./editors/doom-emacs-install.nix - ./editors/doom-emacs.nix - ] - else [] - ) - ++ ( - if weztermEnable - then [./terminals/wezterm.nix] - else [] - ) - ++ ( - if ghosttyEnable - then [./terminals/ghostty.nix] - else [] - ) - ++ ( - if tmuxEnable - then [./terminals/tmux.nix] - else [] - ) - ++ ( - if alacrittyEnable - then [./terminals/alacritty.nix] - else [] + if neovimConfig == "nixvim" + then [./editors/nixvim.nix] + else [./editors/nvf.nix] ); } diff --git a/modules/home/editors/antigravity.nix b/modules/home/editors/antigravity.nix index c5dc963..594b1d6 100644 --- a/modules/home/editors/antigravity.nix +++ b/modules/home/editors/antigravity.nix @@ -1,4 +1,10 @@ -{pkgs, ...}: { +{ + lib, + pkgs, + zaneyos, + ... +}: +lib.mkIf zaneyos.antigravityEnable { # Google Antigravity IDE helper, exposed via antigravity-nix overlay as pkgs.google-antigravity home.packages = with pkgs; [ google-antigravity diff --git a/modules/home/editors/doom-emacs-install.nix b/modules/home/editors/doom-emacs-install.nix index cdc48fa..24717c1 100644 --- a/modules/home/editors/doom-emacs-install.nix +++ b/modules/home/editors/doom-emacs-install.nix @@ -1,9 +1,10 @@ -{pkgs, ...}: let - doom-icon = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/jeetelongname/doom-banners/master/splashes/doom/doom-emacs-color2.svg"; - sha256 = "1xxi5ra1z8njsqaqiaq96wyn1sc967l42kvjzbji1zrjj8za6bgq"; - }; -in { +{ + lib, + pkgs, + zaneyos, + ... +}: +lib.mkIf zaneyos.doomEmacsEnable { # 1. Create a script to install Doom Emacs home.packages = [ (pkgs.writeShellScriptBin "get-doom" '' @@ -63,7 +64,12 @@ in { ]; # 3. Create a desktop file - xdg.desktopEntries.doom-emacs = { + xdg.desktopEntries.doom-emacs = let + doom-icon = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/jeetelongname/doom-banners/master/splashes/doom/doom-emacs-color2.svg"; + sha256 = "1xxi5ra1z8njsqaqiaq96wyn1sc967l42kvjzbji1zrjj8za6bgq"; + }; + in { name = "Doom Emacs"; comment = "A configuration framework for GNU Emacs"; exec = "emacs"; diff --git a/modules/home/editors/doom-emacs.nix b/modules/home/editors/doom-emacs.nix index 8559a3f..829ead9 100644 --- a/modules/home/editors/doom-emacs.nix +++ b/modules/home/editors/doom-emacs.nix @@ -1,4 +1,10 @@ -{pkgs, ...}: { +{ + lib, + pkgs, + zaneyos, + ... +}: +lib.mkIf zaneyos.doomEmacsEnable { home.packages = with pkgs; [ emacs-pgtk git diff --git a/modules/home/editors/evil-helix.nix b/modules/home/editors/evil-helix.nix index 3204ffc..39a2fe3 100644 --- a/modules/home/editors/evil-helix.nix +++ b/modules/home/editors/evil-helix.nix @@ -1,88 +1,82 @@ -{pkgs, ...}: let - enableEvilHelix = true; # Set to true to enable the configuration -in { - home.packages = with pkgs; ( - if enableEvilHelix - then [ - evil-helix - cmake-language-server - jsonnet-language-server - luaformatter - lua-language-server - #marksman # causes dotnet and dotnet-swr to build which takes hours - multimarkdown - taplo - nil - jq-lsp - vscode-langservers-extracted - bash-language-server - awk-language-server - vscode-extensions.llvm-vs-code-extensions.vscode-clangd - clang-tools - docker-compose-language-service - docker-compose - docker-language-server - typescript-language-server - ] - else [] - ); +{ + lib, + pkgs, + zaneyos, + ... +}: +lib.mkIf zaneyos.helixEnable { + home.packages = with pkgs; [ + evil-helix + cmake-language-server + jsonnet-language-server + luaformatter + lua-language-server + #Amarksman # NET based causes dotnet docnet-vmr to build (hours long) + multimarkdown + taplo + nil + jq-lsp + vscode-langservers-extracted + bash-language-server + awk-language-server + vscode-extensions.llvm-vs-code-extensions.vscode-clangd + clang-tools + docker-compose-language-service + docker-compose + docker-language-server + typescript-language-server + ]; - home.file.".config/helix/languages.toml".text = - if enableEvilHelix - then '' - [language-server.nil] - command = "nil" + home.file.".config/helix/languages.toml".text = '' + [language-server.nil] + command = "nil" - [language-server.lua] - command = "lua-language-server" + [language-server.lua] + command = "lua-language-server" - [language-server.json] - command = "vscode-json-languageserver" + [language-server.json] + command = "vscode-json-languageserver" - [language-server.markdown] - command = "marksman" - '' - else ""; + [language-server.markdown] + command = "marksman" + ''; - home.file.".config/helix/config.toml".text = - if enableEvilHelix - then '' - theme = "catppuccin_mocha" - #theme = "ao" + home.file.".config/helix/config.toml".text = '' + theme = "catppuccin_mocha" + #theme = "ao" - [editor] - evil = true - end-of-line-diagnostics = "hint" - auto-pairs = true - mouse = true - middle-click-paste = true - shell = ["zsh", "-c"] - line-number = "absolute" - auto-completion = true - path-completion = true - auto-info = true - color-modes = true - popup-border = "all" - clipboard-provider = "wayland" - indent-heuristic = "hybrid" + [editor] + evil = true + end-of-line-diagnostics = "hint" + auto-pairs = true + mouse = true + middle-click-paste = true + shell = ["zsh", "-c"] + line-number = "absolute" + auto-completion = true + path-completion = true + auto-info = true + color-modes = true + popup-border = "all" + clipboard-provider = "wayland" + indent-heuristic = "hybrid" - [editor.statusline] - left = ["mode", "spinner"] - center = ["file-absolute-path", "total-line-numbers", "read-only-indicator", "file-modification-indicator"] - right = ["diagnostics", "selections", "position", "file-encoding", "file-line-ending", "file-type"] - separator = "│" - mode.normal = "NORMAL" - mode.insert = "INSERT" - mode.select = "SELECT" + [editor.statusline] + left = ["mode", "spinner"] + center = ["file-absolute-path", "total-line-numbers", "read-only-indicator", "file-modification-indicator"] + right = ["diagnostics", "selections", "position", "file-encoding", "file-line-ending", "file-type"] + separator = "│" + mode.normal = "NORMAL" + mode.insert = "INSERT" + mode.select = "SELECT" - [editor.lsp] - enable = true - display-messages = true - display-progress-messages = true + [editor.lsp] + enable = true + display-messages = true + display-progress-messages = true - [editor.inline-diagnostics] - cursor-line = "hint" - other-lines = "hint" - '' - else ""; + [editor.inline-diagnostics] + cursor-line = "hint" + other-lines = "hint" + ''; } diff --git a/modules/home/editors/nixvim.nix b/modules/home/editors/nixvim.nix index af1676d..76c3c6a 100644 --- a/modules/home/editors/nixvim.nix +++ b/modules/home/editors/nixvim.nix @@ -44,9 +44,6 @@ settings = { flavour = "mocha"; transparent_background = false; - integrations = { - lualine = true; - }; }; }; @@ -77,12 +74,7 @@ treesitter-context.enable = false; # Project management - project-nvim = { - enable = true; - settings = { - history.save_dir = "${config.home.homeDirectory}/.local/share/nvim/project_nvim"; - }; - }; + project-nvim.enable = true; # Notifications and UI polish notify.enable = true; @@ -132,38 +124,14 @@ markdown-preview.enable = true; # Completion and snippets - blink-cmp = { + cmp = { enable = true; - settings = { - keymap = { - preset = "default"; - "" = ["accept" "fallback"]; - "" = ["select_next" "fallback"]; - "" = ["select_prev" "fallback"]; - }; - appearance = { - nerd_font_variant = "mono"; - }; - completion = { - documentation = { - auto_show = true; - auto_show_delay_ms = 500; - }; - }; - sources = { - default = ["lsp" "path" "snippets" "buffer"]; - }; - snippets = { - preset = "luasnip"; - }; - fuzzy = { - implementation = "prefer_rust_with_warning"; - }; - signature = { - enabled = true; - }; - }; }; + # Completion sources for LSP, buffer, path, and snippets + cmp-nvim-lsp.enable = true; + cmp-buffer.enable = true; + cmp-path.enable = true; + cmp_luasnip.enable = true; luasnip.enable = true; friendly-snippets.enable = true; @@ -340,7 +308,9 @@ pyright lua-language-server zls - marksman + #markman is .NET based causes dotnet and dotnet-swr to build from source (hours long builds) + # switching to multimarkdown (C based) + #marksman multimarkdown clang-tools prettierd @@ -349,8 +319,6 @@ nixpkgs-fmt figlet toilet - bash-language-server - tailwindcss-language-server ]; # Diagnostic UI and notify background tweaks @@ -396,6 +364,44 @@ vim.notify = notify end + -- nvim-cmp setup: sources + mappings + snippet expansion + do + local ok_cmp, cmp = pcall(require, "cmp") + if ok_cmp then + local ok_snip, luasnip = pcall(require, "luasnip") + if ok_snip then + -- Load friendly-snippets lazily if available + pcall(function() + require("luasnip.loaders.from_vscode").lazy_load() + end) + end + cmp.setup({ + snippet = { + expand = function(args) + if ok_snip then luasnip.lsp_expand(args.body) end + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.select_prev_item(), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "path" }, + { name = "buffer" }, + }), + }) + -- nvim-cmp integration with nvim-autopairs (optional) + local ok_ap, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp") + if ok_ap then + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end + end + end -- Startup dashboard (alpha-nvim) do @@ -418,18 +424,17 @@ return #lines > 0 and lines or nil end - header_lines = gen_banner('toilet -f ansi-shadow NIXVIM 2>/dev/null') - or gen_banner('figlet -f "ANSI Shadow" NIXVIM 2>/dev/null') - or gen_banner('figlet NIXVIM 2>/dev/null') + header_lines = gen_banner('toilet -f ansi-shadow NIXOS 2>/dev/null') + or gen_banner('figlet -f "ANSI Shadow" NIXOS 2>/dev/null') + or gen_banner('figlet NIXOS 2>/dev/null') if not header_lines then header_lines = { - "███╗ ██╗██╗██╗ ██╗██╗ ██╗██╗███╗ ███╗", - "████╗ ██║██║╚██╗██╔╝██║ ██║██║████╗ ████║", - "██╔██╗ ██║██║ ╚███╔╝ ██║ ██║██║██╔████╔██║", - "██║╚██╗██║██║ ██╔██╗ ╚██╗ ██╔╝██║██║╚██╔╝██║", - "██║ ╚████║██║██╔╝ ██╗ ╚████╔╝ ██║██║ ╚═╝ ██║", - "╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝", + " _ _ ___ __ __ ___ ___ ____ ", + "| \\ | |_ _| \\ \\/ / / _ \\ / _ \\\ | _ \\ ", + "| \\| || | \\ / | | | | | | || | | |", + "| |\\ || | / \\ | |_| | |_| || |_| |", + "|_| \\_|___| /_/\\_\\ \\___/ \\___/ |____/ ", } end dashboard.section.header.val = header_lines @@ -460,9 +465,4 @@ end ''; }; - - home.activation.projectNvimHistory = '' - mkdir -p "$HOME/.local/share/nvim/project_nvim" - find "$HOME/.local/share/nvim/project_nvim" -type f -size 0 -delete 2>/dev/null || true - ''; } diff --git a/modules/home/editors/vscode.nix b/modules/home/editors/vscode.nix index 4f3ce02..bbf9f07 100644 --- a/modules/home/editors/vscode.nix +++ b/modules/home/editors/vscode.nix @@ -1,6 +1,7 @@ { pkgs, lib, + zaneyos, ... }: let inherit (pkgs.lib) attrByPath; @@ -62,7 +63,7 @@ }; in { programs.vscode = { - enable = true; + enable = zaneyos.vscodeEnable; profiles = { default = { extensions = diff --git a/modules/home/fastfetch/default.nix b/modules/home/fastfetch/default.nix index cdd1cd7..341c47e 100644 --- a/modules/home/fastfetch/default.nix +++ b/modules/home/fastfetch/default.nix @@ -133,4 +133,15 @@ ]; }; }; + + # Install additional Fastfetch JSON configs used by ff* wrappers + home.file = { + ".config/fastfetch/fastfetch-system-times.config.jsonc".source = ./fastfetch-system-times.config.jsonc; + ".config/fastfetch/fastfetch1.config.jsonc".source = ./fastfetch1.config.jsonc; + ".config/fastfetch/fastfetch2.config.jsonc".source = ./fastfetch2.config.jsonc; + ".config/fastfetch/fastfetch3.config.jsonc".source = ./fastfetch3.config.jsonc; + ".config/fastfetch/fastfetch4.config.jsonc".source = ./fastfetch4.config.jsonc; + ".config/fastfetch/fastfetch5.config.jsonc".source = ./fastfetch5.config.jsonc; + ".config/fastfetch/nixos.png".source = ./nixos.png; + }; } diff --git a/modules/home/fastfetch/fastfetch-system-times.config.jsonc b/modules/home/fastfetch/fastfetch-system-times.config.jsonc new file mode 100644 index 0000000..74c78e7 --- /dev/null +++ b/modules/home/fastfetch/fastfetch-system-times.config.jsonc @@ -0,0 +1,170 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "source": "~/.config/fastfetch/nixos.png", + "type": "kitty", + "height": 8, + "width": 16, + "padding": { + "top": 1, + "left": 4 + } + }, + "modules": [ + "break", + { + "type": "custom", + "format": "\u001b[32m┌─────────────────────────────────Hardware─────────────────────────────────┐", + "keyWidth": 20 + }, + { + "type": "board", + "key": " Motherboard:", + "format": "{1}", + "keyColor": "green", + "keyWidth": 20 + }, + { + "type": "bios", + "key": "│ ├ BIOS:", + "keyColor": "green", + "keyWidth": 20 + }, + { + "type": "battery", + "key": "│ └ Battery:", + "keyColor": "green", + "keyWidth": 20 + }, + { + "type": "cpu", + "key": "│ ├󰻠 CPU:", + "showPeCoreCount": true, + "keyColor": "green", + "keyWidth": 20 + }, + { + "type": "gpu", + "key": "│ ├󰢮 GPU:", + "keyColor": "green", + "format": "{2} {3}", + "keyWidth": 20 + }, + { + "type": "memory", + "key": "│ ├󰑭 RAM:", + "keyColor": "green", + "keyWidth": 20 + }, + { + "type": "disk", + "key": "│ └󰋊 Disk:", + "folders": "/", + "keyColor": "green", + "keyWidth": 20 + }, + { + "type": "custom", + "format": "\u001b[32m└──────────────────────────────────────────────────────────────────────────┘", + "keyWidth": 20 + }, + { + "type": "custom", + "format": "\u001b[33m┌─────────────────────────────────Software─────────────────────────────────┐", + "keyWidth": 20 + }, + { + "type": "os", + "key": " OS:", + "keyColor": "yellow", + "format": "{2}", + "keyWidth": 20 + }, + { + "type": "command", + "key": "│ ├ ZaneyOS:", + "keyColor": "yellow", + "text": "echo v${ZANEYOS_VERSION}", + "keyWidth": 20 + }, + { + "type": "initsystem", + "key": "│ ├ BootLoader:", + "format": "{1}", + "keyColor": "yellow", + "keyWidth": 20 + }, + { + "type": "kernel", + "key": "│ ├ Kernel:", + "keyColor": "yellow", + "keyWidth": 20 + }, + { + "type": "shell", + "key": "│ ├ Shell:", + "keyColor": "yellow", + "keyWidth": 20 + }, + { + "type": "packages", + "key": "│ ├󰏖 Packages:", + "keyColor": "yellow", + "keyWidth": 20 + }, + { + "type": "processes", + "key": "│ └ Processes:", + "keyColor": "yellow", + "keyWidth": 20 + }, + { + "type": "custom", + "format": "\u001b[33m└──────────────────────────────────────────────────────────────────────────┘", + "keyWidth": 20 + }, + { + "type": "custom", + "format": "\u001b[34m┌───────────────────────────Graphical Interface────────────────────────────┐", + "keyWidth": 20 + }, + { + "type": "wm", + "key": " WM:", + "keyColor": "blue", + "keyWidth": 20 + }, + { + "type": "theme", + "key": "│ ├󰉼 Theme:", + "format": "{2}", + "keyColor": "blue", + "keyWidth": 20 + }, + { + "type": "icons", + "key": "│ ├󰀻 Icons:", + "format": "{2}", + "keyColor": "blue", + "keyWidth": 20 + }, + { + "type": "terminal", + "key": "│ ├ Terminal:", + "keyColor": "blue", + "keyWidth": 20 + }, + { + "type": "font", + "key": "│ └ UI Font:", + "format": "{2}", + "keyColor": "blue", + "keyWidth": 20 + }, + { + "type": "custom", + "format": "\u001b[34m└──────────────────────────────────────────────────────────────────────────┘", + "keyWidth": 20 + } + ] +} diff --git a/modules/home/fastfetch/fastfetch1.config.jsonc b/modules/home/fastfetch/fastfetch1.config.jsonc new file mode 100644 index 0000000..5c3ad22 --- /dev/null +++ b/modules/home/fastfetch/fastfetch1.config.jsonc @@ -0,0 +1,119 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "type": "kitty-direct", + "source": "~/.config/fastfetch/nixos.png", + "height": 10, + "width": 21, + "padding": { + "top": 2, + "left": 2 + } + }, + "display": { + "separator": " " + }, + "modules": [ + "break", + { + "type": "title", + "keyWidth": 10 + }, + { + "type": "os", + "key": " OS", + "keyColor": "yellow" + }, + { + "type": "command", + "key": "├ ZaneyOS", + "keyColor": "yellow", + "text": "echo v${ZANEYOS_VERSION}" + }, + { + "type": "kernel", + "key": "├ Kernel", + "keyColor": "yellow" + }, + { + "type": "packages", + "key": "├󰏖 Packages", + "keyColor": "yellow" + }, + { + "type": "shell", + "key": "├ Shell", + "keyColor": "yellow" + }, + { + "type": "command", + "key": "└ Age", + "keyColor": "yellow", + "text": "birth_install=$(stat -c %W /); current=$(date +%s); time_progression=$((current - birth_install)); days_difference=$((time_progression / 86400)); echo $days_difference days" + }, + "break", + { + "type": "de", + "key": " DE", + "keyColor": "blue" + }, + { + "type": "wm", + "key": "󰧨 Window Manager", + "keyColor": "blue" + }, + { + "type": "lm", + "key": "├󰧨 Login Manager", + "keyColor": "blue" + }, + { + "type": "wmtheme", + "key": "├󰉼 WM Theme", + "keyColor": "blue" + }, + { + "type": "theme", + "format": "{1}", + "key": "├󰉼 Color Themes", + "keyColor": "blue" + }, + { + "type": "terminal", + "key": "└ Terminal", + "keyColor": "blue" + }, + "break", + { + "type": "chassis", + "key": "󰌢 PC", + "keyColor": "green" + }, + { + "type": "cpu", + "key": "├󰻠 CPU", + "keyColor": "green" + }, + { + "type": "gpu", + "key": "├󰍛 GPU", + "keyColor": "green" + }, + { + "type": "opengl", + "key": "├󰍛 OpenGL", + "keyColor": "green" + }, + { + "type": "vulkan", + "key": "├󰍛 Vulkan", + "keyColor": "green" + }, + { + "type": "display", + "key": "└󰍹 Display(s)", + "keyColor": "green" + }, + "break" + ] +} diff --git a/modules/home/fastfetch/fastfetch2.config.jsonc b/modules/home/fastfetch/fastfetch2.config.jsonc new file mode 100644 index 0000000..ae5cbca --- /dev/null +++ b/modules/home/fastfetch/fastfetch2.config.jsonc @@ -0,0 +1,128 @@ +{ + "display": { + "color": { + "keys": "35", + "output": "95" + }, + "separator": " ➜ " + }, + "logo": { + "height": 7, + "width": 14, + "padding": { + "left": 2, + "top": 2 + }, + "source": "~/.config/fastfetch/nixos.png", + "type": "kitty" + }, + "modules": [ + "break", + { + "type": "os", + "key": "OS", + "keyColor": "31" + }, + { + "type": "command", + "key": " ├  ZaneyOS ", + "keyColor": "31", + "text": "echo v${ZANEYOS_VERSION}" + }, + { + "key": " ├  ", + "keyColor": "31", + "type": "kernel" + }, + { + "key": " ├ 󰏖 ", + "keyColor": "31", + "type": "packages" + }, + { + "key": " └  ", + "keyColor": "31", + "type": "shell" + }, + "break", + { + "key": "WM ", + "keyColor": "32", + "type": "wm" + }, + { + "key": " ├ 󰉼 ", + "keyColor": "32", + "type": "wmtheme" + }, + { + "key": " ├ 󰀻 ", + "keyColor": "32", + "type": "icons" + }, + { + "key": " ├  ", + "keyColor": "32", + "type": "cursor" + }, + { + "key": " ├  ", + "keyColor": "32", + "type": "terminal" + }, + { + "key": " └  ", + "keyColor": "32", + "type": "terminalfont" + }, + "break", + { + "format": "{5} {1} Type {2}", + "key": "PC ", + "keyColor": "33", + "type": "host" + }, + { + "format": "{1} ({3}) @ {7} GHz", + "key": " ├  ", + "keyColor": "33", + "type": "cpu" + }, + { + "format": "{1} {2} @ {12} GHz", + "key": " ├ 󰢮 ", + "keyColor": "33", + "type": "gpu" + }, + { + "key": " ├  ", + "keyColor": "33", + "type": "memory" + }, + { + "key": " ├ 󰋊 ", + "keyColor": "33", + "type": "disk" + }, + { + "key": " ├  ", + "keyColor": "33", + "type": "monitor" + }, + { + "key": " ├ 󰥠 ", + "keyColor": "33", + "type": "player" + }, + { + "key": " └ 󰝚 ", + "keyColor": "33", + "type": "media" + }, + "break", + { + "key": " Uptime ", + "type": "uptime" + } + ] +} diff --git a/modules/home/fastfetch/fastfetch3.config.jsonc b/modules/home/fastfetch/fastfetch3.config.jsonc new file mode 100644 index 0000000..cee82ef --- /dev/null +++ b/modules/home/fastfetch/fastfetch3.config.jsonc @@ -0,0 +1,106 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "display": { + "separator": " | ", + "color": { + "output": "white" + } + }, + "logo": { + "height": 6, + "width": 12, + "padding": { + "left": 0, + "top": 1, + "right": 4 + }, + "source": "~/.config/fastfetch/nixos.png", + "type": "kitty", + "color": { + "1": "#FE8019", + "2": "white" + } + }, + "modules": [ + { + "type": "title", + "key": " 󰌾", + "keyColor": "#FE8019", + "color": { + "user": "white", + "at": "#FE8019", + "host": "white" + } + }, + "break", + { + "type": "os", + "key": " 󰌽", + "keyColor": "#FABD2F", + "format": "{pretty-name}" + }, + { + "type": "kernel", + "key": " 󰒓", + "keyColor": "#FABD2F", + "format": "{1} {2}" + }, + { + "type": "uptime", + "key": " 󰅐", + "keyColor": "#FABD2F" + }, + { + "type": "host", + "key": " 󰾰", + "keyColor": "#83A598" + }, + { + "type": "cpu", + "key": " 󰻠", + "keyColor": "#83A598" + }, + { + "type": "gpu", + "key": " 󰍛", + "keyColor": "#83A598" + }, + { + "type": "memory", + "key": " 󰇕", + "keyColor": "#83A598" + }, + { + "type": "display", + "key": " 󰍹", + "keyColor": "#83A598" + }, + "break", + { + "type": "wm", + "key": " 󰖲", + "keyColor": "#B8BB26" + }, + { + "type": "shell", + "key": " 󰞷", + "keyColor": "#B8BB26" + }, + { + "type": "terminal", + "key": " 󰹑", + "keyColor": "#B8BB26" + }, + { + "type": "packages", + "key": " 󰏖", + "keyColor": "#B8BB26" + }, + "break", + { + "type": "colors", + "paddingLeft": 2, + "symbol": "circle" + } + ] +} diff --git a/modules/home/fastfetch/fastfetch4.config.jsonc b/modules/home/fastfetch/fastfetch4.config.jsonc new file mode 100644 index 0000000..8217665 --- /dev/null +++ b/modules/home/fastfetch/fastfetch4.config.jsonc @@ -0,0 +1,104 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "type": "kitty", + "source": "~/.config/fastfetch/nixos.png", + "height": 8, + "width": 16, + "padding": { + "top": 2, + "left": 2 + } + }, + "display": { + "separator": " " + }, + "modules": [ + "break", + { + "type": "os", + "key": "󱄅 OS", + "keyColor": "blue" + }, + { + "type": "command", + "key": "├ ZaneyOS", + "keyColor": "blue", + "text": "echo v${ZANEYOS_VERSION}" + }, + { + "type": "kernel", + "key": "├ Kernel", + "keyColor": "blue" + }, + { + "type": "packages", + "key": "├󰏖 Packages", + "keyColor": "blue" + }, + { + "type": "shell", + "key": "└ Shell", + "keyColor": "blue" + }, + "break", + { + "type": "wm", + "key": "󰝘 WM", + "keyColor": "cyan" + }, + { + "type": "wmtheme", + "key": "├󰉼 WM Theme", + "keyColor": "cyan" + }, + { + "type": "theme", + "format": "{1}", + "key": "├󰉼 Color Theme", + "keyColor": "cyan" + }, + { + "type": "terminal", + "key": "├ Terminal", + "keyColor": "cyan" + }, + { + "type": "terminalfont", + "key": "└󰌯 Font", + "keyColor": "cyan" + }, + "break", + { + "type": "chassis", + "key": "󰌢 PC", + "keyColor": "green" + }, + { + "type": "cpu", + "key": "├󰻠 CPU", + "keyColor": "green" + }, + { + "type": "gpu", + "key": "├󰍛 GPU", + "keyColor": "green" + }, + { + "type": "memory", + "key": "├󰍹 Memory", + "keyColor": "green" + }, + { + "type": "disk", + "key": "└󰋊 Storage", + "keyColor": "green" + }, + "break", + { + "type": "uptime", + "key": "󰥠 Uptime", + "keyColor": "magenta" + } + ] +} diff --git a/modules/home/fastfetch/fastfetch5.config.jsonc b/modules/home/fastfetch/fastfetch5.config.jsonc new file mode 100644 index 0000000..374bd51 --- /dev/null +++ b/modules/home/fastfetch/fastfetch5.config.jsonc @@ -0,0 +1,118 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "type": "kitty", + "source": "~/.config/fastfetch/nixos.png", + "height": 8, + "width": 16, + "padding": { + "top": 2, + "left": 2 + } + }, + "display": { + "separator": "", + "constants": [ + "\u001b[89G│\u001b[55G " + ] + }, + "modules": [ + { + "type": "custom", + "key": "╭─────── ⋅ ⋅ ───── ✩ ───── ⋅ ⋅ ───────╮" + }, + { + "type": "board", + "key": "├  ", + "format": "{name}" + }, + { + "type": "cpu", + "key": "├  ", + "format": "{name}" + }, + { + "type": "gpu", + "key": "├ 󰍛 ", + "format": "{name}" + }, + { + "type": "memory", + "key": "├ 󰇕 ", + "format": "{used}/{total} ({percentage})" + }, + { + "type": "disk", + "key": "├ 󰋊 ", + "format": "{size-used}/{size-total} ({size-percentage})" + }, + { + "type": "custom", + "key": "╰─────── ⋅ ⋅ ───── ✩ ───── ⋅ ⋅ ───────╯" + }, + "break", + { + "type": "custom", + "key": "╭─────── ⋅ ⋅ ───── ✩ ───── ⋅ ⋅ ───────╮" + }, + { + "type": "os", + "key": "├ 󱄅 ", + "format": "{name} {version}" + }, + { + "type": "kernel", + "key": "├  ", + "format": "{sysname} {release}" + }, + { + "type": "uptime", + "key": "├  ", + "format": "{formatted}" + }, + { + "type": "custom", + "key": "╰─────── ⋅ ⋅ ───── ✩ ───── ⋅ ⋅ ───────╯" + }, + "break", + { + "type": "custom", + "key": "╭─────── ⋅ ⋅ ───── ✩ ───── ⋅ ⋅ ───────╮" + }, + { + "type": "wm", + "key": "├ 󰝘 ", + "format": "{pretty-name} {version}" + }, + { + "type": "terminal", + "key": "├  ", + "format": "{pretty-name} {version}" + }, + { + "type": "shell", + "key": "├  ", + "format": "{pretty-name} {version}" + }, + { + "type": "terminalfont", + "key": "├  ", + "format": "{name}" + }, + { + "type": "cursor", + "key": "├ 󰇀 ", + "format": "{theme}" + }, + { + "type": "custom", + "key": "╰─────── ⋅ ⋅ ───── ✩ ───── ⋅ ⋅ ───────╯" + }, + "break", + { + "type": "colors", + "symbol": "circle", + "paddingLeft": 12 + } + ] +} diff --git a/modules/home/hyprland/animations-end-slide.nix b/modules/home/hyprland/animations-end-slide.nix index 5a518fe..70f82f8 100644 --- a/modules/home/hyprland/animations-end-slide.nix +++ b/modules/home/hyprland/animations-end-slide.nix @@ -1,8 +1,4 @@ -{host, ...}: let - inherit - (import ../../../hosts/${host}/variables.nix) - ; -in { +_: { wayland.windowManager.hyprland.settings = { # Name: END-4-slide Modified to better support Hyprtrails # Credit: END-4 project https://github.com/end-4/dots-hyprland diff --git a/modules/home/hyprland/animations-end4-slide.nix b/modules/home/hyprland/animations-end4-slide.nix index 5a518fe..70f82f8 100644 --- a/modules/home/hyprland/animations-end4-slide.nix +++ b/modules/home/hyprland/animations-end4-slide.nix @@ -1,8 +1,4 @@ -{host, ...}: let - inherit - (import ../../../hosts/${host}/variables.nix) - ; -in { +_: { wayland.windowManager.hyprland.settings = { # Name: END-4-slide Modified to better support Hyprtrails # Credit: END-4 project https://github.com/end-4/dots-hyprland diff --git a/modules/home/hyprland/animations-hyde-optimized.nix b/modules/home/hyprland/animations-hyde-optimized.nix index 6e2d0af..b9998f9 100644 --- a/modules/home/hyprland/animations-hyde-optimized.nix +++ b/modules/home/hyprland/animations-hyde-optimized.nix @@ -1,8 +1,4 @@ -{host, ...}: let - inherit - (import ../../../hosts/${host}/variables.nix) - ; -in { +_: { wayland.windowManager.hyprland.settings = { animations = { enabled = true; diff --git a/modules/home/hyprland/animations-mahaveer-me-1.nix b/modules/home/hyprland/animations-mahaveer-me-1.nix index 82901a5..2f5d366 100644 --- a/modules/home/hyprland/animations-mahaveer-me-1.nix +++ b/modules/home/hyprland/animations-mahaveer-me-1.nix @@ -1,8 +1,4 @@ -{host, ...}: let - inherit - (import ../../../hosts/${host}/variables.nix) - ; -in { +_: { wayland.windowManager.hyprland.settings = { animations = { enabled = true; diff --git a/modules/home/hyprland/animations-mahaveer-me-2.nix b/modules/home/hyprland/animations-mahaveer-me-2.nix index 9bc6903..4ffbc2c 100644 --- a/modules/home/hyprland/animations-mahaveer-me-2.nix +++ b/modules/home/hyprland/animations-mahaveer-me-2.nix @@ -1,8 +1,4 @@ -{host, ...}: let - inherit - (import ../../../hosts/${host}/variables.nix) - ; -in { +_: { wayland.windowManager.hyprland.settings = { animations = { enabled = true; diff --git a/modules/home/hyprland/animations-ml4w-classic.nix b/modules/home/hyprland/animations-ml4w-classic.nix index ec20d3b..eead230 100644 --- a/modules/home/hyprland/animations-ml4w-classic.nix +++ b/modules/home/hyprland/animations-ml4w-classic.nix @@ -1,8 +1,4 @@ -{host, ...}: let - inherit - (import ../../../hosts/${host}/variables.nix) - ; -in { +_: { wayland.windowManager.hyprland.settings = { animations = { enabled = true; diff --git a/modules/home/hyprland/animations-ml4w-fast.nix b/modules/home/hyprland/animations-ml4w-fast.nix index 08edb6a..2a21abd 100644 --- a/modules/home/hyprland/animations-ml4w-fast.nix +++ b/modules/home/hyprland/animations-ml4w-fast.nix @@ -1,8 +1,4 @@ -{host, ...}: let - inherit - (import ../../../hosts/${host}/variables.nix) - ; -in { +_: { wayland.windowManager.hyprland.settings = { animations = { enabled = true; diff --git a/modules/home/hyprland/animations-ml4w-high.nix b/modules/home/hyprland/animations-ml4w-high.nix index 912f882..2190185 100644 --- a/modules/home/hyprland/animations-ml4w-high.nix +++ b/modules/home/hyprland/animations-ml4w-high.nix @@ -1,8 +1,4 @@ -{host, ...}: let - inherit - (import ../../../hosts/${host}/variables.nix) - ; -in { +_: { wayland.windowManager.hyprland.settings = { animations = { enabled = true; diff --git a/modules/home/hyprland/binds.nix b/modules/home/hyprland/binds.nix index 5d8491f..646951d 100644 --- a/modules/home/hyprland/binds.nix +++ b/modules/home/hyprland/binds.nix @@ -1,7 +1,6 @@ -{host, ...}: let - vars = import ../../../hosts/${host}/variables.nix; +{zaneyos, ...}: let inherit - (vars) + (zaneyos) barChoice browser terminal @@ -10,18 +9,17 @@ noctaliaBind = if barChoice == "noctalia" then [ - "$modifier,D, Noctalia Launcher, exec, noctalia-shell ipc call launcher toggle" + "$modifier,D, Noctalia Launcher, exec, noctalia-shell ipc call launcher toggle" "$modifier SHIFT,Return, Noctalia Launcher, exec, noctalia-shell ipc call launcher toggle" - "$modifier,M, Noctalia Notifications, exec, noctalia-shell ipc call notifications toggleHistory" + "$modifier,M, Noctalia Notifications, exec, noctalia-shell ipc call notifications toggleHistory" "$modifier,V, Noctalia Clipboard, exec, noctalia-shell ipc call launcher clipboard" - "$modifier ALT,P, Noctalia Settings, exec, noctalia-shell ipc call settings toggle" - "$modifier SHIFT,comma, Noctalia Settings, exec, noctalia-shell ipc call settings toggle" + "$modifier ALT,P, Noctalia Settings, exec, noctalia-shell ipc call settings toggle" + "$modifier SHIFT,comma, Noctalia Settings, exec, noctalia-shell ipc call settings toggle" "$modifier CTRL,L, Noctalia Lock Screen, exec, noctalia-shell ipc call sessionMenu lockscreen lock" - "$modifier SHIFT,W, Noctalia Wallpaper, exec, noctalia-shell ipc call wallpaper toggle" + "$modifier SHIFT,W, Noctalia Wallpaper, exec, noctalia-shell ipc call wallpaper toggle" "$modifier,X, Noctalia Power Menu, exec, noctalia-shell ipc call sessionMenu toggle" "$modifier,C, Noctalia Control Center, exec, noctalia-shell ipc call controlCenter toggle" "$modifier CTRL,R, Noctalia Screen Recorder, exec, noctalia-shell ipc call screenRecorder toggle" - "$modifier SHIFT,R, Restart Noctalia shell, exec, restart.noctalia" ] else []; # Rofi launcher bindings (only included when barChoice != "noctalia") @@ -70,7 +68,7 @@ in { "$modifier,O, OBS Studio, exec, obs" "$modifier ALT,C, Color Picker, exec, hyprpicker -a" "$modifier,G, GIMP, exec, gimp" - "$modifier SHIFT,T, Dropdown Terminal, exec, sh -lc 'DropTerminal'" + "$modifier shift,T, Dropdown Terminal, exec, sh -lc 'DropTerminal \${TERM:-kitty}'" "$modifier,T, Thunar, exec, thunar" "$modifier ALT,M, Audio Control, exec, pavucontrol" # ============= WINDOW MANAGEMENT ============= diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix index 0e41181..aead275 100644 --- a/modules/home/hyprland/default.nix +++ b/modules/home/hyprland/default.nix @@ -1,5 +1,5 @@ -{host, ...}: let - inherit (import ../../../hosts/${host}/variables.nix) animChoice; +{zaneyos, ...}: let + inherit (zaneyos) animChoice; in { imports = [ animChoice diff --git a/modules/home/hyprland/exec-once.nix b/modules/home/hyprland/exec-once.nix index edb5f50..f4ff7df 100644 --- a/modules/home/hyprland/exec-once.nix +++ b/modules/home/hyprland/exec-once.nix @@ -1,10 +1,5 @@ -{host, ...}: let - vars = import ../../../hosts/${host}/variables.nix; - inherit - (vars) - barChoice - stylixImage - ; +{zaneyos, ...}: let + inherit (zaneyos) barChoice stylixImage; # Noctalia-specific startup commands noctaliaExec = if barChoice == "noctalia" diff --git a/modules/home/hyprland/hyprland.nix b/modules/home/hyprland/hyprland.nix index 635c6c7..36a9208 100644 --- a/modules/home/hyprland/hyprland.nix +++ b/modules/home/hyprland/hyprland.nix @@ -1,15 +1,13 @@ { - host, + zaneyos, config, pkgs, lib, ... }: let - vars = import ../../../hosts/${host}/variables.nix; - extraMonitorSettings = vars.extraMonitorSettings or ""; - keyboardLayout = vars.keyboardLayout or "us"; - keyboardVariant = vars.keyboardVariant or ""; - stylixImage = vars.stylixImage or null; + inherit (zaneyos) extraMonitorSettings; + keyboardLayout = zaneyos.keyboardLayout; + keyboardVariant = zaneyos.keyboardVariant; # Treat only known US-based variants as implying layout = "us". usVariants = ["dvorak" "colemak" "workman" "intl" "us-intl" "altgr-intl"]; @@ -44,6 +42,7 @@ hyprKbVariant = variantFinal; in { home.packages = with pkgs; [ + awww grim slurp wl-clipboard @@ -108,17 +107,8 @@ in { workspace_swipe_create_new = true; workspace_swipe_forever = true; }; + "$modifier" = "SUPER"; - - scrolling = { - column_width = 0.80; - fullscreen_on_one_column = true; - direction = "right"; - follow_focus = true; - }; - - monocle = {}; - general = { layout = "dwindle"; gaps_in = 6; @@ -137,7 +127,7 @@ in { disable_hyprland_logo = true; disable_splash_rendering = true; enable_swallow = false; - # vfr = true; # Variable Frame Rate Not supported post v0.54.3 + # vfr = true; # Variable Frame Rate not supported post v0.54.3 vrr = 2; # Variable Refresh Rate Might need to set to 0 for NVIDIA/AQ_DRM_DEVICES # Screen flashing to black momentarily or going black when app is fullscreen # Try setting vrr to 0 @@ -209,6 +199,15 @@ in { always_keep_position = false; }; + scrolling = { + column_width = 0.80; + fullscreen_on_one_column = true; + direction = "right"; + follow_focus = true; + }; + + monocle = {}; + # Ensure Xwayland windows render at integer scale; compositor scales them xwayland = { force_zero_scaling = true; diff --git a/modules/home/install-zaneyos.sh b/modules/home/install-zaneyos.sh index cf88a04..0d0dd04 100755 --- a/modules/home/install-zaneyos.sh +++ b/modules/home/install-zaneyos.sh @@ -69,6 +69,14 @@ if ! command -v lspci &> /dev/null; then exit 1 fi +# Check for python3 (required for helper scripts) +if ! command -v python3 &> /dev/null; then + print_error "python3 is not installed." + echo -e "Please install python3, then re-run the install script." + echo -e "Example: nix-shell -p python3" + exit 1 +fi + if [ -n "$(grep -i nixos < /etc/os-release)" ]; then echo -e "${GREEN}Verified this is NixOS.${NC}" else @@ -101,19 +109,44 @@ has_nvidia=false has_intel=false has_amd=false has_vm=false +detect_vm() { + if command -v systemd-detect-virt &>/dev/null; then + if systemd-detect-virt --quiet; then + return 0 + fi + fi + for f in /sys/class/dmi/id/product_name /sys/class/dmi/id/sys_vendor; do + if [ -r "$f" ] && grep -Eqi 'qemu|kvm|vmware|virtualbox|hyper-v|microsoft corporation|xen|parallels' "$f"; then + return 0 + fi + done + return 1 +} + +if detect_vm; then + has_vm=true +fi if lspci | grep -qi 'vga\|3d\|display'; then while read -r line; do - if echo "$line" | grep -qi 'nvidia'; then + if echo "$line" | grep -Eq '\[10de:'; then + has_nvidia=true + elif echo "$line" | grep -Eq '\[1002:'; then + has_amd=true + elif echo "$line" | grep -Eq '\[8086:'; then + has_intel=true + elif echo "$line" | grep -Eq '\[(1af4|15ad|80ee|1b36|1414|1234|1013):'; then + has_vm=true + elif echo "$line" | grep -qi 'nvidia'; then has_nvidia=true elif echo "$line" | grep -qi 'amd\|ati\|advanced micro devices'; then has_amd=true elif echo "$line" | grep -qi 'intel'; then has_intel=true - elif echo "$line" | grep -qi 'virtio\|vmware'; then + elif echo "$line" | grep -Eqi 'virtio|vmware|virtualbox|qxl|hyper-v|microsoft corporation|parallels|qemu|bochs|cirrus|svga|virtual'; then has_vm=true fi - done < <(lspci | grep -i 'vga\|3d\|display') + done < <(lspci -nn | grep -i 'vga\|3d\|display') if $has_vm; then DETECTED_PROFILE="vm" @@ -172,9 +205,10 @@ else echo -e "${GREEN}I hope you find your time here enjoyable!${NC}" fi -print_header "Cloning zaneyos Repository" -git clone https://gitlab.com/dwilliam62/zaneyos.git --depth=1 ~/zaneyos -cd ~/zaneyos || exit 1 +# Use the repository where this script lives; no extra git clone needed +REPO_DIR="$(cd "$(dirname "$0")/../.." && pwd)" +print_header "Using local ZaneyOS repository at: $REPO_DIR" +cd "$REPO_DIR" || exit 1 print_header "Configuring Host and Profile" mkdir -p hosts/"$hostName" diff --git a/modules/home/noctalia.nix b/modules/home/noctalia.nix index bd98c3c..1e62c18 100644 --- a/modules/home/noctalia.nix +++ b/modules/home/noctalia.nix @@ -21,6 +21,7 @@ in { SRC="${configDir}" if [ ! -d "$DEST" ]; then + $DRY_RUN_CMD rm -rf "$DEST" $DRY_RUN_CMD mkdir -p "$HOME/.config/quickshell" $DRY_RUN_CMD cp -R "$SRC" "$DEST" $DRY_RUN_CMD chmod -R u+rwX "$DEST" diff --git a/modules/home/obs-studio.nix b/modules/home/obs-studio.nix index 05d8469..5aacdec 100644 --- a/modules/home/obs-studio.nix +++ b/modules/home/obs-studio.nix @@ -1,6 +1,10 @@ -{pkgs, ...}: { +{ + pkgs, + zaneyos, + ... +}: { programs.obs-studio = { - enable = true; + enable = zaneyos.obsStudioEnable; #enableVirtualCamera = true; plugins = with pkgs.obs-studio-plugins; [ wlrobs diff --git a/modules/home/scripts/DropTerminal.nix b/modules/home/scripts/DropTerminal.nix index cbc14d1..7ec5b49 100644 --- a/modules/home/scripts/DropTerminal.nix +++ b/modules/home/scripts/DropTerminal.nix @@ -56,7 +56,7 @@ pkgs.writeShellScriptBin "DropTerminal" '' # Debug echo function debug_echo() { if [ "$DEBUG" = true ]; then - echo "$@" >&2 + echo "$@" fi } @@ -95,11 +95,6 @@ pkgs.writeShellScriptBin "DropTerminal" '' local target_y="$3" local width="$4" local height="$5" - if ! [[ "$target_x" =~ ^-?[0-9]+$ ]] || ! [[ "$target_y" =~ ^-?[0-9]+$ ]] || \ - ! [[ "$width" =~ ^[0-9]+$ ]] || ! [[ "$height" =~ ^[0-9]+$ ]]; then - debug_echo "Invalid geometry for slide down; skipping animation" - return 1 - fi debug_echo "Animating slide down for window $addr to position $target_x,$target_y" @@ -131,11 +126,6 @@ pkgs.writeShellScriptBin "DropTerminal" '' local start_y="$3" local width="$4" local height="$5" - if ! [[ "$start_x" =~ ^-?[0-9]+$ ]] || ! [[ "$start_y" =~ ^-?[0-9]+$ ]] || \ - ! [[ "$width" =~ ^[0-9]+$ ]] || ! [[ "$height" =~ ^[0-9]+$ ]]; then - debug_echo "Invalid geometry for slide up; skipping animation" - return 1 - fi debug_echo "Animating slide up for window $addr from position $start_x,$start_y" @@ -181,13 +171,6 @@ pkgs.writeShellScriptBin "DropTerminal" '' local mon_height=$(echo $monitor_info | cut -d' ' -f4) local mon_scale=$(echo $monitor_info | cut -d' ' -f5) local mon_name=$(echo $monitor_info | cut -d' ' -f6) - # Ensure geometry values are numeric; Hyprland can emit non-JSON status lines during startup - if ! [[ "$mon_x" =~ ^-?[0-9]+$ ]] || ! [[ "$mon_y" =~ ^-?[0-9]+$ ]] || \ - ! [[ "$mon_width" =~ ^[0-9]+$ ]] || ! [[ "$mon_height" =~ ^[0-9]+$ ]]; then - debug_echo "Error: Non-numeric monitor geometry; using fallback values" - echo "100 100 800 600 fallback-monitor" - return 1 - fi debug_echo "Monitor info: x=$mon_x, y=$mon_y, width=$mon_width, height=$mon_height, scale=$mon_scale" @@ -295,17 +278,12 @@ pkgs.writeShellScriptBin "DropTerminal" '' if [ $? -ne 0 ]; then debug_echo "Warning: Using fallback positioning" fi - local target_x target_y width height monitor_name - read -r target_x target_y width height monitor_name <<<"$pos_info" - if ! [[ "$target_x" =~ ^-?[0-9]+$ ]] || ! [[ "$target_y" =~ ^-?[0-9]+$ ]] || \ - ! [[ "$width" =~ ^[0-9]+$ ]] || ! [[ "$height" =~ ^[0-9]+$ ]]; then - debug_echo "Invalid position parsed; using fallback values" - target_x=100 - target_y=100 - width=800 - height=600 - monitor_name="fallback-monitor" - fi + + local target_x=$(echo $pos_info | cut -d' ' -f1) + local target_y=$(echo $pos_info | cut -d' ' -f2) + local width=$(echo $pos_info | cut -d' ' -f3) + local height=$(echo $pos_info | cut -d' ' -f4) + local monitor_name=$(echo $pos_info | cut -d' ' -f5) debug_echo "Target position: ''${target_x},''${target_y}, size: ''${width}x''${height}" @@ -366,16 +344,11 @@ pkgs.writeShellScriptBin "DropTerminal" '' debug_echo "Monitor focus changed: moving dropdown to $focused_monitor" # Calculate new position for focused monitor pos_info=$(calculate_dropdown_position) - read -r target_x target_y width height monitor_name <<<"$pos_info" - if ! [[ "$target_x" =~ ^-?[0-9]+$ ]] || ! [[ "$target_y" =~ ^-?[0-9]+$ ]] || \ - ! [[ "$width" =~ ^[0-9]+$ ]] || ! [[ "$height" =~ ^[0-9]+$ ]]; then - debug_echo "Invalid position parsed; using fallback values" - target_x=100 - target_y=100 - width=800 - height=600 - monitor_name="fallback-monitor" - fi + target_x=$(echo $pos_info | cut -d' ' -f1) + target_y=$(echo $pos_info | cut -d' ' -f2) + width=$(echo $pos_info | cut -d' ' -f3) + height=$(echo $pos_info | cut -d' ' -f4) + monitor_name=$(echo $pos_info | cut -d' ' -f5) # Move and resize window hyprctl dispatch movewindowpixel "exact $target_x $target_y,address:$TERMINAL_ADDR" hyprctl dispatch resizewindowpixel "exact $width $height,address:$TERMINAL_ADDR" @@ -388,15 +361,10 @@ pkgs.writeShellScriptBin "DropTerminal" '' # Calculate target position pos_info=$(calculate_dropdown_position) - read -r target_x target_y width height monitor_name <<<"$pos_info" - if ! [[ "$target_x" =~ ^-?[0-9]+$ ]] || ! [[ "$target_y" =~ ^-?[0-9]+$ ]] || \ - ! [[ "$width" =~ ^[0-9]+$ ]] || ! [[ "$height" =~ ^[0-9]+$ ]]; then - debug_echo "Invalid position parsed; using fallback values" - target_x=100 - target_y=100 - width=800 - height=600 - fi + target_x=$(echo $pos_info | cut -d' ' -f1) + target_y=$(echo $pos_info | cut -d' ' -f2) + width=$(echo $pos_info | cut -d' ' -f3) + height=$(echo $pos_info | cut -d' ' -f4) # Use movetoworkspacesilent to avoid affecting workspace history hyprctl dispatch movetoworkspacesilent "$CURRENT_WS,address:$TERMINAL_ADDR" diff --git a/modules/home/scripts/default.nix b/modules/home/scripts/default.nix index 4874006..04b55d4 100644 --- a/modules/home/scripts/default.nix +++ b/modules/home/scripts/default.nix @@ -1,9 +1,9 @@ { config, - pkgs, inputs, + pkgs, username, - profile, + zaneyos, ... }: { home.packages = [ @@ -19,9 +19,15 @@ (import ./squirtle.nix {inherit pkgs;}) (import ./task-waybar.nix {inherit pkgs;}) (import ./DropTerminal.nix {inherit pkgs;}) + # Fastfetch wrappers + (import ./ff.nix {inherit pkgs;}) + (import ./ff1.nix {inherit pkgs;}) + (import ./ff2.nix {inherit pkgs;}) + (import ./ff3.nix {inherit pkgs;}) + (import ./ff4.nix {inherit pkgs;}) + (import ./ff5.nix {inherit pkgs;}) (import ./wallsetter.nix { - inherit pkgs inputs; - inherit username; + inherit inputs pkgs username; }) (import ./web-search.nix {inherit pkgs;}) # Cheatsheets viewer + parser @@ -33,8 +39,8 @@ (import ./qs-vid-wallpapers-apply.nix {inherit pkgs;}) (import ./qs-vid-wallpapers-watchdog.nix {inherit pkgs;}) (import ./qs-wallpapers.nix {inherit pkgs;}) - (import ./qs-wallpapers-apply.nix {inherit pkgs inputs;}) - (import ./qs-wallpapers-restore.nix {inherit pkgs inputs;}) + (import ./qs-wallpapers-apply.nix {inherit inputs pkgs;}) + (import ./qs-wallpapers-restore.nix {inherit inputs pkgs;}) (import ./qs-wlogout.nix {inherit pkgs;}) (import ./qs-docs.nix {inherit pkgs;}) (import ./docs-parser.nix {inherit pkgs;}) @@ -42,9 +48,9 @@ (import ./hyprland-change-layout.nix {inherit pkgs;}) (import ./launch-nwg-menu.nix {inherit pkgs;}) (import ./hyprland-dock.nix {inherit pkgs;}) - (import ./restart.noctalia.nix {inherit pkgs;}) (import ./zcli.nix { - inherit pkgs profile; + inherit pkgs; + inherit zaneyos; backupFiles = [ ".config/mimeapps.list.backup" ]; diff --git a/modules/home/scripts/ff.nix b/modules/home/scripts/ff.nix new file mode 100644 index 0000000..6696cf4 --- /dev/null +++ b/modules/home/scripts/ff.nix @@ -0,0 +1,37 @@ +{pkgs}: +pkgs.writeTextFile { + name = "ff"; + executable = true; + destination = "/bin/ff"; + text = '' + #!${pkgs.bash}/bin/bash + set -euo pipefail + + cfg="$HOME/.config/fastfetch/fastfetch-system-times.config.jsonc" + + parent_pid=$PPID + parent_name="" + if [[ -r "/proc/$parent_pid/comm" ]]; then + parent_name="$(tr -d '\0' < "/proc/$parent_pid/comm")" + else + parent_name="$(ps -o comm= -p "$parent_pid" 2>/dev/null || true)" + fi + if [[ -z "$parent_name" && -n "${SHELL:-}" ]]; then + parent_name="$(basename -- "$SHELL")" + fi + + case "$parent_name" in + *zsh*) shell="${pkgs.zsh}/bin/zsh" ;; + *bash*) shell="${pkgs.bash}/bin/bash" ;; + *fish*) shell="${pkgs.fish}/bin/fish" ;; + *nu*|*nushell*) shell="${pkgs.nushell}/bin/nu" ;; + *) shell="$(command -v "$parent_name" 2>/dev/null || true)" ;; + esac + + if [[ -z "${shell:-}" ]]; then + shell="${pkgs.zsh}/bin/zsh" + fi + + exec "$shell" -c "fastfetch -c \"$cfg\"" + ''; +} diff --git a/modules/home/scripts/ff1.nix b/modules/home/scripts/ff1.nix new file mode 100644 index 0000000..5381efe --- /dev/null +++ b/modules/home/scripts/ff1.nix @@ -0,0 +1,37 @@ +{pkgs}: +pkgs.writeTextFile { + name = "ff1"; + executable = true; + destination = "/bin/ff1"; + text = '' + #!${pkgs.bash}/bin/bash + set -euo pipefail + + cfg="$HOME/.config/fastfetch/fastfetch1.config.jsonc" + + parent_pid=$PPID + parent_name="" + if [[ -r "/proc/$parent_pid/comm" ]]; then + parent_name="$(tr -d '\0' < "/proc/$parent_pid/comm")" + else + parent_name="$(ps -o comm= -p "$parent_pid" 2>/dev/null || true)" + fi + if [[ -z "$parent_name" && -n "${SHELL:-}" ]]; then + parent_name="$(basename -- "$SHELL")" + fi + + case "$parent_name" in + *zsh*) shell="${pkgs.zsh}/bin/zsh" ;; + *bash*) shell="${pkgs.bash}/bin/bash" ;; + *fish*) shell="${pkgs.fish}/bin/fish" ;; + *nu*|*nushell*) shell="${pkgs.nushell}/bin/nu" ;; + *) shell="$(command -v "$parent_name" 2>/dev/null || true)" ;; + esac + + if [[ -z "${shell:-}" ]]; then + shell="${pkgs.zsh}/bin/zsh" + fi + + exec "$shell" -c "fastfetch -c \"$cfg\"" + ''; +} diff --git a/modules/home/scripts/ff2.nix b/modules/home/scripts/ff2.nix new file mode 100644 index 0000000..5e0fdb9 --- /dev/null +++ b/modules/home/scripts/ff2.nix @@ -0,0 +1,37 @@ +{pkgs}: +pkgs.writeTextFile { + name = "ff2"; + executable = true; + destination = "/bin/ff2"; + text = '' + #!${pkgs.bash}/bin/bash + set -euo pipefail + + cfg="$HOME/.config/fastfetch/fastfetch2.config.jsonc" + + parent_pid=$PPID + parent_name="" + if [[ -r "/proc/$parent_pid/comm" ]]; then + parent_name="$(tr -d '\0' < "/proc/$parent_pid/comm")" + else + parent_name="$(ps -o comm= -p "$parent_pid" 2>/dev/null || true)" + fi + if [[ -z "$parent_name" && -n "${SHELL:-}" ]]; then + parent_name="$(basename -- "$SHELL")" + fi + + case "$parent_name" in + *zsh*) shell="${pkgs.zsh}/bin/zsh" ;; + *bash*) shell="${pkgs.bash}/bin/bash" ;; + *fish*) shell="${pkgs.fish}/bin/fish" ;; + *nu*|*nushell*) shell="${pkgs.nushell}/bin/nu" ;; + *) shell="$(command -v "$parent_name" 2>/dev/null || true)" ;; + esac + + if [[ -z "${shell:-}" ]]; then + shell="${pkgs.zsh}/bin/zsh" + fi + + exec "$shell" -c "fastfetch -c \"$cfg\"" + ''; +} diff --git a/modules/home/scripts/ff3.nix b/modules/home/scripts/ff3.nix new file mode 100644 index 0000000..14c79c5 --- /dev/null +++ b/modules/home/scripts/ff3.nix @@ -0,0 +1,37 @@ +{pkgs}: +pkgs.writeTextFile { + name = "ff3"; + executable = true; + destination = "/bin/ff3"; + text = '' + #!${pkgs.bash}/bin/bash + set -euo pipefail + + cfg="$HOME/.config/fastfetch/fastfetch3.config.jsonc" + + parent_pid=$PPID + parent_name="" + if [[ -r "/proc/$parent_pid/comm" ]]; then + parent_name="$(tr -d '\0' < "/proc/$parent_pid/comm")" + else + parent_name="$(ps -o comm= -p "$parent_pid" 2>/dev/null || true)" + fi + if [[ -z "$parent_name" && -n "''${SHELL:-}" ]]; then + parent_name="$(basename -- "$SHELL")" + fi + + case "$parent_name" in + *zsh*) shell="${pkgs.zsh}/bin/zsh" ;; + *bash*) shell="${pkgs.bash}/bin/bash" ;; + *fish*) shell="${pkgs.fish}/bin/fish" ;; + *nu*|*nushell*) shell="${pkgs.nushell}/bin/nu" ;; + *) shell="$(command -v "$parent_name" 2>/dev/null || true)" ;; + esac + + if [[ -z "''${shell:-}" ]]; then + shell="${pkgs.zsh}/bin/zsh" + fi + + exec "$shell" -c "fastfetch -c \"$cfg\"" + ''; +} diff --git a/modules/home/scripts/ff4.nix b/modules/home/scripts/ff4.nix new file mode 100644 index 0000000..921430b --- /dev/null +++ b/modules/home/scripts/ff4.nix @@ -0,0 +1,37 @@ +{pkgs}: +pkgs.writeTextFile { + name = "ff4"; + executable = true; + destination = "/bin/ff4"; + text = '' + #!${pkgs.bash}/bin/bash + set -euo pipefail + + cfg="$HOME/.config/fastfetch/fastfetch4.config.jsonc" + + parent_pid=$PPID + parent_name="" + if [[ -r "/proc/$parent_pid/comm" ]]; then + parent_name="$(tr -d '\0' < "/proc/$parent_pid/comm")" + else + parent_name="$(ps -o comm= -p "$parent_pid" 2>/dev/null || true)" + fi + if [[ -z "$parent_name" && -n "''${SHELL:-}" ]]; then + parent_name="$(basename -- "$SHELL")" + fi + + case "$parent_name" in + *zsh*) shell="${pkgs.zsh}/bin/zsh" ;; + *bash*) shell="${pkgs.bash}/bin/bash" ;; + *fish*) shell="${pkgs.fish}/bin/fish" ;; + *nu*|*nushell*) shell="${pkgs.nushell}/bin/nu" ;; + *) shell="$(command -v "$parent_name" 2>/dev/null || true)" ;; + esac + + if [[ -z "''${shell:-}" ]]; then + shell="${pkgs.zsh}/bin/zsh" + fi + + exec "$shell" -c "fastfetch -c \"$cfg\"" + ''; +} diff --git a/modules/home/scripts/ff5.nix b/modules/home/scripts/ff5.nix new file mode 100644 index 0000000..b6f61c1 --- /dev/null +++ b/modules/home/scripts/ff5.nix @@ -0,0 +1,37 @@ +{pkgs}: +pkgs.writeTextFile { + name = "ff5"; + executable = true; + destination = "/bin/ff5"; + text = '' + #!${pkgs.bash}/bin/bash + set -euo pipefail + + cfg="$HOME/.config/fastfetch/fastfetch5.config.jsonc" + + parent_pid=$PPID + parent_name="" + if [[ -r "/proc/$parent_pid/comm" ]]; then + parent_name="$(tr -d '\\0' < "/proc/$parent_pid/comm")" + else + parent_name="$(ps -o comm= -p "$parent_pid" 2>/dev/null || true)" + fi + if [[ -z "$parent_name" && -n "''${SHELL:-}" ]]; then + parent_name="$(basename -- "$SHELL")" + fi + + case "$parent_name" in + *zsh*) shell="${pkgs.zsh}/bin/zsh" ;; + *bash*) shell="${pkgs.bash}/bin/bash" ;; + *fish*) shell="${pkgs.fish}/bin/fish" ;; + *nu*|*nushell*) shell="${pkgs.nushell}/bin/nu" ;; + *) shell="$(command -v "$parent_name" 2>/dev/null || true)" ;; + esac + + if [[ -z "''${shell:-}" ]]; then + shell="${pkgs.zsh}/bin/zsh" + fi + + exec "$shell" -c "fastfetch -c \"$cfg\"" + ''; +} diff --git a/modules/home/scripts/hyprland-dock.nix b/modules/home/scripts/hyprland-dock.nix index 60b4c9e..b287b78 100644 --- a/modules/home/scripts/hyprland-dock.nix +++ b/modules/home/scripts/hyprland-dock.nix @@ -18,9 +18,8 @@ pkgs.writeShellScriptBin "dock" '' MENU="nwg-drawer -mb 100 -mt 100 -ml 300 -mr 300" # Masked apps won't show in DOCK. - # I am running pyprland scratchpads - # They don't show up correctly so I mask it off - MASK_APPS="kitty-dropterm" + # Dropdown terminal doesn't show correctly in the dock, so mask it off + MASK_APPS="dropterminal" ICON_SIZE=32 MARGIN_BOTTOM=10 diff --git a/modules/home/scripts/restart.noctalia b/modules/home/scripts/restart.noctalia deleted file mode 100644 index 747c18a..0000000 --- a/modules/home/scripts/restart.noctalia +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Restart the Noctalia QuickShell session by terminating only the noctalia-shell -# processes, avoiding any signals to unrelated process groups (e.g. Hyprland). - -log() { printf "[restart.noctalia] %s\n" "$*"; } - -list_target_pids() { - # Collect only PIDs whose command explicitly runs noctalia-shell - # - direct wrapper: ".../noctalia-shell" - # - quickshell/qs with "-c noctalia-shell" - ps -eo pid=,cmd= \ - | ${GREP:-grep} -E "(^|/)(noctalia-shell)( |$)|(^| )((qs|quickshell))( | ).*-c( |=)?noctalia-shell( |$)" \ - | awk '{print $1}' -} - -terminate_targets() { - local pids left tries - mapfile -t pids < <(list_target_pids || true) - - if ((${#pids[@]} > 0)); then - kill -TERM "${pids[@]}" 2>/dev/null || true - fi - - # Wait up to ~3s for clean exit - for tries in {1..15}; do - mapfile -t left < <(list_target_pids || true) - ((${#left[@]} == 0)) && break - sleep 0.2 - done - - # Force kill leftovers only (do not touch anything else) - if ((${#left[@]} > 0)); then - kill -KILL "${left[@]}" 2>/dev/null || true - fi -} - -start_noctalia() { - # Prefer the noctalia-shell wrapper to ensure proper env and runtime flags - if command -v noctalia-shell >/dev/null 2>&1; then - nohup setsid noctalia-shell >/dev/null 2>&1 & - elif command -v quickshell >/dev/null 2>&1; then - nohup setsid quickshell -c noctalia-shell >/dev/null 2>&1 & - elif command -v qs >/dev/null 2>&1; then - nohup setsid qs -c noctalia-shell >/dev/null 2>&1 & - else - echo "Error: noctalia-shell/quickshell/qs not found in PATH" >&2 - exit 1 - fi -} - -terminate_targets -start_noctalia diff --git a/modules/home/scripts/restart.noctalia.nix b/modules/home/scripts/restart.noctalia.nix deleted file mode 100644 index d229149..0000000 --- a/modules/home/scripts/restart.noctalia.nix +++ /dev/null @@ -1,24 +0,0 @@ -{pkgs, ...}: let - binPath = pkgs.lib.makeBinPath [ - pkgs.coreutils - pkgs.procps - pkgs.psmisc - pkgs.gnugrep - pkgs.findutils - pkgs.util-linux - pkgs.bash - ]; - script = builtins.readFile ./restart.noctalia; -in - pkgs.writeShellScriptBin "restart.noctalia" '' - set -euo pipefail - export PATH=${binPath}:$PATH - - tmp_script=$(mktemp) - trap 'rm -f "$tmp_script"' EXIT - cat > "$tmp_script" <<'BASH_EOF' - ${script} - BASH_EOF - chmod +x "$tmp_script" - exec ${pkgs.bash}/bin/bash "$tmp_script" "$@" - '' diff --git a/modules/home/scripts/zcli.nix b/modules/home/scripts/zcli.nix index 05eae32..aa52031 100644 --- a/modules/home/scripts/zcli.nix +++ b/modules/home/scripts/zcli.nix @@ -1,6 +1,6 @@ { + zaneyos, pkgs, - profile, backupFiles ? [".config/mimeapps.list.backup"], ... }: let @@ -90,7 +90,7 @@ in # Purpose: NixOS system management utility for ZaneyOS distribution # Author: Don Williams (ddubs) & Zaney # Start Date: June 7th, 2025 - # Version: 1.0.2 + # Version: 1.0.3 # # Architecture: # - Nix-generated shell script using writeShellScriptBin @@ -129,55 +129,29 @@ in # --- Configuration --- - PROJECT="zaneyos" #ddubos or zaneyos - PROFILE_DEFAULT="${profile}" + PROJECT="zaneyos" # ddubos or zaneyos + VERSION="1.0.3" BACKUP_FILES_STR="${backupFilesString}" - VERSION="1.0.2" - FLAKE_NIX_PATH="$HOME/$PROJECT/flake.nix" + FLAKE_DIR="$HOME/$PROJECT" + FLAKE_NIX_PATH="$FLAKE_DIR/flake.nix" read -r -a BACKUP_FILES <<< "$BACKUP_FILES_STR" # --- Helper Functions --- - get_flake_profile() { - local flake_profile="" - if [ -f "$FLAKE_NIX_PATH" ]; then - flake_profile=$(${pkgs.gnugrep}/bin/grep -E '^[[:space:]]*profile[[:space:]]*=' "$FLAKE_NIX_PATH" | ${pkgs.gnused}/bin/sed 's/.*=[[:space:]]*"\([^"]*\)".*/\1/') - fi - echo "$flake_profile" - } verify_hostname() { local current_hostname - local flake_hostname + current_hostname="$(${pkgs.nettools}/bin/hostname)" - current_hostname="$(hostname)" - - # Extract the host value from flake.nix - if [ -f "$FLAKE_NIX_PATH" ]; then - flake_hostname=$(${pkgs.gnugrep}/bin/grep -E '^[[:space:]]*host[[:space:]]*=' "$FLAKE_NIX_PATH" | ${pkgs.gnused}/bin/sed 's/.*=[[:space:]]*"\([^"]*\)".*/\1/') - - if [ -z "$flake_hostname" ]; then - echo "Error: Could not find 'host' variable in $FLAKE_NIX_PATH" >&2 - exit 1 - fi - - if [ "$current_hostname" != "$flake_hostname" ]; then - echo "Error: Hostname mismatch!" >&2 - echo " Current hostname: '$current_hostname'" >&2 - echo " Flake.nix host: '$flake_hostname'" >&2 - echo "" >&2 - echo "Hint: Run 'zcli update-host' to automatically update flake.nix" >&2 - echo " or manually edit $FLAKE_NIX_PATH" >&2 - exit 1 - fi - else + if [ ! -f "$FLAKE_NIX_PATH" ]; then echo "Error: Flake.nix not found at $FLAKE_NIX_PATH" >&2 exit 1 fi - # Also check if host folder exists - local folder="$HOME/$PROJECT/hosts/$current_hostname" + # Check if a matching host folder exists under hosts/ + local folder="$FLAKE_DIR/hosts/$current_hostname" if [ ! -d "$folder" ]; then - echo "Error: Matching host not found in $PROJECT, Missing folder: $folder" >&2 + echo "Error: Matching host not found in $PROJECT. Missing: $folder" >&2 + echo "Hint: Run 'zcli update-host' to create it (copies hosts/default) or run 'zcli update-host $current_hostname '." >&2 exit 1 fi } @@ -188,31 +162,40 @@ in echo "Usage: zcli [command] [options]" echo "" echo "Commands:" - echo " cleanup - Clean up old system generations. Can specify a number to keep." - echo " diag - Create a system diagnostic report." - echo " (Filename: homedir/diag.txt)" - echo " list-gens - List user and system generations." - echo " rebuild - Rebuild the NixOS system configuration." - echo " rebuild-boot - Rebuild and set as boot default (activates on next restart)." - echo " trim - Trim filesystems to improve SSD performance." - echo " update - Update the flake and rebuild the system." - echo " update-host - Auto set host and profile in flake.nix." - echo " (Opt: zcli update-host [hostname] [profile])" + echo " Host management:" + echo " add-host - Create host from template and add to flake.nix hosts list." + echo " (Opt: zcli add-host [hostname] [profile])" + echo " del-host - Remove host directory and prune from flake.nix hosts list." + echo " (Usage: zcli del-host [hostname])" + echo " list-hosts - Show current hosts from flake.nix (prints the hosts array)." + echo " update-host - Auto set host and profile in flake.nix." + echo " (Opt: zcli update-host [hostname] [profile])" + echo "" + echo " Build and updates:" + echo " rebuild - Rebuild the NixOS system configuration." + echo " rebuild-boot - Rebuild and set as boot default (activates on next restart)." + echo " update - Update the flake and rebuild the system." + echo "" + echo " Maintenance:" + echo " cleanup - Clean up old system generations. Can specify a number to keep." + echo " diag - Create a system diagnostic report (saved to ~/diag.txt)." + echo " list-gens - List user and system generations." + echo " trim - Trim filesystems to improve SSD performance." + echo "" + echo " Doom Emacs:" + echo " doom install - Install Doom Emacs using get-doom script." + echo " doom status - Check if Doom Emacs is installed." + echo " doom remove - Remove Doom Emacs installation." + echo " doom update - Update Doom Emacs (runs doom sync)." echo "" echo "Options for rebuild, rebuild-boot, and update commands:" - echo " --dry, -n - Show what would be done without doing it" - echo " --ask, -a - Ask for confirmation before proceeding" - echo " --cores N - Limit build to N cores (useful for VMs)" - echo " --verbose, -v - Show verbose output" - echo " --no-nom - Don't use nix-output-monitor" + echo " --dry, -n - Show what would be done without doing it" + echo " --ask, -a - Ask for confirmation before proceeding" + echo " --cores N - Limit build to N cores (useful for VMs)" + echo " --verbose, -v - Show verbose output" + echo " --no-nom - Don't use nix-output-monitor" echo "" - echo "Doom Emacs:" - echo " doom install - Install Doom Emacs using get-doom script." - echo " doom status - Check if Doom Emacs is installed." - echo " doom remove - Remove Doom Emacs installation." - echo " doom update - Update Doom Emacs (runs doom sync)." - echo "" - echo " help - Show this help message." + echo " help - Show this help message." } handle_backups() { @@ -244,7 +227,7 @@ in fi if ${pkgs.pciutils}/bin/lspci &> /dev/null; then # Check if lspci is available - if ${pkgs.pciutils}/bin/lspci -nn | ${pkgs.gnugrep}/bin/grep -qi 'vga\|3d\|display'; then + if ${pkgs.pciutils}/bin/lspci | ${pkgs.gnugrep}/bin/grep -qi 'vga\|3d\|display'; then while read -r line; do if echo "$line" | ${pkgs.gnugrep}/bin/grep -Eq '\[10de:'; then has_nvidia=true @@ -355,11 +338,42 @@ in echo "$args_string" } + # Resolve the nixosConfigurations target name for nh + get_nh_target() { + local current_hostname + current_hostname="$(${pkgs.nettools}/bin/hostname)" + if [ -d "$FLAKE_DIR/hosts/$current_hostname" ]; then + echo "$current_hostname" + elif [ -d "$FLAKE_DIR/hosts/default" ]; then + echo "default" + else + echo "" + fi + } + + # --- flake.nix host list helpers --- + hosts_block() { + ${pkgs.gnused}/bin/sed -n '/^\s*hosts\s*=\s*\[/,/\];/p' "$FLAKE_NIX_PATH" + } + + list_hosts_from_flake() { + hosts_block | ${pkgs.gnugrep}/bin/grep -o '"[^"]\+"' | ${pkgs.coreutils}/bin/tr -d '"' + } + + ensure_host_in_flake_hosts() { + local h="$1" + if ! list_hosts_from_flake | ${pkgs.gnugrep}/bin/grep -qx "$h"; then + echo "Adding '$h' to flake hosts list..." + ${pkgs.gnused}/bin/sed -i '/^\s*hosts\s*=\s*\[/a\ \"'"$h"'\"' "$FLAKE_NIX_PATH" + fi + } + + remove_host_from_flake_hosts() { + local h="$1" + ${pkgs.gnused}/bin/sed -i '/^\s*hosts\s*=\s*\[/,/\];/ { /^\s*"'"$h"'"\s*$/d }' "$FLAKE_NIX_PATH" + } + # --- Main Logic --- - PROFILE="$(get_flake_profile)" - if [ -z "$PROFILE" ]; then - PROFILE="$PROFILE_DEFAULT" - fi if [ "$#" -eq 0 ]; then echo "Error: No command provided." >&2 print_help @@ -389,12 +403,6 @@ in fi fi - LOG_DIR="$HOME/zcli-cleanup-logs" - mkdir -p "$LOG_DIR" - LOG_FILE="$LOG_DIR/zcli-cleanup-$(${pkgs.coreutils}/bin/date +%Y-%m-%d_%H-%M-%S).log" - echo "Cleaning up old log files..." >> "$LOG_FILE" - ${pkgs.findutils}/bin/find "$LOG_DIR" -type f -mtime +3 -name "*.log" -delete >> "$LOG_FILE" 2>&1 - echo "Cleanup process logged to $LOG_FILE" ;; diag) echo "Generating system diagnostic report..." @@ -411,6 +419,14 @@ in echo "--- System Generations ---" ${pkgs.nix}/bin/nix profile history --profile /nix/var/nix/profiles/system || echo "Could not list system generations." ;; + list-hosts) + if [ ! -f "$FLAKE_NIX_PATH" ]; then + echo "Error: flake.nix not found at $FLAKE_NIX_PATH" >&2 + exit 1 + fi + echo "Hosts defined in flake.nix:" + list_hosts_from_flake | ${pkgs.coreutils}/bin/sort | ${pkgs.coreutils}/bin/uniq + ;; rebuild) verify_hostname handle_backups @@ -418,8 +434,14 @@ in # Parse additional arguments extra_args=$(parse_nh_args "$@") - echo "Starting NixOS rebuild for host: $(${pkgs.nettools}/bin/hostname)" - if eval "${pkgs.nh}/bin/nh os switch --diff always --hostname '$PROFILE' $extra_args"; then + target="$(get_nh_target)" + if [ -z "$target" ]; then + echo "Error: Could not resolve flake config (no hosts/$(${pkgs.nettools}/bin/hostname) or hosts/default)." >&2 + exit 1 + fi + + echo "Starting NixOS rebuild for config: $target" + if eval "${pkgs.nh}/bin/nh os switch --diff always --hostname \"$target\" $extra_args"; then echo "Rebuild finished successfully" else echo "Rebuild Failed" >&2 @@ -433,9 +455,15 @@ in # Parse additional arguments extra_args=$(parse_nh_args "$@") - echo "Starting NixOS rebuild (boot) for host: $(${pkgs.nettools}/bin/hostname)" + target="$(get_nh_target)" + if [ -z "$target" ]; then + echo "Error: Could not resolve flake config (no hosts/$(${pkgs.nettools}/bin/hostname) or hosts/default)." >&2 + exit 1 + fi + + echo "Starting NixOS rebuild (boot) for config: $target" echo "Note: Configuration will be activated on next reboot" - if eval "${pkgs.nh}/bin/nh os boot --diff always --hostname '$PROFILE' $extra_args"; then + if eval "${pkgs.nh}/bin/nh os boot --diff always --hostname \"$target\" $extra_args"; then echo "Rebuild-boot finished successfully" echo "New configuration set as boot default - restart to activate" else @@ -462,8 +490,14 @@ in # Parse additional arguments extra_args=$(parse_nh_args "$@") - echo "Updating flake and rebuilding system for host: $(${pkgs.nettools}/bin/hostname)" - if eval "${pkgs.nh}/bin/nh os switch --diff always --hostname '$PROFILE' --update $extra_args"; then + target="$(get_nh_target)" + if [ -z "$target" ]; then + echo "Error: Could not resolve flake config (no hosts/$(${pkgs.nettools}/bin/hostname) or hosts/default)." >&2 + exit 1 + fi + + echo "Updating flake and rebuilding system for config: $target" + if eval "${pkgs.nh}/bin/nh os switch --diff always --hostname \"$target\" --update $extra_args"; then echo "Update and rebuild finished successfully" else echo "Update and rebuild Failed" >&2 @@ -495,25 +529,28 @@ in exit 1 fi - echo "Updating $FLAKE_NIX_PATH..." + echo "Preparing host '$target_hostname' (profile: $target_profile)..." - # Update host - if ${pkgs.gnused}/bin/sed -i "s/^[[:space:]]*host[[:space:]]*=[[:space:]]*\".*\"/ host = \"$target_hostname\"/" "$FLAKE_NIX_PATH"; then - echo "Successfully updated host to: $target_hostname" + # Ensure host directory exists (copy from hosts/default if missing) + if [ ! -d "$FLAKE_DIR/hosts/$target_hostname" ]; then + echo "Creating $FLAKE_DIR/hosts/$target_hostname from hosts/default..." + ${pkgs.coreutils}/bin/cp -r "$FLAKE_DIR/hosts/default" "$FLAKE_DIR/hosts/$target_hostname" + fi + + # Update variables.nix (hostName and gpuProfile) + host_vars_file="$FLAKE_DIR/hosts/$target_hostname/variables.nix" + if [ -f "$host_vars_file" ]; then + ${pkgs.gnused}/bin/sed -i "s/\(hostName[[:space:]]*=\)[[:space:]]*\"[^\"]*\"/\1 \"$target_hostname\"/" "$host_vars_file" + ${pkgs.gnused}/bin/sed -i "s/\(gpuProfile[[:space:]]*=\)[[:space:]]*\"[^\"]*\"/\1 \"$target_profile\"/" "$host_vars_file" else - echo "Error: Failed to update host in $FLAKE_NIX_PATH" >&2 + echo "Error: missing $host_vars_file" >&2 exit 1 fi - # Update profile - if ${pkgs.gnused}/bin/sed -i "s/^[[:space:]]*profile[[:space:]]*=[[:space:]]*\".*\"/ profile = \"$target_profile\"/" "$FLAKE_NIX_PATH"; then - echo "Successfully updated profile to: $target_profile" - else - echo "Error: Failed to update profile in $FLAKE_NIX_PATH" >&2 - exit 1 - fi + # Ensure the host appears in the flake 'hosts' array + ensure_host_in_flake_hosts "$target_hostname" - echo "Flake.nix updated successfully!" + echo "Host '$target_hostname' is ready. You can now run: zcli rebuild" ;; add-host) hostname="" @@ -568,6 +605,9 @@ in echo "hardware.nix generated." fi + # Ensure the host appears in flake.nix hosts list + ensure_host_in_flake_hosts "$hostname" + echo "Adding new host to git..." ${pkgs.git}/bin/git -C "$HOME/$PROJECT" add . echo "hostname: $hostname added" @@ -590,6 +630,8 @@ in if [[ $REPLY =~ ^[Yy]$ ]]; then echo "Deleting host '$hostname'..." ${pkgs.coreutils}/bin/rm -rf "$HOME/$PROJECT/hosts/$hostname" + # Remove from flake.nix hosts list as well + remove_host_from_flake_hosts "$hostname" ${pkgs.git}/bin/git -C "$HOME/$PROJECT" add . echo "hostname: $hostname removed" else @@ -645,7 +687,12 @@ in echo "Enabling Doom Emacs in $host_vars_file..." ensure_doom_enabled echo "Rebuilding system so user modules are applied..." - if ${pkgs.nh}/bin/nh os switch --diff always --hostname "$PROFILE"; then + target="$(get_nh_target)" + if [ -z "$target" ]; then + echo "Error: Could not resolve flake config (no hosts/$(${pkgs.nettools}/bin/hostname) or hosts/default)." >&2 + exit 1 + fi + if ${pkgs.nh}/bin/nh os switch --diff always --hostname "$target"; then echo "Rebuild complete. Proceeding with Doom installation." else echo "Error: Rebuild failed. Please fix the build and re-run 'zcli doom install'." >&2 diff --git a/modules/home/stylix.nix b/modules/home/stylix.nix index 1624de0..4448304 100644 --- a/modules/home/stylix.nix +++ b/modules/home/stylix.nix @@ -1,7 +1,5 @@ _: { stylix.targets = { - # Avoid fetching GNOME Shell sources on non-GNOME systems (breaks on some remotes) - gnome.enable = false; waybar.enable = false; rofi.enable = false; hyprland.enable = false; diff --git a/modules/home/terminals/alacritty.nix b/modules/home/terminals/alacritty.nix index ae9466b..2a94959 100644 --- a/modules/home/terminals/alacritty.nix +++ b/modules/home/terminals/alacritty.nix @@ -1,8 +1,9 @@ { - pkgs, lib, + zaneyos, ... -}: { +}: +lib.mkIf zaneyos.alacrittyEnable { programs.alacritty = let font_family = lib.mkDefault "Maple mono NF"; in { diff --git a/modules/home/terminals/ghostty.nix b/modules/home/terminals/ghostty.nix index a46a587..ac46bc8 100644 --- a/modules/home/terminals/ghostty.nix +++ b/modules/home/terminals/ghostty.nix @@ -1,8 +1,11 @@ { - pkgs, config, + lib, + pkgs, + zaneyos, ... -}: let +}: +lib.mkIf zaneyos.ghosttyEnable (let ghostHome = "${config.xdg.configHome}/ghostty"; shaderFile = "${ghostHome}/shaders/shader.glsl"; in { @@ -219,4 +222,4 @@ in { fi '') ]; -} +}) diff --git a/modules/home/terminals/tmux.nix b/modules/home/terminals/tmux.nix index 3081611..4a2158e 100644 --- a/modules/home/terminals/tmux.nix +++ b/modules/home/terminals/tmux.nix @@ -1,5 +1,11 @@ # Tmux is a terminal multiplexer that allows you to run multiple terminal sessions in a single window. -{pkgs, ...}: { +{ + lib, + pkgs, + zaneyos, + ... +}: +lib.mkIf zaneyos.tmuxEnable { programs.tmux = { enable = true; mouse = true; diff --git a/modules/home/terminals/wezterm.nix b/modules/home/terminals/wezterm.nix index ab274ff..e08e029 100644 --- a/modules/home/terminals/wezterm.nix +++ b/modules/home/terminals/wezterm.nix @@ -1,4 +1,10 @@ -{pkgs, ...}: { +{ + lib, + pkgs, + zaneyos, + ... +}: +lib.mkIf zaneyos.weztermEnable { programs.wezterm = { enable = true; package = pkgs.wezterm; diff --git a/modules/home/waybar/waybar-TheBlackDon.nix b/modules/home/waybar/waybar-TheBlackDon.nix index 60df038..140304a 100644 --- a/modules/home/waybar/waybar-TheBlackDon.nix +++ b/modules/home/waybar/waybar-TheBlackDon.nix @@ -1,11 +1,10 @@ { - pkgs, - lib, - host, config, + lib, + pkgs, ... }: let - inherit (import ../../../hosts/${host}/variables.nix) clock24h; + inherit (config.zaneyos) clock24h; scriptsDir = ./scripts; scripts = builtins.attrNames (builtins.readDir scriptsDir); in diff --git a/modules/home/waybar/waybar-curved.nix b/modules/home/waybar/waybar-curved.nix index 33e46fe..a7319ea 100644 --- a/modules/home/waybar/waybar-curved.nix +++ b/modules/home/waybar/waybar-curved.nix @@ -1,12 +1,12 @@ { pkgs, lib, - host, + zaneyos, config, ... }: let betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)"; - inherit (import ../../../hosts/${host}/variables.nix) clock24h; + inherit (zaneyos) clock24h; in with lib; { # Configure & Theme Waybar diff --git a/modules/home/waybar/waybar-ddubs.nix b/modules/home/waybar/waybar-ddubs.nix index 08edf50..86ffdf3 100644 --- a/modules/home/waybar/waybar-ddubs.nix +++ b/modules/home/waybar/waybar-ddubs.nix @@ -6,7 +6,7 @@ ... }: let betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)"; - inherit (import ../../../hosts/${host}/variables.nix) clock24h; + inherit (config.zaneyos) clock24h; in with lib; { # Configure & Theme Waybar diff --git a/modules/home/waybar/waybar-ddubsos-v1.nix b/modules/home/waybar/waybar-ddubsos-v1.nix index 4af0fed..d9a427e 100644 --- a/modules/home/waybar/waybar-ddubsos-v1.nix +++ b/modules/home/waybar/waybar-ddubsos-v1.nix @@ -2,11 +2,10 @@ pkgs, config, lib, - host, ... }: let betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)"; - inherit (import ../../../hosts/${host}/variables.nix) clock24h; + inherit (config.zaneyos) clock24h; scriptsDir = ./scripts; scripts = builtins.attrNames (builtins.readDir scriptsDir); in diff --git a/modules/home/waybar/waybar-jak-catppuccin.nix b/modules/home/waybar/waybar-jak-catppuccin.nix index aaa5e29..6693d56 100644 --- a/modules/home/waybar/waybar-jak-catppuccin.nix +++ b/modules/home/waybar/waybar-jak-catppuccin.nix @@ -444,13 +444,11 @@ in { "window-rewrite" = { "title<.*amazon.*>" = " "; "title<.*reddit.*>" = " "; - "title<.*[Hh]elium.*>" = " "; "class" = " "; "class" = "󰰷 "; "class" = " "; "class" = " "; "class" = " "; - "class" = " "; "class" = "🦁 "; "class" = " "; "class" = "🦊 "; diff --git a/modules/home/waybar/waybar-jak-ml4w-modern.nix b/modules/home/waybar/waybar-jak-ml4w-modern.nix index 0074853..80068a9 100644 --- a/modules/home/waybar/waybar-jak-ml4w-modern.nix +++ b/modules/home/waybar/waybar-jak-ml4w-modern.nix @@ -727,14 +727,12 @@ in { "window-rewrite" = { "title<.*amazon.*>" = " "; "title<.*reddit.*>" = " "; - "title<.*[Hh]elium.*>" = " "; "class" = " "; "class" = "󰰷 "; "class" = " "; "class" = " "; "class" = " "; - "class" = " "; "class" = "🦁 "; "class" = " "; "class" = "🦊 "; diff --git a/modules/home/waybar/waybar-jak-oglo-simple.nix b/modules/home/waybar/waybar-jak-oglo-simple.nix index d84c8e3..ccad11c 100644 --- a/modules/home/waybar/waybar-jak-oglo-simple.nix +++ b/modules/home/waybar/waybar-jak-oglo-simple.nix @@ -594,7 +594,6 @@ in { "class" = "󰰭 "; "class" = " 󰊠"; "class" = " "; - "class" = " "; "class<[Ss]ignal|signal-desktop|org.signal.Signal>" = "󰍩 "; "title<.*Signal.*>" = "󰍩 "; "class" = "🖥️ "; diff --git a/modules/home/waybar/waybar-mecha.nix b/modules/home/waybar/waybar-mecha.nix deleted file mode 100644 index 81f0ce6..0000000 --- a/modules/home/waybar/waybar-mecha.nix +++ /dev/null @@ -1,514 +0,0 @@ -{ - lib, - pkgs, - config, - ... -}: let - scriptsDir = ./scripts; - scripts = builtins.attrNames (builtins.readDir scriptsDir); -in { - home.file = builtins.listToAttrs (map - (name: { - name = ".config/waybar/scripts/" + name; - value = { - source = "${scriptsDir}/${name}"; - executable = true; - }; - }) - scripts); - - programs.waybar = { - enable = true; - settings = { - mainBar = { - layer = "top"; - position = "top"; - mode = "dock"; - reload_style_on_change = true; - "gtk-layer-shell" = true; - modules-left = [ - "custom/startmenu" - "custom/left1" - "hyprland/workspaces" - "custom/right1" - "custom/paddw" - "hyprland/window" - ]; - modules-center = [ - "custom/paddc" - "custom/left2" - "custom/temperature" - "custom/left3" - "memory" - "custom/left4" - "cpu" - "custom/leftin1" - "custom/left5" - "custom/distro" - "custom/right2" - "custom/rightin1" - "idle_inhibitor" - "custom/weather" - "clock#time" - "custom/right3" - "clock#date" - "custom/right4" - "custom/right5" - ]; - modules-right = [ - "mpris" - "custom/left6" - "pulseaudio" - "custom/left7" - "backlight" - "custom/left8" - "battery" - "custom/leftin2" - "custom/power" - ]; - - "hyprland/workspaces" = { - on-scroll-up = "hyprctl dispatch workspace -1"; - on-scroll-down = "hyprctl dispatch workspace +1"; - persistent-workspaces = { - "1" = []; - "2" = []; - "3" = []; - "4" = []; - "5" = []; - }; - }; - - "hyprland/window" = { - swap-icon-label = false; - format = "{}"; - tooltip = false; - min-length = 5; - rewrite = { - "" = " Hyprland"; - "~" = " Terminal"; - "zsh" = " Terminal"; - "kitty" = " Terminal"; - "tmux(.*)" = " Tmux"; - "(.*)Mozilla Firefox" = "󰈹 Firefox"; - "(.*) �� Mozilla Firefox" = "󰈹 $1"; - "(.*)Zen Browser" = "󰺕 Zen Browser"; - "(.*) — Zen Browser" = "󰺕 $1"; - "(.*) - Visual Studio Code" = "󰨞 $1"; - "(.*)Visual Studio Code" = "󰨞 Visual Studio Code"; - "nvim" = " Neovim"; - "nvim (.*)" = " $1"; - "vim" = " Vim"; - "vim (.*)" = " $1"; - "(.*)Spotify" = " Spotify"; - "(.*)Spotify Premium" = " Spotify Premium"; - "OBS(.*)" = "󰻃 OBS Studio"; - "VLC media player" = "󰕼 VLC Media Player"; - "(.*) - VLC media player" = "󰕼 $1"; - "(.*) - mpv" = " $1"; - "qView" = "󰋩 qView"; - "(.*).jpg" = "󰋩 $1.jpg"; - "(.*).png" = "󰋩 $1.png"; - "(.*).svg" = "󰋩 $1.svg"; - "• Discord(.*)" = "Discord$1"; - "(.*)Discord(.*)" = " $1Discord$2"; - "vesktop" = " Discord"; - "ONLYOFFICE Desktop Editors" = " OnlyOffice Desktop"; - "(.*).docx" = "󰈭 $1.docx"; - "(.*).xlsx" = "󰈜 $1.xlsx"; - "(.*).pptx" = "󰈨 $1.pptx"; - "(.*).pdf" = " $1.pdf"; - "Authenticate" = " Authenticate"; - }; - }; - - "custom/startmenu" = { - format = ""; - tooltip = true; - "tooltip-format" = "App menu"; - # on-click = "rofi -show drun"; - on-click = "launch-nwg-menu"; - "on-click-right" = "nwg-drawer -mr 225 -ml 225 -mt 200 -mb 200 -is 48 --spacing 15"; - }; - - "custom/temperature" = { - exec = "~/.config/waybar/scripts/cpu-temp.sh"; - return-type = "json"; - format = "{}"; - interval = 5; - min-length = 8; - max-length = 8; - }; - - memory = { - states = { - warning = 75; - critical = 90; - }; - format = "󰘚 {percentage}%"; - "format-critical" = "󰀦 {percentage}%"; - tooltip = false; - interval = 5; - min-length = 7; - max-length = 7; - }; - - cpu = { - format = "󰍛 {usage}%"; - tooltip = false; - interval = 5; - min-length = 6; - max-length = 6; - }; - - "custom/distro" = { - format = " "; - tooltip = false; - }; - - idle_inhibitor = { - format = "{icon}"; - format-icons = { - activated = " "; - deactivated = " "; - }; - "tooltip-format-activated" = "Presentation Mode"; - "tooltip-format-deactivated" = "Idle Mode"; - "start-activated" = false; - }; - - "custom/weather" = { - "return-type" = "json"; - exec = "sh -lc 'WEATHER_ICON_STYLE=emoji WEATHER_TOOLTIP_MARKUP=1 ~/.local/bin/weather'"; - interval = 600; - tooltip = true; - }; - - "clock#time" = { - format = "{:%H:%M}"; - tooltip = false; - min-length = 6; - max-length = 6; - }; - - "clock#date" = { - format = "󰸗 {:%m-%d}"; - "tooltip-format" = "{calendar}"; - calendar = { - mode = "month"; - "mode-mon-col" = 6; - "on-click-right" = "mode"; - format = { - months = "{}"; - weekdays = "{}"; - today = "{}"; - }; - }; - actions = { - "on-click" = "mode"; - "on-click-right" = "mode"; - }; - min-length = 8; - max-length = 8; - }; - - "custom/wifi" = { - exec = "~/.config/waybar/scripts/wifi-status.sh"; - return-type = "json"; - format = "{}"; - on-click = "~/.config/waybar/scripts/wifi-menu.sh"; - "on-click-right" = "kitty --title '󰤨 Network Manager TUI' bash -c nmtui"; - interval = 1; - min-length = 1; - max-length = 1; - }; - - bluetooth = { - format = "󰂰"; - "format-disabled" = "󰂲"; - "format-connected" = "󰂱"; - "format-connected-battery" = "󰂱"; - "tooltip-format" = "{num_connections} connected"; - "tooltip-format-disabled" = "Bluetooth Disabled"; - "tooltip-format-connected" = "{device_enumerate}"; - "tooltip-format-enumerate-connected" = "{device_alias}"; - "tooltip-format-enumerate-connected-battery" = ":: {device_alias}: 󱊣 {device_battery_percentage}%"; - on-click = "~/.config/waybar/scripts/bluetooth-menu.sh"; - "on-click-right" = "kitty --title '󰂯 Bluetooth TUI' bash -c bluetui"; - interval = 1; - min-length = 1; - max-length = 1; - }; - - mpris = { - format = "{player_icon} {title} - {artist}"; - "format-paused" = "{status_icon} {title} - {artist}"; - "player-icons" = { - default = "󰝚 "; - spotify = "󰓇 "; - firefox = "󰗃 "; - }; - "status-icons" = { - paused = "\u200A\u200A󰏤\u2009\u2009"; - }; - "tooltip-format" = "Playing: {title} - {artist}"; - "tooltip-format-paused" = "Paused: {title} - {artist}"; - min-length = 5; - max-length = 35; - }; - - pulseaudio = { - format = "{icon} {volume}%"; - "format-muted" = "󰝟 {volume}%"; - "format-icons" = { - default = ["󰕿" "󰖀" "󰕾"]; - headphone = "󰋋"; - headset = "󰋋"; - }; - "tooltip-format" = "Device: {desc}"; - on-click = "~/.config/waybar/scripts/volume-control.sh -o m"; - "on-scroll-up" = "~/.config/waybar/scripts/volume-control.sh -o i"; - "on-scroll-down" = "~/.config/waybar/scripts/volume-control.sh -o d"; - min-length = 6; - max-length = 6; - }; - - backlight = { - format = "{icon} {percent}%"; - "format-icons" = ["" "" "" "" "" "" "" "" ""]; - tooltip = false; - "on-scroll-up" = "~/.config/waybar/scripts/brightness-control.sh -o i"; - "on-scroll-down" = "~/.config/waybar/scripts/brightness-control.sh -o d"; - min-length = 6; - max-length = 6; - }; - - battery = { - states = { - warning = 20; - critical = 10; - }; - format = "{icon} {capacity}%"; - "format-icons" = ["󰂎" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; - "format-charging" = " {capacity}%"; - "tooltip-format" = "Discharging: {time}"; - "tooltip-format-charging" = "Charging: {time}"; - interval = 1; - min-length = 6; - max-length = 6; - }; - - "custom/power" = { - format = " ⏻ "; - tooltip = true; - "tooltip-format" = "Power menu: Left-click for QS logout, Right-click for rofi power menu"; - "on-click" = "qs-wlogout"; - "on-click-right" = "~/.config/waybar/scripts/power-menu.sh"; - }; - - "custom/paddw" = { - format = " "; - tooltip = false; - }; - - "custom/paddc" = { - format = " "; - tooltip = false; - }; - - "custom/left1" = { - format = ""; - tooltip = false; - }; - "custom/left2" = { - format = ""; - tooltip = false; - }; - "custom/left3" = { - format = ""; - tooltip = false; - }; - "custom/left4" = { - format = ""; - tooltip = false; - }; - "custom/left5" = { - format = ""; - tooltip = false; - }; - "custom/left6" = { - format = ""; - tooltip = false; - }; - "custom/left7" = { - format = ""; - tooltip = false; - }; - "custom/left8" = { - format = ""; - tooltip = false; - }; - - "custom/right1" = { - format = ""; - tooltip = false; - }; - "custom/right2" = { - format = ""; - tooltip = false; - }; - "custom/right3" = { - format = ""; - tooltip = false; - }; - "custom/right4" = { - format = ""; - tooltip = false; - }; - "custom/right5" = { - format = ""; - tooltip = false; - }; - - "custom/leftin1" = { - format = ""; - tooltip = false; - }; - "custom/leftin2" = { - format = ""; - tooltip = false; - }; - - "custom/rightin1" = { - format = ""; - tooltip = false; - }; - }; - }; - style = '' - * { - font-family: "JetBrainsMono Nerd Font"; - font-weight: bold; - font-size: 18px; - } - - window#waybar { - background-color: #${config.lib.stylix.colors.base00}; - transition-property: background-color; - transition-duration: .5s; - } - - #workspaces { - background: #${config.lib.stylix.colors.base01}; - } - - #workspaces button { - padding: 0 5px; - background-color: transparent; - color: #${config.lib.stylix.colors.base05}; - } - - #workspaces button:hover { - background: rgba(0, 0, 0, 0.2); - } - - #workspaces button.focused { - background-color: #${config.lib.stylix.colors.base03}; - box-shadow: inherit; - text-shadow: 0 0 2px rgba(0, 0, 0, 0.6); - } - - #workspaces button.urgent { - background-color: #${config.lib.stylix.colors.base08}; - } - - #mode { - background-color: #${config.lib.stylix.colors.base01}; - border-bottom: 3px solid #${config.lib.stylix.colors.base05}; - } - - #clock, - #battery, - #cpu, - #memory, - #disk, - #temperature, - #backlight, - #network, - #pulseaudio, - #wireplumber, - #custom-media, - #tray, - #mode, - #idle_inhibitor, - #scratchpad, - #mpris { - padding: 0 10px; - color: #${config.lib.stylix.colors.base05}; - background-color: #${config.lib.stylix.colors.base01}; - } - - #window, - #workspaces { - margin: 0 4px; - } - - .modules-left > widget:first-child > #workspaces { - margin-left: 0; - } - - .modules-right > widget:last-child > #workspaces { - margin-right: 0; - } - - #battery.charging, #battery.plugged { - color: #${config.lib.stylix.colors.base0B}; - background-color: #${config.lib.stylix.colors.base01}; - } - - @keyframes blink { - to { - background-color: #${config.lib.stylix.colors.base01}; - color: #${config.lib.stylix.colors.base08}; - } - } - - #battery.critical:not(.charging) { - background-color: #${config.lib.stylix.colors.base08}; - color: #${config.lib.stylix.colors.base01}; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } - - label:focus { - background-color: #${config.lib.stylix.colors.base00}; - } - - #pulseaudio.muted { - background-color: #${config.lib.stylix.colors.base01}; - color: #${config.lib.stylix.colors.base04}; - } - - #tray { - background-color: #${config.lib.stylix.colors.base01}; - } - - #tray > .passive { - -gtk-icon-effect: dim; - } - - #tray > .needs-attention { - -gtk-icon-effect: highlight; - background-color: #${config.lib.stylix.colors.base09}; - } - - #idle_inhibitor.activated { - background-color: #${config.lib.stylix.colors.base01}; - color: #${config.lib.stylix.colors.base0B}; - } - ''; - }; -} diff --git a/modules/home/waybar/waybar-nekodyke.nix b/modules/home/waybar/waybar-nekodyke.nix index 11aebd0..64a9b4d 100755 --- a/modules/home/waybar/waybar-nekodyke.nix +++ b/modules/home/waybar/waybar-nekodyke.nix @@ -1,12 +1,12 @@ { pkgs, lib, - host, config, + options, ... }: let betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)"; - inherit (import ../../../hosts/${host}/variables.nix) clock24h; + inherit (options.zaneyos) clock24h; in with lib; { # Configure & Theme Waybar diff --git a/modules/home/waybar/waybar-simple.nix b/modules/home/waybar/waybar-simple.nix index 04f1ae0..8d8b8a4 100644 --- a/modules/home/waybar/waybar-simple.nix +++ b/modules/home/waybar/waybar-simple.nix @@ -1,11 +1,10 @@ { pkgs, lib, - host, config, ... }: let - inherit (import ../../../hosts/${host}/variables.nix) clock24h; + inherit (config.zaneyos) clock24h; in with lib; { # Configure & Theme Waybar diff --git a/modules/home/waybar/waybar-tony.nix b/modules/home/waybar/waybar-tony.nix index f01fdca..8696553 100644 --- a/modules/home/waybar/waybar-tony.nix +++ b/modules/home/waybar/waybar-tony.nix @@ -1,11 +1,8 @@ { pkgs, lib, - host, - config, ... }: let - inherit (import ../../../hosts/${host}/variables.nix) clock24h; scriptsDir = ./scripts; scripts = builtins.attrNames (builtins.readDir scriptsDir); in diff --git a/modules/home/xdg.nix b/modules/home/xdg.nix index 765260e..f6ed94e 100644 --- a/modules/home/xdg.nix +++ b/modules/home/xdg.nix @@ -1,17 +1,13 @@ -{pkgs, host, lib, ...}: let - vars = import ../../hosts/${host}/variables.nix; -in { +{pkgs, zaneyos, lib, ...}: { xdg = { enable = true; mime.enable = true; mimeApps = { enable = true; - # If the host defines mimeDefaultApps in hosts/${host}/variables.nix, - # use it to set per-host default applications. - defaultApplications = lib.mkIf (vars ? mimeDefaultApps) vars.mimeDefaultApps; + # Use per-host defaults when provided via zaneyos.mimeDefaultApps + defaultApplications = lib.mkIf (zaneyos ? mimeDefaultApps && zaneyos.mimeDefaultApps != {}) zaneyos.mimeDefaultApps; - # Example: set default handlers for MIME types and URL schemes. - # Uncomment the block below and adjust .desktop IDs to your preferred apps. + # Examples: uncomment to set defaults here (host-level preferred via zaneyos.mimeDefaultApps) # defaultApplications = { # # PDFs # "application/pdf" = ["okular.desktop"]; # change to your preferred reader diff --git a/modules/home/zsh/default.nix b/modules/home/zsh/default.nix index 5df8b59..9c16a4f 100644 --- a/modules/home/zsh/default.nix +++ b/modules/home/zsh/default.nix @@ -1,10 +1,12 @@ { - profile, pkgs, lib, config, + zaneyos, ... -}: { +}: let + profile = zaneyos.hostName; +in { imports = [ ./zshrc-personal.nix ]; diff --git a/modules/options.nix b/modules/options.nix new file mode 100644 index 0000000..7c6e8c0 --- /dev/null +++ b/modules/options.nix @@ -0,0 +1,264 @@ +{lib, ...}: +with lib; { + options.zaneyos = { + # Git Configuration ( For Pulling Software Repos ) + gitUsername = mkOption { + type = types.str; + example = "Tyler Kelley"; + description = "Git username for configuration."; + }; + gitEmail = mkOption { + type = types.str; + example = "tylerzanekelley@gmail.com"; + description = "Git email for configuration."; + }; + hostName = mkOption { + type = types.str; + description = "Machine hostname, can have .local suffix or a fqdn if needed"; + example = "hostname"; + }; + + # Set Display Manager + # `tui` for Text login + # `sddm` for graphical GUI (default) + # SDDM background is set with stylixImage + displayManager = mkOption { + type = types.enum ["tui" "sddm"]; + default = "sddm"; + description = "Display manager to use."; + }; + + gpuProfile = mkOption { + type = types.enum ["amd" "nvidia" "nvidia-laptop" "amd-nvidia-hybrid" "intel" "vm"]; + example = "nvidia"; + description = "GPU profile for drivers."; + }; + + localHardwareClock = mkOption { + type = types.bool; + default = false; + description = "Set hardware clock to local time for better interop with some dual boot or vm setups."; + }; + + # Enable/disable bundled applications + tmuxEnable = mkOption { + type = types.bool; + default = false; + description = "Enable tmux."; + }; + alacrittyEnable = mkOption { + type = types.bool; + default = false; + description = "Enable Alacritty."; + }; + weztermEnable = mkOption { + type = types.bool; + default = false; + description = "Enable WezTerm."; + }; + ghosttyEnable = mkOption { + type = types.bool; + default = false; + description = "Enable Ghostty."; + }; + vscodeEnable = mkOption { + type = types.bool; + default = false; + description = "Enable VSCode."; + }; + # Google port of vscodium + antigravityEnable = mkOption { + type = types.bool; + default = false; + description = "Enable Antigravity."; + }; + # Note: This is evil-helix with VIM keybindings by default + helixEnable = mkOption { + type = types.bool; + default = false; + description = "Enable Helix."; + }; + # To install: Enable here, zcli rebuild, then run zcli doom install + doomEmacsEnable = mkOption { + type = types.bool; + default = false; + description = "Enable Doom Emacs."; + }; + neovimConfig = mkOption { + type = types.enum ["nixvim" "nvf"]; + default = "nixvim"; + description = "Select Neovim configuration (nixvim or nvf)."; + }; + obsStudioEnable = mkOption { + type = types.bool; + default = true; + description = "Enable OBS Studio."; + }; + # Python development tools + pythonEnable = mkOption { + type = types.bool; + default = true; + description = "Enable Python development tools."; + }; + + # Hyprland Settings + # You can configure multiple monitors. + # Inside the quotes, create a new line for each monitor. + extraMonitorSettings = + mkOption { + type = types.lines; + default = " + + "; + description = "Extra monitor settings for Hyprland."; + }; + + # Bar/Shell Settings + # Choose between noctalia or waybar + barChoice = mkOption { + type = types.enum ["noctalia" "waybar"]; + default = "noctalia"; + description = "Bar/Shell choice."; + }; + + # Waybar Settings (used when barChoice = "waybar") + clock24h = mkOption { + type = types.bool; + default = false; + description = "Use 24h clock in Waybar."; + }; + + # Program Options + # Set Default Browser (google-chrome-stable for google-chrome) + # This does NOT install your browser + # You need to install it by adding it to the `packages.nix` + # or as a flatpak + # + # refactor TODO: make the options we provide install + browser = mkOption { + type = types.str; + default = "brave"; + description = "Default browser."; + }; + # Note: kitty, wezterm, alacritty have to be enabled in `variables.nix` + # Setting it here does not enable it. Kitty is installed by default + # refactor TODO: combine package insallation and default and options, + # and make this a package argument so unstable can be given + terminal = mkOption { + type = types.str; + default = "kitty"; + description = "Default system terminal."; + }; + + # Keyboard and Console + keyboardLayout = mkOption { + type = types.str; + default = "us"; + description = "Keyboard layout."; + }; + keyboardVariant = mkOption { + type = types.str; + default = ""; + description = "Keyboard variant."; + }; + consoleKeyMap = mkOption { + type = types.str; + default = "us"; + description = "Console key map."; + }; + + # For hybrid support (Intel/NVIDIA Prime or AMD/NVIDIA) + intelID = mkOption { + type = types.str; + default = "PCI:1:0:0"; + description = "Intel GPU Bus ID."; + }; + amdgpuID = mkOption { + type = types.str; + default = "PCI:5:0:0"; + description = "AMD GPU Bus ID."; + }; + nvidiaID = mkOption { + type = types.str; + default = "PCI:0:2:0"; + description = "Nvidia GPU Bus ID."; + }; + + # Enable NFS + enableNFS = mkOption { + type = types.bool; + default = true; + description = "Enable NFS."; + }; + + # Enable Printing Support + printEnable = mkOption { + type = types.bool; + default = false; + description = "Enable printing support."; + }; + scannerEnable = mkOption { + type = types.bool; + default = true; + description = "Enable scanning support."; + }; + + # Yazi is default File Manager. + thunarEnable = mkOption { + type = types.bool; + default = false; + description = "Enable Thunar GUI File Manager."; + }; + + # Themes, waybar and animation + + # Set Stylix Image + # This will set your color palette + # Default background + # Add new images to ~/zaneyos/wallpapers + stylixImage = mkOption { + type = types.path; + example = "../../wallpapers/mountainscapedark.jpg"; + description = "Wallpaper image for Stylix."; + }; + waybarChoice = mkOption { + type = types.path; + example = "../../modules/home/waybar/waybar-curved.nix"; + description = "Path to Waybar configuration file."; + }; + animChoice = mkOption { + type = types.path; + example = "../../modules/home/hyprland/animations-def.nix"; + description = "Path to animation configuration file."; + }; + + enableSmartD = mkOption { + type = types.bool; + default = true; + description = "Can be disabled for hosts without real disks."; + }; + + # Set network hostId if required (needed for zfs) + # Otherwise leave as-is + hostId = mkOption { + type = types.str; + default = "5ab03f50"; + description = "Network hostId."; + }; + + # Default applications per MIME type (consumed by Home Manager xdg.mimeApps) + # Example value: + # { + # "application/pdf" = ["okular.desktop"]; # PDF handler + # "x-scheme-handler/http" = ["google-chrome.desktop"]; # Browser + # } + mimeDefaultApps = mkOption { + type = types.attrsOf (types.listOf types.str); + default = {}; + description = '' + Attribute set mapping MIME types or URL schemes to lists of .desktop IDs. + Applied to xdg.mimeApps.defaultApplications for the user on this host. + ''; + }; + }; +} diff --git a/modules/src/UPGRADE-2.3-to-2.4.es.md b/modules/src/UPGRADE-2.3-to-2.4.es.md deleted file mode 100644 index 19a0908..0000000 --- a/modules/src/UPGRADE-2.3-to-2.4.es.md +++ /dev/null @@ -1,221 +0,0 @@ -[English](UPGRADE-2.3-to-2.4.md) | [Español](UPGRADE-2.3-to-2.4.es.md) - -# Guía de Actualización ZaneyOS 2.3 → 2.4 - -Esta guía proporciona scripts de actualización seguros para migrar de ZaneyOS 2.3 a 2.4, manejando cambios incompatibles y preservando tu configuración personalizada. - -## 🔄 Cambios Importantes en 2.4 - -- **SDDM** ahora es el display manager predeterminado (antes tui-greetd) -- **Selección de terminal**: terminales habilitables por bandera -- **Nuevas variables**: añadidas en `variables.nix` -- **Breaking changes**: actualizaciones directas fallan por variables faltantes - -## 📋 Qué hace el Script de Actualización - -1. **Análisis previo** con reporte detallado -2. **Respaldo completo** de tu sistema actual -3. **Verificación de versión** (debes estar en 2.3) -4. **Actualización segura**: cambia a main (2.4) y migra -5. **Migración de variables** al nuevo formato -6. **Manejo de terminales**: habilita tu preferida en 2.4 -7. **Build seguro** con `boot` para evitar problemas con SDDM -8. **Opción de revert** fácil si algo sale mal - -## 🛡️ Características de Seguridad - -- **Respaldo completo** de ~/zaneyos antes de cambios -- **Boot vs Switch**: usa build de arranque seguro -- **Revert** sencillo para restaurar 2.3 -- **Validaciones** previas al proceso -- **Logging** exhaustivo para troubleshooting - -## 🚀 Cómo Actualizar - -### Paso 0: Obtén el script de forma segura (NO hagas git pull) - -Para evitar sobrescribir tu configuración local antes de crear un respaldo, descarga solo el script sin modificar tu working tree. - -Opción A — Usando tu remoto git (recomendado): -```bash -# Trae refs sin tocar tu working tree -git -C ~/zaneyos fetch origin - -# Escribe el script desde origin/main a tu home -git -C ~/zaneyos show origin/main:upgrade-2.3-to-2.4.sh > ~/upgrade-2.3-to-2.4.sh -chmod +x ~/upgrade-2.3-to-2.4.sh -``` - -Opción B — Usando curl: -```bash -curl -fsSL https://gitlab.com/zaney/zaneyos/-/raw/main/upgrade-2.3-to-2.4.sh -o ~/upgrade-2.3-to-2.4.sh -chmod +x ~/upgrade-2.3-to-2.4.sh -``` - -Ambos métodos mantienen tu repo local intacto. El script creará un respaldo completo antes de cambiar ramas. - -### Paso 1: Ejecuta el Script - -```bash -# Puedes ejecutarlo desde cualquier ruta; opera sobre ~/zaneyos -~/upgrade-2.3-to-2.4.sh -``` - -### Paso 2: Revisa el Análisis Previo - -El script realizará un análisis completo de tu configuración actual: -- **Analiza flake.nix** (inputs y perfil actual) -- **Escanea hosts** y detecta personalizaciones -- **Revisa paquetes globales** en modules/core/packages.nix -- **Detecta personalizaciones de shell** (zsh, bash, eza) -- **Identifica módulos personalizados** y archivos personales -- **Genera un informe detallado** en `~/zaneyos-upgrade-analysis-TIMESTAMP.txt` - -**Verás claramente:** -- ✅ **Qué se migrará automáticamente** (variables, paquetes, configs) -- ⚠️ **Qué requiere atención manual** (inputs personalizados, archivos personales) -- 📋 **Resumen** de hosts y personalizaciones detectadas - -### Paso 3: Sigue los Prompts - -Luego de revisar el análisis, el script: -- Creará un respaldo (verás la ruta) -- Pedirá confirmación antes de continuar -- Descargarà 2.4 desde main -- Migrará automáticamente tu configuración -- Compilará el nuevo sistema -- Pedirá reinicio - -### Paso 4: Reinicia el Sistema - -Tras un build exitoso: -```bash -sudo reboot -``` - -Tu sistema iniciará con: -- SDDM como gestor de acceso -- Todos tus ajustes preservados -- Funcionalidades de 2.4 disponibles - -## 🔧 Detalles de Migración - -### Ajustes preservados automáticamente: -- Usuario y email de Git -- Preferencia de navegador -- Elección de terminal (con habilitación automática) -- Layout de teclado y console keymap -- NFS, impresión y Thunar -- Formato de reloj (12h/24h) -- Ajustes de monitores -- Fondo (stylixImage) -- Tema de Waybar -- Animaciones -- Hardware -- **Paquetes globales** (modules/core/packages.nix) -- **Paquetes por host** (hosts/[hostname]/host-packages.nix) -- **Imports personalizados** (hosts/[hostname]/default.nix si aplica) - -### Manejo de Terminales: -Si usabas una terminal específica en 2.3: -- **Kitty**: ya habilitada por defecto en 2.4 -- **Alacritty**: se habilita `alacrittyEnable = true` -- **WezTerm**: se habilita `weztermEnable = true` -- **Ghostty**: se habilita `ghosttyEnable = true` - -## ⚠️ Notas Importantes - -### Display Manager SDDM -- 2.4 usa SDDM por defecto -- La actualización usa `boot` para evitar problemas visuales -- **Debes reiniciar** tras la actualización; no uses `switch` - -### Ubicación del Respaldo -``` -~/.config/zaneyos-backups/zaneyos-2.3-upgrade-backup-TIMESTAMP/ -``` - -## 🔄 Cómo Revertir - -Si algo falla, puedes revertir fácilmente: - -### Opción 1: Script de revert -```bash -cd ~/zaneyos -./revert-to-2.3.sh -``` - -### Opción 2: Script principal -```bash -cd ~/zaneyos -./upgrade-2.3-to-2.4.sh --revert -``` - -### Opción 3: Reversión manual -1. Elimina `~/zaneyos`: `rm -rf ~/zaneyos` -2. Restaura desde el respaldo: `cp -r ~/.config/zaneyos-backups/[backup-name]/zaneyos ~/` -3. Rebuild: `nh os boot ~/zaneyos --hostname [profile]` -4. Reinicia - -## 🔍 Troubleshooting - -### Fallos de build -- Revisa el log (ruta mostrada por el script) -- Asegura espacio en disco suficiente -- Prueba revert y reporta - -### Problemas de visualización tras reinicio -- Si ves pantalla en negro, espera unos segundos a que SDDM arranque -- Cambia a TTY (Ctrl+Alt+F2) si lo necesitas -- Inicia sesión y ejecuta `systemctl status display-manager` - -### Aplicaciones faltantes -- Verifica tu terminal preferida en `~/zaneyos/hosts/[hostname]/variables.nix` -- Confirma que navegador y otras apps sigan disponibles - -### Log de ejecución -Cada corrida genera un log en: `~/zaneyos-upgrade-TIMESTAMP.log` - -## 📁 Estructura tras la actualización - -``` -~/zaneyos/hosts/[tu-hostname]/ -├── hardware.nix (preservado de 2.3) -└── variables.nix (actualizado a 2.4 con tus ajustes) -``` - -## 🆘 Recuperación de Emergencia - -Si algo sale mal: -1. Tu respaldo 2.3 está intacto -2. Arranca con un USB live de NixOS -3. Monta el sistema y restaura el respaldo -4. Tus datos y configuración están seguros - -## ✅ Lista de Verificación Post‑Actualización - -Tras actualizar y reiniciar: -- [ ] Aparece la pantalla de login de SDDM -- [ ] El escritorio carga correctamente -- [ ] Se abre tu terminal preferida -- [ ] El navegador funciona -- [ ] Se preservó fondo/tema -- [ ] Configuración de monitores correcta -- [ ] Aplicaciones necesarias disponibles - -## 🤝 Ayuda - -Si encuentras problemas: -1. Revisa el log de ejecución -2. Prueba la reversión a 2.3 -3. Reporta con contenido del log -4. Tu respaldo permite recuperación manual - ---- - -## Archivos de Script -- `upgrade-2.3-to-2.4.sh` — Script principal -- `revert-to-2.3.sh` — Wrapper de reversión -- `UPGRADE-2.3-to-2.4.md` — Esta documentación - -Recuerda: se crea un respaldo completo antes de cualquier cambio, por lo que siempre puedes recuperarte. diff --git a/modules/src/UPGRADE-2.3-to-2.4.md b/modules/src/UPGRADE-2.3-to-2.4.md deleted file mode 100644 index 5ccded0..0000000 --- a/modules/src/UPGRADE-2.3-to-2.4.md +++ /dev/null @@ -1,225 +0,0 @@ -[English](UPGRADE-2.3-to-2.4.md) | [Español](UPGRADE-2.3-to-2.4.es.md) - -# ZaneyOS 2.3 → 2.4 Upgrade Guide - -This guide provides safe upgrade scripts to migrate from ZaneyOS 2.3 to 2.4, handling all the breaking changes and ensuring your custom configuration is preserved. - -## 🔄 Major Changes in 2.4 - -- **SDDM** is now the default display manager (was previously tui-greetd) -- **Terminal Selection**: Individual terminal applications can be enabled/disabled -- **New Variables**: Additional configuration variables added to `variables.nix` -- **Breaking Changes**: Direct upgrade causes build failures due to missing variables - -## 📋 What the Upgrade Script Does - -1. **Pre-Upgrade Analysis**: Comprehensive analysis of your current configuration with detailed report -2. **Full Backup**: Creates complete backup of your current system -3. **Version Verification**: Confirms you're running ZaneyOS 2.3 -4. **Safe Upgrade**: Switches to main branch (2.4) and merges configurations -5. **Variable Merging**: Automatically migrates all your settings to new format -6. **Terminal Handling**: Ensures your preferred terminal is enabled in 2.4 -7. **Safe Build**: Uses `boot` option to avoid SDDM display issues -8. **Revert Option**: Provides easy rollback if anything goes wrong - -## 🛡️ Safety Features - -- **Complete Backup**: Full copy of your zaneyos directory before any changes -- **Boot vs Switch**: Uses safe boot option to prevent display manager conflicts -- **Revert Function**: Can completely restore 2.3 backup with one command -- **Validation**: Checks system state before proceeding -- **Logging**: Comprehensive log file for troubleshooting - -## 🚀 How to Upgrade - -### Step 0: Get the upgrade script safely (do NOT git pull yet) - -To avoid overwriting your local configuration before a backup is created, fetch just the upgrade script without modifying your working tree. - -Option A — Using your existing git remote (recommended): -```bash -# Fetch the latest refs without touching your working tree -git -C ~/zaneyos fetch origin - -# Write the script from origin/main into your home directory -git -C ~/zaneyos show origin/main:upgrade-2.3-to-2.4.sh > ~/upgrade-2.3-to-2.4.sh -chmod +x ~/upgrade-2.3-to-2.4.sh -``` - -Option B — Using curl (if you don't have a usable origin remote): -```bash -curl -fsSL https://gitlab.com/zaney/zaneyos/-/raw/main/upgrade-2.3-to-2.4.sh -o ~/upgrade-2.3-to-2.4.sh -chmod +x ~/upgrade-2.3-to-2.4.sh -``` - -Both methods keep your local repo unchanged. The script will create a full backup before switching branches. - -### Step 1: Run the Upgrade Script - -```bash -# You can run the script from anywhere; it operates on ~/zaneyos -~/upgrade-2.3-to-2.4.sh -``` - -### Step 2: Review the Pre-Upgrade Analysis - -The script will first perform a comprehensive analysis of your current configuration: -- **Analyze flake.nix** for custom inputs and current profile -- **Scan all host configurations** and detect customizations -- **Check global packages** in modules/core/packages.nix -- **Detect shell customizations** (zsh, bash, eza personal files) -- **Identify other custom modules** and personal files -- **Generate a detailed report** saved as `~/zaneyos-upgrade-analysis-TIMESTAMP.txt` - -**The analysis will clearly show:** -- ✅ **What WILL be automatically migrated** (variables, packages, configs) -- ⚠️ **What requires manual attention** (custom inputs, personal shell files) -- 📋 **Summary of all hosts and customizations** found - -### Step 3: Follow the Prompts - -After reviewing the analysis, the script will: -- Create a backup (you'll see the location) -- Ask for confirmation before proceeding -- Download ZaneyOS 2.4 from main branch -- Merge your configuration automatically -- Build the new system -- Prompt for reboot - -### Step 4: Reboot Your System - -After successful build: -```bash -sudo reboot -``` - -Your system will now boot with: -- SDDM as the login manager -- All your previous settings preserved -- New 2.4 features available - -## 🔧 Configuration Migration Details - -### Automatically Preserved Settings: -- Git username and email -- Browser preference -- Terminal choice (with automatic enabling) -- Keyboard layout and console keymap -- NFS, printing, and Thunar settings -- Clock format (12h/24h) -- Monitor settings -- Wallpaper (stylixImage) -- Waybar theme choice -- Animation settings -- Hardware configuration -- **Global packages** (modules/core/packages.nix customizations) -- **Host-specific packages** (hosts/[hostname]/host-packages.nix) -- **Custom module imports** (hosts/[hostname]/default.nix if customized) - -### Terminal Handling: -If you were using a specific terminal in 2.3: -- **Kitty**: Already enabled by default in 2.4 -- **Alacritty**: Script automatically enables `alacrittyEnable = true` -- **WezTerm**: Script automatically enables `weztermEnable = true` -- **Ghostty**: Script automatically enables `ghosttyEnable = true` - -## ⚠️ Important Notes - -### SDDM Display Manager -- 2.4 uses SDDM as default login manager -- The upgrade uses `boot` instead of `switch` to prevent display issues -- You **must reboot** after upgrade - don't use `switch` command - -### Backup Location -Your backup is stored at: -``` -~/.config/zaneyos-backups/zaneyos-2.3-upgrade-backup-TIMESTAMP/ -``` - -## 🔄 How to Revert - -If you encounter any issues, you can easily revert: - -### Option 1: Use the Revert Script -```bash -cd ~/zaneyos -./revert-to-2.3.sh -``` - -### Option 2: Use the Main Script -```bash -cd ~/zaneyos -./upgrade-2.3-to-2.4.sh --revert -``` - -### Option 3: Manual Revert -1. Remove current zaneyos directory: `rm -rf ~/zaneyos` -2. Restore from backup: `cp -r ~/.config/zaneyos-backups/[backup-name]/zaneyos ~/` -3. Rebuild system: `nh os boot ~/zaneyos --hostname [profile]` -4. Reboot system - -## 🔍 Troubleshooting - -### Build Failures -- Check the log file (location shown in script output) -- Ensure you have sufficient disk space -- Try the revert option and report the issue - -### Display Issues After Reboot -- If you get a blank screen, wait a few moments for SDDM to start -- You can switch to TTY (Ctrl+Alt+F2) if needed -- Login and run `systemctl status display-manager` - -### Missing Applications -- Check if your preferred terminal is enabled in `~/zaneyos/hosts/[hostname]/variables.nix` -- Verify browser and other applications are still available -- Some applications may need to be re-enabled in the new configuration - -### Log File Location -Each run creates a log file at: `~/zaneyos-upgrade-TIMESTAMP.log` - -## 📁 File Structure After Upgrade - -Your host configuration will be updated with new 2.4 structure: -``` -~/zaneyos/hosts/[your-hostname]/ -├── hardware.nix (preserved from 2.3) -└── variables.nix (updated to 2.4 format with your settings) -``` - -## 🆘 Emergency Recovery - -If something goes very wrong: -1. Your complete 2.3 backup is preserved -2. Boot from NixOS live USB if needed -3. Mount your system and restore the backup -4. All your data and configuration is safe - -## ✅ Post-Upgrade Checklist - -After successful upgrade and reboot: -- [ ] SDDM login screen appears -- [ ] Desktop environment loads correctly -- [ ] Preferred terminal opens and works -- [ ] Browser launches correctly -- [ ] Custom wallpaper/theme preserved -- [ ] Monitor configuration correct -- [ ] All needed applications available - -## 🤝 Getting Help - -If you encounter issues: -1. Check the log file for error details -2. Try the revert option to restore 2.3 -3. Report issues with log file contents -4. Your backup is always available for manual recovery - ---- - -## Script Files - -- **`upgrade-2.3-to-2.4.sh`** - Main upgrade script -- **`revert-to-2.3.sh`** - Simple revert wrapper -- **`UPGRADE-2.3-to-2.4.md`** - This documentation - -Remember: The upgrade creates a complete backup before making any changes, so your system is always recoverable. diff --git a/modules/src/ZaneyOS-Upgrade.es.md b/modules/src/ZaneyOS-Upgrade.es.md deleted file mode 100644 index e0b0e42..0000000 --- a/modules/src/ZaneyOS-Upgrade.es.md +++ /dev/null @@ -1,147 +0,0 @@ -[English](ZaneyOS-Upgrade.md) | [Español](ZaneyOS-Upgrade.es.md) - -# 🚀 Procedimiento de Actualización de ZaneyOS - -## ⚠️ DEPRECADO - Usa el nuevo sistema de actualización automatizado - -> **IMPORTANTE:** -> -> Este procedimiento manual ha sido **reemplazado** por un sistema automatizado mucho más seguro y completo. -> -> **Usa el nuevo sistema:** -> - Revisa: `UPGRADE-2.3-to-2.4.md` (documentación completa) -> - Ejecuta: `./upgrade-2.3-to-2.4.sh` (actualización automatizada) -> - Incluye respaldos automáticos, migración de variables y reversión sencilla - ---- - -## 🆕 Nuevo Sistema Automatizado - -Proporciona: -- **Respaldo completo** antes de cambios -- **Migración automática** de variables 2.3 → 2.4 (15+ variables) -- **Manejo de terminales** crítico para 2.4 -- **Build seguro** con `boot` para evitar problemas visuales -- **Reversión con un comando** si algo falla -- **Logs** completos para diagnóstico - -### Inicio Rápido -```bash -# Obtén el script sin modificar tu repo -git -C ~/zaneyos fetch origin && \ - git -C ~/zaneyos show origin/main:upgrade-2.3-to-2.4.sh > ~/upgrade-2.3-to-2.4.sh && \ - chmod +x ~/upgrade-2.3-to-2.4.sh - -# Ejecuta el script (crea respaldo completo antes de cambiar ramas) -~/upgrade-2.3-to-2.4.sh -``` - -Alternativa (curl): -```bash -curl -fsSL https://gitlab.com/zaney/zaneyos/-/raw/main/upgrade-2.3-to-2.4.sh -o ~/upgrade-2.3-to-2.4.sh -chmod +x ~/upgrade-2.3-to-2.4.sh -~/upgrade-2.3-to-2.4.sh -``` - -### Instrucciones Detalladas -```bash -less UPGRADE-2.3-to-2.4.md -``` - ---- - -## ⚠️ ¿Por qué usar el sistema nuevo? - -El proceso manual es **incompleto y riesgoso** porque: -- ❌ Maneja pocas variables (2.4 añade 15+) -- ❌ No hay respaldo automático -- ❌ No maneja dependencias de terminal -- ❌ No hay opción de revertir si falla -- ❌ Faltan variables críticas como `doomEmacsEnable`, monitores, tema -- ❌ Referencias desactualizadas (`fr`, `fu` en vez de `zcli`) - ---- - -# 📜 Procedimiento Manual Original (DEPRECADO) - -> **⚠️ ADVERTENCIA:** Proceso manual desactualizado e incompleto. -> **Usa el sistema automatizado indicado arriba.** - ---- - -### 1. 📝 Preparación - -1. **Asegura que tu ZaneyOS actual esté al día:** - - Ve a tu carpeta ZaneyOS: - ```bash - cd ~/zaneyos - ``` - - Si tienes cambios sin commit, súbelos primero. - - Trae los últimos cambios: - ```bash - git stash && git fetch && git pull - ``` - - Verifica que host y GPU en `flake.nix` coincidan con tu sistema. - - Puedes editarlos manualmente. - - Dependiendo de tu build actual, quizá puedas ejecutar `zcli update-host`. - - Si hay cambios, reconstruye y reinicia (`zcli rebuild`). - -2. **Respalda tu directorio actual:** - ```bash - mv ~/zaneyos ~/zaneyos-backup - ``` - -3. **Clona la rama v2.4:** - ```bash - git clone https://gitlab.com/zaney/zaneyos.git -b Stable-2.4 --depth=1 - cd ~/zaneyos - ``` - ---- - -### 2. 🔄 Convertir hosts 2.3 a 2.4 - -- **Nuevas opciones en `hosts//variables.nix`:** - ```nix - displayManager = "sddm"; - tmuxEnable = false; - alacrittyEnable = false; - weztermEnable = false; - ghosttyEnable = false; - vscodeEnable = false; - helixEnable = false; - ``` - -- **Pasos de migración:** - 1. Copia la plantilla `hosts/default` a tu hostname - 2. Copia `hardware.nix` desde el respaldo - 3. `git add .` - 4. Integra tus personalizaciones manualmente en el nuevo layout (no sobrescribas archivos 2.4) - ---- - -### 3. ✅ Probar la Configuración - -1. Verifica `flake.nix` (hostname y GPU). Si tienes `zcli update-host`, úsalo. -2. Ejecuta: - ```bash - nix flake check - ``` - ---- - -### 4. ⬆️ Ejecutar la Actualización - -> ⚠️ **CRÍTICO:** -> - No uses `fr`, `fu` ni `zcli` para este paso final. -> - Podría provocar un crash de Hyprland al reiniciar el display manager. - -1. Ejecuta desde `~/zaneyos`: - ```bash - sudo nixos-rebuild boot --flake .#PROFILE - ``` -2. Reinicia. - ---- - -### 🎉 ¡Bienvenido a ZaneyOS v2.4! diff --git a/modules/src/ZaneyOS-Upgrade.md b/modules/src/ZaneyOS-Upgrade.md deleted file mode 100644 index 0ce55c4..0000000 --- a/modules/src/ZaneyOS-Upgrade.md +++ /dev/null @@ -1,189 +0,0 @@ -[English](ZaneyOS-Upgrade.md) | [Español](ZaneyOS-Upgrade.es.md) - -# 🚀 ZaneyOS Upgrade Procedure - -## ⚠️ DEPRECATED - Use New Automated Upgrade System - -> **IMPORTANT:** -> -> This manual upgrade procedure has been **replaced** by a much safer and more comprehensive automated upgrade system. -> -> **Please use the new upgrade system instead:** -> - See: `UPGRADE-2.3-to-2.4.md` for complete documentation -> - Run: `./upgrade-2.3-to-2.4.sh` for automated upgrade -> - The new system includes automatic backups, variable migration, and easy revert options - ---- - -## 🆕 New Automated Upgrade System - -The new upgrade system provides: -- **Complete backup** of your current system before any changes -- **Automatic variable migration** from 2.3 to 2.4 format (handles 15+ variables) -- **Terminal dependency handling** (critical for 2.4 compatibility) -- **Safe build process** using `boot` instead of `switch` to avoid display issues -- **One-command revert** if anything goes wrong -- **Comprehensive logging** for troubleshooting - -### Quick Start: -```bash -# Safely obtain the script without modifying your repo -git -C ~/zaneyos fetch origin && \ - git -C ~/zaneyos show origin/main:upgrade-2.3-to-2.4.sh > ~/upgrade-2.3-to-2.4.sh && \ - chmod +x ~/upgrade-2.3-to-2.4.sh - -# Run the script (it will create a full backup before changing branches) -~/upgrade-2.3-to-2.4.sh -``` - -Alternative (curl): -```bash -curl -fsSL https://gitlab.com/zaney/zaneyos/-/raw/main/upgrade-2.3-to-2.4.sh -o ~/upgrade-2.3-to-2.4.sh -chmod +x ~/upgrade-2.3-to-2.4.sh -~/upgrade-2.3-to-2.4.sh -``` - -### For detailed instructions: -```bash -less UPGRADE-2.3-to-2.4.md -``` - ---- - -## ⚠️ Why Use the New System? - -The manual process below is **incomplete and risky** because: -- ❌ Only handles 6 variables (actual 2.4 has 15+ new variables) -- ❌ No automatic backup system -- ❌ No terminal dependency handling -- ❌ No revert option if things go wrong -- ❌ Missing critical variables like `doomEmacsEnable`, monitor settings, theme configuration -- ❌ References outdated commands (`fr`, `fu` instead of `zcli`) - ---- - -# 📜 Original Manual Procedure (DEPRECATED) - -> **⚠️ WARNING: This manual procedure is outdated and incomplete.** -> **Use the automated upgrade system above instead.** - ---- - -### 1. 📝 Prepare for Upgrade - -1. **Ensure your current ZaneyOS is up-to-date:** - - Navigate to your ZaneyOS directory: - ```bash - cd ~/zaneyos - ``` - - If you have any uncommitted changes, commit and push them. - - Fetch the latest changes: - ```bash - git stash && git fetch && git pull - ``` - - Verify that your current host and GPU in `flake.nix` match your system. - - You can edit `flake.nix` manually. - - Depending on your current build, you might be able to run - `zcli update-host`. - - If there are any changes, perform a rebuild and reboot: - - Use `fr` or `zcli rebuild`. - -2. **Backup your current ZaneyOS directory:** - ```bash - mv ~/zaneyos ~/zaneyos-backup - ``` - -3. **Clone the v2.4 branch:** - ```bash - git clone https://gitlab.com/zaney/zaneyos.git -b Stable-2.4 --depth=1 - cd ~/zaneyos - ``` - ---- - -### 2. 🔄 Converting v2.3 Hosts to v2.4 - -ZaneyOS v2.4 introduces new features in the host configuration, giving you more -control. This requires a manual update to your host files. - -- **New options in `hosts/hostname/variables.nix`:** - - ```nix - # Set Display Manager: `tui` for Text, `sddm` for graphical GUI - # SDDM background is set with stylixImage - displayManager = "sddm"; - - # Enable/disable bundled applications - tmuxEnable = false; - alacrittyEnable = false; - weztermEnable = false; - ghosttyEnable = false; - vscodeEnable = false; - helixEnable = false; - ``` - -- **Migration Steps:** - - 1. **Copy the `default` host template** to a new directory named after your - host: - ```bash - # Replace YOURHOSTNAME with your actual hostname - cp -r ~/zaneyos/hosts/default ~/zaneyos/hosts/YOURHOSTNAME - ``` - _Example:_ If your hostname is `nixos`: - ```bash - cp -r ~/zaneyos/hosts/default ~/zaneyos/hosts/nixos - ``` - - 2. **Copy the hardware configuration** from your backup: - ```bash - # Replace nixos with your hostname if different - cp ~/zaneyos-backup/hosts/nixos/hardware.nix ~/zaneyos/hosts/nixos/hardware.nix - ``` - - 3. ❗ **IMPORTANT:** In the `zaneyos` directory, stage your changes: - ```bash - git add . - ``` - - 4. **Manually edit your new host files** (`~/zaneyos/hosts/YOURHOSTNAME`) to - include any personal customizations (e.g., monitor settings, extra - packages). - > ⚠️ **Warning:** Do **NOT** copy/restore your old host files directly! You - > must integrate your changes into the new v2.4 file structure. - ---- - -### 3. ✅ Test the Configuration - -1. **Verify `flake.nix`:** Ensure your hostname and GPU type are set correctly. - - If you are unsure and your version has it available, run: - `zcli update-host` - -2. **Run a configuration check** from the `zaneyos` directory: - ```bash - nix flake check - ``` - - If there are no errors, you can proceed to the final step. - ---- - -### 4. ⬆️ Running the Upgrade - -> ⚠️ **CRITICAL WARNING:** -> -> - Do **NOT** use `fr`, `fu`, or `zcli` for this final upgrade step. -> - Doing so will cause Hyprland to crash when the display manager (greetd or -> SDDM) restarts during the switch. - -1. **Execute the rebuild command** from the `zaneyos` directory: - ```bash - # Replace PROFILE with your GPU (e.g., amd, intel, nvidia, vm) - sudo nixos-rebuild boot --flake .#PROFILE - ``` - -2. **Reboot your system** once the update is complete. - ---- - -### 🎉 Enjoy! Welcome to ZaneyOS v2.4! diff --git a/modules/src/compare-zaneyos-config.sh b/modules/src/compare-zaneyos-config.sh deleted file mode 100755 index 2fe7eea..0000000 --- a/modules/src/compare-zaneyos-config.sh +++ /dev/null @@ -1,465 +0,0 @@ -#!/usr/bin/env bash - -########################################## -# ZaneyOS Configuration Comparison Tool -# Author: Don Williams -# Date: $(date +"%B %d, %Y") -########################################## - -# Define colors -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -CYAN='\033[0;36m' -PURPLE='\033[0;35m' -NC='\033[0m' # No Color - -# Define directories -ZANEYOS_DIR="$HOME/zaneyos" -TEMP_DIR="/tmp/zaneyos-comparison-$$" -TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S") -REPORT_FILE="$HOME/zaneyos-config-comparison-$TIMESTAMP.txt" - -# Default comparison targets -DEFAULT_REPO="https://gitlab.com/zaney/zaneyos.git" -DEFAULT_BRANCH="main" - -# Function to print a section header -print_header() { - echo -e "${BLUE}╔═══════════════════════════════════════════════════════════════════════╗${NC}" - echo -e "${BLUE}║ ${1} ${NC}" - echo -e "${BLUE}╚═══════════════════════════════════════════════════════════════════════╝${NC}" -} - -# Function to print an error message -print_error() { - echo -e "${RED}❌ Error: ${1}${NC}" -} - -# Function to print a warning message -print_warning() { - echo -e "${YELLOW}⚠️ Warning: ${1}${NC}" -} - -# Function to print a success message -print_success() { - echo -e "${GREEN}✅ ${1}${NC}" -} - -# Function to print an info message -print_info() { - echo -e "${CYAN}ℹ️ ${1}${NC}" -} - -# Function to show usage -show_usage() { - echo -e "${CYAN}ZaneyOS Configuration Comparison Tool${NC}" - echo "" - echo "Usage: $0 [OPTIONS]" - echo "" - echo "Options:" - echo " -r, --repo URL Remote repository URL to compare against" - echo " (default: https://gitlab.com/zaney/zaneyos.git)" - echo " -b, --branch NAME Branch to compare against (default: main)" - echo " -o, --output FILE Output report file path" - echo " -h, --help Show this help message" - echo "" - echo "Examples:" - echo " $0 # Compare against official main branch" - echo " $0 -r https://github.com/user/zaneyos.git -b dev" - echo " $0 --branch stable-2.4 # Compare against specific branch" - echo " $0 --output my-comparison.txt # Custom output file" - echo "" -} - -# Parse command line arguments -REPO_URL="$DEFAULT_REPO" -BRANCH="$DEFAULT_BRANCH" - -while [[ $# -gt 0 ]]; do - case $1 in - -r|--repo) - REPO_URL="$2" - shift 2 - ;; - -b|--branch) - BRANCH="$2" - shift 2 - ;; - -o|--output) - REPORT_FILE="$2" - shift 2 - ;; - -h|--help) - show_usage - exit 0 - ;; - *) - print_error "Unknown option: $1" - show_usage - exit 1 - ;; - esac -done - -# Function to cleanup on exit -cleanup() { - if [ -d "$TEMP_DIR" ]; then - rm -rf "$TEMP_DIR" - fi -} -trap cleanup EXIT - -# Main comparison function -perform_comparison() { - print_header "ZaneyOS Configuration Comparison Tool" - - echo -e "${CYAN}🔍 Comparing your configuration against:${NC}" - echo -e " Repository: ${YELLOW}$REPO_URL${NC}" - echo -e " Branch: ${YELLOW}$BRANCH${NC}" - echo -e " Report: ${YELLOW}$REPORT_FILE${NC}" - echo "" - - # Check if we're in a zaneyos directory - if [ ! -d "$ZANEYOS_DIR" ]; then - print_error "ZaneyOS directory not found at $ZANEYOS_DIR" - exit 1 - fi - - cd "$ZANEYOS_DIR" || exit 1 - - # Check if current directory is a git repository - if [ ! -d ".git" ]; then - print_warning "Current ZaneyOS directory is not a git repository" - print_info "This tool works best when your ZaneyOS is version controlled" - fi - - # Clone the comparison repository - print_info "Cloning comparison repository..." - mkdir -p "$TEMP_DIR" - if ! git clone --depth=1 -b "$BRANCH" "$REPO_URL" "$TEMP_DIR/reference" 2>/dev/null; then - print_error "Failed to clone repository: $REPO_URL (branch: $BRANCH)" - print_info "Please check the repository URL and branch name" - exit 1 - fi - - print_success "Successfully cloned reference repository" - - # Generate comparison report - { - echo "============================================" - echo " ZaneyOS Configuration Comparison Report" - echo " Generated: $(date)" - echo " Local: $ZANEYOS_DIR" - echo " Remote: $REPO_URL (branch: $BRANCH)" - echo "============================================" - echo "" - - # Compare flake.nix - echo "🔧 FLAKE.NIX COMPARISON:" - echo "========================" - if [ -f "./flake.nix" ] && [ -f "$TEMP_DIR/reference/flake.nix" ]; then - if cmp -s "./flake.nix" "$TEMP_DIR/reference/flake.nix"; then - echo "✅ flake.nix is identical to reference" - else - echo "📝 flake.nix differences detected:" - echo "" - echo "--- Reference (official)" - echo "+++ Your configuration" - diff -u "$TEMP_DIR/reference/flake.nix" "./flake.nix" || true - fi - else - echo "⚠️ Could not compare flake.nix (file missing)" - fi - echo "" - - # Compare global packages - echo "📦 GLOBAL PACKAGES COMPARISON:" - echo "==============================" - if [ -f "./modules/core/packages.nix" ] && [ -f "$TEMP_DIR/reference/modules/core/packages.nix" ]; then - if cmp -s "./modules/core/packages.nix" "$TEMP_DIR/reference/modules/core/packages.nix"; then - echo "✅ modules/core/packages.nix is identical to reference" - else - echo "📝 Global packages differences detected:" - echo "" - echo "--- Reference (official)" - echo "+++ Your configuration" - diff -u "$TEMP_DIR/reference/modules/core/packages.nix" "./modules/core/packages.nix" || true - fi - else - echo "⚠️ Could not compare global packages (file missing)" - fi - echo "" - - # Compare host configurations - echo "🏠 HOST CONFIGURATIONS COMPARISON:" - echo "==================================" - - # List your hosts vs reference hosts - echo "📂 Your hosts:" - for dir in hosts/*/; do - hostname=$(basename "$dir") - if [ "$hostname" != "default" ]; then - echo " • $hostname" - fi - done - echo "" - - echo "📂 Reference hosts:" - for dir in "$TEMP_DIR/reference/hosts/"*/; do - hostname=$(basename "$dir") - if [ "$hostname" != "default" ]; then - echo " • $hostname" - fi - done - echo "" - - # Compare default host template - echo "📋 Default host template comparison:" - if [ -d "./hosts/default" ] && [ -d "$TEMP_DIR/reference/hosts/default" ]; then - for file in variables.nix hardware.nix host-packages.nix default.nix; do - if [ -f "./hosts/default/$file" ] && [ -f "$TEMP_DIR/reference/hosts/default/$file" ]; then - if cmp -s "./hosts/default/$file" "$TEMP_DIR/reference/hosts/default/$file"; then - echo " ✅ default/$file is identical" - else - echo " 📝 default/$file has differences:" - echo " (This is normal if you've customized the default template)" - fi - fi - done - fi - echo "" - - # Compare your custom hosts against default template - echo "🔍 YOUR CUSTOM HOST ANALYSIS:" - echo "==========================" - for dir in hosts/*/; do - hostname=$(basename "$dir") - if [ "$hostname" != "default" ]; then - echo "📋 Host: $hostname" - - # Compare each file against the reference default - for file in variables.nix hardware.nix host-packages.nix default.nix; do - local_file="./hosts/$hostname/$file" - ref_default="$TEMP_DIR/reference/hosts/default/$file" - - if [ -f "$local_file" ] && [ -f "$ref_default" ]; then - if cmp -s "$local_file" "$ref_default"; then - echo " ✅ $file: Using default template" - else - echo " 📝 $file: Customized (differs from default template)" - - # Show key customizations for variables.nix - if [ "$file" = "variables.nix" ]; then - echo " 🔍 Key customizations detected:" - - # Extract important variables - git_user=$(grep 'gitUsername' "$local_file" 2>/dev/null | sed 's/.*= *"\([^"]*\)".*/\1/' || echo "not set") - git_email=$(grep 'gitEmail' "$local_file" 2>/dev/null | sed 's/.*= *"\([^"]*\)".*/\1/' || echo "not set") - browser=$(grep 'browser' "$local_file" 2>/dev/null | sed 's/.*= *"\([^"]*\)".*/\1/' || echo "default") - terminal=$(grep 'terminal' "$local_file" 2>/dev/null | sed 's/.*= *"\([^"]*\)".*/\1/' || echo "default") - - echo " • Git User: $git_user" - echo " • Git Email: $git_email" - echo " • Browser: $browser" - echo " • Terminal: $terminal" - fi - fi - elif [ -f "$local_file" ]; then - echo " ℹ️ $file: Custom file (not in reference)" - else - echo " ⚠️ $file: Missing" - fi - done - echo "" - fi - done - - # Compare shell configurations - echo "🐚 SHELL CONFIGURATIONS COMPARISON:" - echo "=================================" - - # Check common shell customization files - shell_files=( - "modules/home/zsh/default.nix" - "modules/home/zsh/zshrc-personal.nix" - "modules/home/bash.nix" - "modules/home/bashrc-personal.nix" - "modules/home/eza.nix" - ) - - for file in "${shell_files[@]}"; do - if [ -f "./$file" ]; then - if [ -f "$TEMP_DIR/reference/$file" ]; then - if cmp -s "./$file" "$TEMP_DIR/reference/$file"; then - echo "✅ $file: Identical to reference" - else - echo "📝 $file: Customized" - fi - else - echo "ℹ️ $file: Personal file (not in reference)" - fi - elif [ -f "$TEMP_DIR/reference/$file" ]; then - echo "⚠️ $file: Missing (exists in reference)" - fi - done - echo "" - - # File count comparison - echo "📊 REPOSITORY STATISTICS:" - echo "=======================" - local_files=$(find . -name "*.nix" -type f | wc -l) - ref_files=$(find "$TEMP_DIR/reference" -name "*.nix" -type f | wc -l) - - echo "📁 .nix files in your config: $local_files" - echo "📁 .nix files in reference: $ref_files" - - if [ "$local_files" -gt "$ref_files" ]; then - echo "📈 You have $((local_files - ref_files)) more .nix files than reference" - echo " This might indicate custom modules or configurations" - elif [ "$local_files" -lt "$ref_files" ]; then - echo "📉 You have $((ref_files - local_files)) fewer .nix files than reference" - echo " This might indicate missing features or modules" - else - echo "📊 Same number of .nix files as reference" - fi - echo "" - - # Git status if available - if [ -d ".git" ]; then - echo "🔄 GIT REPOSITORY STATUS:" - echo "=======================" - - # Current branch - current_branch=$(git branch --show-current 2>/dev/null || echo "unknown") - echo "📍 Current branch: $current_branch" - - # Commit information - if git rev-parse HEAD >/dev/null 2>&1; then - last_commit=$(git log -1 --format="%h - %s (%cr)" 2>/dev/null || echo "unknown") - echo "📝 Last commit: $last_commit" - - # Check for uncommitted changes - if ! git diff-index --quiet HEAD -- 2>/dev/null; then - echo "⚠️ Uncommitted changes detected:" - git status --porcelain | head -10 | sed 's/^/ /' - uncommitted_count=$(git status --porcelain | wc -l) - if [ "$uncommitted_count" -gt 10 ]; then - echo " ... and $((uncommitted_count - 10)) more files" - fi - else - echo "✅ No uncommitted changes" - fi - - # Remote information - remote_url=$(git remote get-url origin 2>/dev/null || echo "no remote") - echo "🌐 Remote origin: $remote_url" - fi - else - echo "🔄 GIT REPOSITORY STATUS:" - echo "=======================" - echo "⚠️ Not a git repository" - echo "💡 Consider initializing git for better version control:" - echo " git init" - echo " git add ." - echo " git commit -m 'Initial ZaneyOS configuration'" - fi - echo "" - - # Summary and recommendations - echo "============================================" - echo "📋 SUMMARY & RECOMMENDATIONS:" - echo "============================================" - echo "" - echo "🎯 CONFIGURATION ASSESSMENT:" - - # Count differences - different_files=0 - if [ -f "./flake.nix" ] && [ -f "$TEMP_DIR/reference/flake.nix" ] && ! cmp -s "./flake.nix" "$TEMP_DIR/reference/flake.nix"; then - ((different_files++)) - fi - if [ -f "./modules/core/packages.nix" ] && [ -f "$TEMP_DIR/reference/modules/core/packages.nix" ] && ! cmp -s "./modules/core/packages.nix" "$TEMP_DIR/reference/modules/core/packages.nix"; then - ((different_files++)) - fi - - if [ "$different_files" -eq 0 ]; then - echo "✅ Your configuration appears to be standard/minimal customization" - echo " • Upgrade should be straightforward" - echo " • Most settings will migrate automatically" - elif [ "$different_files" -le 2 ]; then - echo "📝 Your configuration has moderate customizations" - echo " • Upgrade should work well with some manual review" - echo " • Check the differences above for manual merge items" - else - echo "🔧 Your configuration is heavily customized" - echo " • Upgrade will require careful manual review" - echo " • Consider the git commands below for detailed analysis" - fi - echo "" - - echo "💡 RECOMMENDED ACTIONS:" - if [ -d ".git" ]; then - echo "1. Review differences in this report" - echo "2. Use git commands for detailed file-by-file comparison:" - echo " git remote add upstream $REPO_URL" - echo " git fetch upstream" - echo " git diff upstream/$BRANCH...HEAD" - echo "3. For specific files:" - echo " git diff upstream/$BRANCH:flake.nix flake.nix" - echo " git diff upstream/$BRANCH:modules/core/packages.nix modules/core/packages.nix" - else - echo "1. Consider initializing git for better version control" - echo "2. Review differences in this report" - echo "3. Back up your configuration before any upgrades" - fi - echo "" - - echo "🔄 FOR UPGRADING TO ZANEYOS 2.4:" - echo "1. Run the upgrade analysis: ./upgrade-2.3-to-2.4.sh" - echo "2. Review the pre-upgrade analysis report" - echo "3. Use this comparison report to understand your customizations" - echo "4. Proceed with the automated upgrade if ready" - echo "" - - echo "============================================" - echo "End of Comparison Report" - echo "============================================" - - } | tee "$REPORT_FILE" - - print_success "Comparison complete! Report saved to: $REPORT_FILE" - - # Offer to show git commands for further analysis - if [ -d ".git" ]; then - echo "" - read -p "Would you like to see detailed git comparison commands? (Y/N): " -n 1 -r - echo "" - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo -e "${CYAN}🔍 Git Commands for Detailed Analysis:${NC}" - echo "" - echo -e "${YELLOW}1. Add upstream remote (if not already added):${NC}" - echo " git remote add upstream $REPO_URL" - echo "" - echo -e "${YELLOW}2. Fetch latest changes:${NC}" - echo " git fetch upstream" - echo "" - echo -e "${YELLOW}3. Compare your entire config vs upstream:${NC}" - echo " git diff upstream/$BRANCH...HEAD" - echo "" - echo -e "${YELLOW}4. Compare specific files:${NC}" - echo " git diff upstream/$BRANCH:flake.nix flake.nix" - echo " git diff upstream/$BRANCH:modules/core/packages.nix modules/core/packages.nix" - echo "" - echo -e "${YELLOW}5. See what files you've modified:${NC}" - echo " git diff --name-only upstream/$BRANCH...HEAD" - echo "" - echo -e "${YELLOW}6. View your commit history vs upstream:${NC}" - echo " git log --oneline upstream/$BRANCH..HEAD" - echo "" - fi - fi -} - -# Main execution -perform_comparison diff --git a/modules/src/revert-to-2.3.sh b/modules/src/revert-to-2.3.sh deleted file mode 100755 index 28fdade..0000000 --- a/modules/src/revert-to-2.3.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -########################################## -# ZaneyOS Revert Script: 2.4 → 2.3 -# Author: Don Williams -# This is a simple wrapper for the revert functionality -########################################## - -# Define colors -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -CYAN='\033[0;36m' -NC='\033[0m' # No Color - -echo -e "${BLUE}╔═══════════════════════════════════════════════════════════════════════╗${NC}" -echo -e "${BLUE}║ ZaneyOS 2.4 → 2.3 Revert Script ║${NC}" -echo -e "${BLUE}╚═══════════════════════════════════════════════════════════════════════╝${NC}" - -echo "" -echo -e "${YELLOW}⚠️ This will revert your ZaneyOS installation from 2.4 back to 2.3${NC}" -echo -e "${CYAN}ℹ️ This uses your upgrade backup to restore the previous configuration${NC}" -echo "" - -# Check if the main upgrade script exists -UPGRADE_SCRIPT="./upgrade-2.3-to-2.4.sh" -if [ ! -f "$UPGRADE_SCRIPT" ]; then - echo -e "${RED}❌ Error: upgrade-2.3-to-2.4.sh not found in current directory${NC}" - echo -e "${CYAN}Please ensure you're in the ~/zaneyos directory${NC}" - exit 1 -fi - -# Check if it's executable -if [ ! -x "$UPGRADE_SCRIPT" ]; then - echo -e "${YELLOW}⚠️ Making upgrade script executable...${NC}" - chmod +x "$UPGRADE_SCRIPT" -fi - -# Ensure the upgrade script targets the stable 2.4 branch for consistency -export BRANCH="${BRANCH:-stable-2.4}" - -# Run the revert function -echo -e "${GREEN}🔄 Starting revert process...${NC}" -"$UPGRADE_SCRIPT" --revert diff --git a/modules/src/upgrade-2.3-to-2.4.sh b/modules/src/upgrade-2.3-to-2.4.sh deleted file mode 100755 index 7446b5f..0000000 --- a/modules/src/upgrade-2.3-to-2.4.sh +++ /dev/null @@ -1,1020 +0,0 @@ -#!/usr/bin/env bash - -########################################## -# ZaneyOS Upgrade Script: 2.3 → 2.4 -# Author: Don Williams -# Date: $(date +"%B %d, %Y") -########################################## - -# Define colors -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -CYAN='\033[0;36m' -NC='\033[0m' # No Color - -# Define directories -ZANEYOS_DIR="$HOME/zaneyos" -BACKUP_BASE_DIR="$HOME/.config/zaneyos-backups" -TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S") -BACKUP_DIR="$BACKUP_BASE_DIR/zaneyos-2.3-upgrade-backup-$TIMESTAMP" - -# Target branch for 2.4 release (override by exporting BRANCH) -BRANCH="${BRANCH:-stable-2.4}" - -# Define log file -LOG_FILE="$HOME/zaneyos-upgrade-$TIMESTAMP.log" - -# Redirect all output to log file while still showing on screen -exec > >(tee -a "$LOG_FILE") 2>&1 - -# Function to print a section header -print_header() { - echo -e "${BLUE}╔═══════════════════════════════════════════════════════════════════════╗${NC}" - echo -e "${BLUE}║ ${1} ${NC}" - echo -e "${BLUE}╚═══════════════════════════════════════════════════════════════════════╝${NC}" -} - -# Function to print an error message -print_error() { - echo -e "${RED}❌ Error: ${1}${NC}" -} - -# Function to print a warning message -print_warning() { - echo -e "${YELLOW}⚠️ Warning: ${1}${NC}" -} - -# Function to print a success message -print_success() { - echo -e "${GREEN}✅ ${1}${NC}" -} - -# Function to print an info message -print_info() { - echo -e "${CYAN}ℹ️ ${1}${NC}" -} - -# Function to create full backup -create_backup() { - print_header "Creating Complete Backup" - - if [ ! -d "$ZANEYOS_DIR" ]; then - print_error "ZaneyOS directory not found at $ZANEYOS_DIR" - return 1 - fi - - print_info "Creating backup directory: $BACKUP_DIR" - mkdir -p "$BACKUP_DIR" - - print_info "Copying entire zaneyos directory..." - if cp -r "$ZANEYOS_DIR" "$BACKUP_DIR/"; then - print_success "Backup created successfully at: $BACKUP_DIR" - echo -e "${GREEN}📁 Backup location: $BACKUP_DIR/zaneyos${NC}" - return 0 - else - print_error "Failed to create backup" - return 1 - fi -} - -# Function to revert from backup -revert_from_backup() { - print_header "Reverting from Backup" - - if [ ! -d "$BACKUP_DIR/zaneyos" ]; then - print_error "Backup not found at $BACKUP_DIR/zaneyos" - echo -e "${YELLOW}Available backups:${NC}" - ls -la "$BACKUP_BASE_DIR/" 2>/dev/null || echo "No backups found" - return 1 - fi - - print_warning "This will completely restore your ZaneyOS 2.3 configuration" - echo -e "${YELLOW}Current zaneyos directory will be replaced with backup${NC}" - - read -p "Are you sure you want to revert? (Y/N): " -n 1 -r - echo - if [[ ! $REPLY =~ ^[Yy]$ ]]; then - print_info "Revert cancelled" - return 1 - fi - - # Remove current directory - print_info "Removing current zaneyos directory..." - if [ -d "$ZANEYOS_DIR" ]; then - rm -rf "$ZANEYOS_DIR" - fi - - # Restore from backup - print_info "Restoring from backup..." - if cp -r "$BACKUP_DIR/zaneyos" "$HOME/"; then - print_success "Successfully reverted to ZaneyOS 2.3 backup" - - # Change to the restored directory - cd "$ZANEYOS_DIR" || return 1 - - # Get the profile from flake.nix - local profile=$(grep 'profile = ' ./flake.nix | sed 's/.*= *"\([^"]*\)".*/\1/') - - print_info "Rebuilding system with restored configuration..." - if command -v nh &> /dev/null; then - nh os boot ~/zaneyos --hostname "$profile" - else - sudo nixos-rebuild boot --flake ~/zaneyos/#"$profile" - fi - - if [ $? -eq 0 ]; then - print_success "System successfully reverted to ZaneyOS 2.3" - echo -e "${YELLOW}Please reboot to complete the reversion${NC}" - else - print_error "Failed to rebuild system after revert" - return 1 - fi - - return 0 - else - print_error "Failed to restore from backup" - return 1 - fi -} - -# Function to print success banner -print_success_banner() { - echo -e "${GREEN}╔═══════════════════════════════════════════════════════════════════════╗${NC}" - echo -e "${GREEN}║ ZaneyOS 2.4 Upgrade Successful! ║${NC}" - echo -e "${GREEN}║ ║${NC}" - echo -e "${GREEN}║ 🎉 Your system has been upgraded to ZaneyOS 2.4 ║${NC}" - echo -e "${GREEN}║ 🔄 Please reboot your system for changes to take full effect ║${NC}" - echo -e "${GREEN}║ 🖥️ SDDM is now the default display manager ║${NC}" - echo -e "${GREEN}║ ║${NC}" - echo -e "${GREEN}╚═══════════════════════════════════════════════════════════════════════╝${NC}" -} - -# Function to print failure banner -print_failure_banner() { - echo -e "${RED}╔═══════════════════════════════════════════════════════════════════════╗${NC}" - echo -e "${RED}║ ZaneyOS 2.4 Upgrade Failed! ║${NC}" - echo -e "${RED}║ ║${NC}" - echo -e "${RED}║ Please review the log file for details: ║${NC}" - echo -e "${RED}║ ${LOG_FILE} ║${NC}" - echo -e "${RED}║ ║${NC}" - echo -e "${RED}╚═══════════════════════════════════════════════════════════════════════╝${NC}" -} - -# Cleanup helper: remove duplicate attribute keys in variables.nix -cleanup_duplicates() { - local file_path="$1" - # Keep only the first non-comment occurrence of specific keys - awk ' - BEGIN{si=0; ac=0; wc=0} - /^[[:space:]]*stylixImage[[:space:]]*=/ { if (si++) next } - /^[[:space:]]*animChoice[[:space:]]*=/ { if (ac++) next } - /^[[:space:]]*waybarChoice[[:space:]]*=/ { if (wc++) next } - { print } - ' "$file_path" > "$file_path.tmp" && mv "$file_path.tmp" "$file_path" -} - -# Prompt helpers for non-interactive mode -prompt_yes() { - local message="$1" - if [ "${AUTO_YES:-}" = "1" ]; then - echo -e "$message Y" - REPLY=Y - else - read -p "$message " -n 1 -r - echo "" - fi -} - -prompt_choice() { - # $1: prompt message, $2: default uppercase letter (e.g., S or R) - local message="$1" - local default_char="$2" - if [ "${AUTO_YES:-}" = "1" ]; then - echo -e "$message $default_char" - choice="$default_char" - else - read -p "$message " -r choice - fi -} - -# Git helper: switch to target branch safely even with uncommitted changes -switch_to_main_handling_dirty() { - # Fetch target branch from origin - print_info "Fetching latest changes from origin ($BRANCH)..." - # Fetch branch ref into FETCH_HEAD (works even if remote-tracking branch isn't configured) - if ! git fetch origin "$BRANCH"; then - print_error "Failed to fetch origin/$BRANCH" - exit 1 - fi - - # Handle dirty worktree - if ! git diff-index --quiet HEAD -- 2>/dev/null; then - print_warning "UNCOMMITTED CHANGES DETECTED!" - echo "You can:" - echo " • [S]tash changes (default)" - echo " • [D]iscard changes (reset hard)" - echo " • [A]bort upgrade" - prompt_choice "Choose action [S/d/a]:" "S" - case "${choice^^}" in - D) - print_warning "Discarding local changes (git reset --hard && git clean -fd)" - git reset --hard || { print_error "git reset failed"; exit 1; } - git clean -fd || { print_error "git clean failed"; exit 1; } - ;; - A) - print_info "Upgrade cancelled by user due to uncommitted changes." - exit 0 - ;; - *) - local stash_name="pre-upgrade-stash-$(date +%F_%H-%M-%S)" - if git stash -u -m "$stash_name"; then - print_success "Changes stashed as: $stash_name" - else - print_error "Failed to stash changes" - exit 1 - fi - ;; - esac - fi - - # Create or reset local branch to fetched commit (FETCH_HEAD) - if ! git checkout -B "$BRANCH" FETCH_HEAD; then - print_error "Failed to create/reset local $BRANCH from FETCH_HEAD" - exit 1 - fi - - # Set upstream if available, ignore errors if not - git branch --set-upstream-to="origin/$BRANCH" "$BRANCH" >/dev/null 2>&1 || true - - print_success "Successfully switched to ZaneyOS 2.4 ($BRANCH branch)" -} - -# Check command line arguments -if [ "$1" = "--revert" ]; then - revert_from_backup - exit $? -fi - -print_header "ZaneyOS 2.3 → 2.4 Upgrade Script" - -echo -e "${CYAN}🚀 Welcome to the ZaneyOS 2.4 Upgrade Script!${NC}" -echo "" -echo -e "${YELLOW}📋 This script will:${NC}" -echo -e " • Create a complete backup of your current system" -echo -e " • Verify you're currently running ZaneyOS 2.3" -echo -e " • Upgrade to ZaneyOS 2.4 from $BRANCH" -echo -e " • Merge new 2.4 variables into your host configuration" -echo -e " • Handle terminal dependencies automatically" -echo -e " • Use safe 'boot' option to avoid SDDM display issues" -echo -e " • Prompt for reboot after completion" -echo "" -echo -e "${CYAN}💾 Revert Instructions:${NC}" -echo -e " If something goes wrong, run: $0 --revert" -echo "" - -# Change to zaneyos directory -if [ ! -d "$ZANEYOS_DIR" ]; then - print_error "ZaneyOS directory not found at $ZANEYOS_DIR" - print_error "Please ensure ZaneyOS is installed at ~/zaneyos" - exit 1 -fi - -cd "$ZANEYOS_DIR" || exit 1 - -print_header "Pre-Flight Checks" - -# Check if we're in a ZaneyOS directory -if [ ! -f "./flake.nix" ] || [ ! -d "./hosts" ]; then - print_error "This doesn't appear to be a ZaneyOS directory." - print_error "Please ensure you're in the correct directory." - exit 1 -fi - -print_success "ZaneyOS directory structure detected" - -# Check if git is available -if ! command -v git &> /dev/null; then - print_error "Git is not installed." - exit 1 -fi - -print_success "Git is available" - -# Check if NH is available (we'll use it for the rebuild) -if ! command -v nh &> /dev/null; then - print_warning "NH (Nix Helper) not found. Will use nixos-rebuild directly." - USE_NH=false -else - print_success "NH (Nix Helper) detected" - USE_NH=true -fi - -print_header "Version Verification" - -# Check current branch/version -CURRENT_BRANCH=$(git branch --show-current) -print_info "Current branch: $CURRENT_BRANCH" - -# Verify this appears to be version 2.3 -if [ ! -f "./hosts/default/variables.nix" ]; then - print_error "Cannot find default variables.nix file" - exit 1 -fi - -# Check if we have 2.4 features (this indicates the TEMPLATE is 2.4) -# Do NOT abort: users may still have 2.3 host files to migrate. -if grep -q "displayManager" ./hosts/default/variables.nix; then - print_warning "Template variables.nix includes 2.4+ fields (displayManager found)." - print_info "Proceeding: we will still migrate host files from your 2.3 backup." -else - print_success "Verified: Template appears to be ZaneyOS 2.3-style" -fi - -# Comprehensive pre-check analysis -perform_precheck_analysis() { - local analysis_file="$HOME/zaneyos-upgrade-analysis-$TIMESTAMP.txt" - - print_header "Pre-Upgrade Analysis" - print_info "Analyzing your current ZaneyOS configuration..." - print_info "Analysis report will be saved to: $analysis_file" - - { - echo "============================================" - echo " ZaneyOS 2.3 → 2.4 Upgrade Analysis Report" - echo " Generated: $(date)" - echo " System: $(hostname)" - echo "============================================" - echo "" - - # Analyze flake.nix customizations - echo "🔧 FLAKE.NIX ANALYSIS:" - if [ -f "./flake.nix" ]; then - # Check for custom inputs - echo "📦 Custom Inputs Detected:" - custom_inputs=$(grep -A 20 "inputs = {" ./flake.nix | grep -v "nixpkgs\|home-manager\|hyprland\|stylix" | grep -E "\w+\.(url|github|gitlab)" || echo " None detected") - echo "$custom_inputs" - echo "" - - # Check current profile - current_profile=$(grep 'profile = ' ./flake.nix | sed 's/.*= *"\([^"]*\)".*/\1/' || echo "Unknown") - echo "📍 Current Profile: $current_profile" - echo "" - else - echo "❌ flake.nix not found" - fi - - # Analyze host configurations - echo "🏠 HOST CONFIGURATIONS ANALYSIS:" - host_count=0 - for dir in hosts/*/; do - hostname=$(basename "$dir") - if [ "$hostname" != "default" ]; then - ((host_count++)) - echo " 📂 Host: $hostname" - - # Check which files exist - [ -f "$dir/variables.nix" ] && echo " ✅ variables.nix (WILL BE MIGRATED)" - [ -f "$dir/hardware.nix" ] && echo " ✅ hardware.nix (WILL BE PRESERVED)" - [ -f "$dir/host-packages.nix" ] && echo " ✅ host-packages.nix (WILL BE PRESERVED)" - - # Check if default.nix is customized - if [ -f "$dir/default.nix" ]; then - if ! cmp -s "$dir/default.nix" "./hosts/default/default.nix" 2>/dev/null; then - echo " ✅ default.nix (CUSTOMIZED - WILL BE PRESERVED)" - echo " 📋 Custom imports detected:" - grep -E "\./|\.\." "$dir/default.nix" | sed 's/^/ /' || echo " (parsing error)" - else - echo " 📋 default.nix (standard template)" - fi - fi - echo "" - fi - done - echo "📊 Total hosts to migrate: $host_count" - echo "" - - # Analyze global packages - echo "📦 GLOBAL PACKAGES ANALYSIS:" - if [ -f "./modules/core/packages.nix" ]; then - # Count total packages - package_count=$(grep -c "^[[:space:]]*[a-zA-Z]" ./modules/core/packages.nix | head -1) - echo "📊 Approximate package count: $package_count" - - # Check for custom additions (commented out packages that user might have enabled) - echo "🔍 Potentially customized packages:" - grep -E "^[[:space:]]*#[a-zA-Z]" ./modules/core/packages.nix | head -10 | sed 's/^/ /' || echo " None detected" - echo "📋 packages.nix status: WILL BE ANALYZED AND PRESERVED IF CUSTOMIZED" - else - echo "❌ modules/core/packages.nix not found" - fi - echo "" - - # Analyze shell customizations - echo "🐚 SHELL CUSTOMIZATIONS ANALYSIS:" - shell_custom_found=false - - # Check zsh customizations - if [ -f "./modules/home/zsh/default.nix" ]; then - if ! cmp -s "./modules/home/zsh/default.nix" "./hosts/default/modules/home/zsh/default.nix" 2>/dev/null; then - echo " ⚠️ modules/home/zsh/default.nix - CUSTOMIZED (REQUIRES MANUAL MERGE)" - shell_custom_found=true - fi - fi - - if [ -f "./modules/home/zsh/zshrc-personal.nix" ]; then - echo " ⚠️ modules/home/zsh/zshrc-personal.nix - PERSONAL FILE (REQUIRES MANUAL MERGE)" - shell_custom_found=true - fi - - # Check bash customizations - if [ -f "./modules/home/bash.nix" ]; then - if ! cmp -s "./modules/home/bash.nix" "./hosts/default/modules/home/bash.nix" 2>/dev/null; then - echo " ⚠️ modules/home/bash.nix - CUSTOMIZED (REQUIRES MANUAL MERGE)" - shell_custom_found=true - fi - fi - - if [ -f "./modules/home/bashrc-personal.nix" ]; then - echo " ⚠️ modules/home/bashrc-personal.nix - PERSONAL FILE (REQUIRES MANUAL MERGE)" - shell_custom_found=true - fi - - # Check eza customizations - if [ -f "./modules/home/eza.nix" ]; then - if ! cmp -s "./modules/home/eza.nix" "./hosts/default/modules/home/eza.nix" 2>/dev/null; then - echo " ⚠️ modules/home/eza.nix - CUSTOMIZED (REQUIRES MANUAL MERGE)" - shell_custom_found=true - fi - fi - - # Check Hyprland customizations - if [ -d "./modules/home/hyprland" ]; then - echo " 🪟 Checking Hyprland configurations..." - hyprland_files=$(find ./modules/home/hyprland -name "*.nix" -type f 2>/dev/null | wc -l) - if [ "$hyprland_files" -gt 0 ]; then - echo " ⚠️ modules/home/hyprland/ - HYPRLAND CONFIGS DETECTED ($hyprland_files files)" - echo " 🚨 CRITICAL: Hyprland configs contain complex settings that CANNOT be auto-migrated" - echo " 📋 Files detected:" - find ./modules/home/hyprland -name "*.nix" -type f | sed 's|^./| |' 2>/dev/null || echo " (error listing files)" - echo " ⚠️ These require careful manual review and migration after upgrade" - echo " 💡 Backup location will contain your current configs for reference" - shell_custom_found=true - fi - fi - - if [ "$shell_custom_found" = false ]; then - echo " ✅ No shell customizations detected" - fi - echo "" - - # Git repository analysis - echo "🔄 GIT REPOSITORY ANALYSIS:" - if [ -d ".git" ]; then - # Current branch and remote - current_branch=$(git branch --show-current 2>/dev/null || echo "unknown") - echo " 📍 Current branch: $current_branch" - - # Remote information - if git remote get-url origin >/dev/null 2>&1; then - remote_url=$(git remote get-url origin 2>/dev/null) - echo " 🌐 Remote origin: $remote_url" - - # Check if it's a fork or custom repo - if [[ "$remote_url" != *"zaney/zaneyos"* ]]; then - echo " ⚠️ CUSTOM REPOSITORY DETECTED!" - echo " This appears to be a fork or custom repository." - echo " Consider running the comparison tool for detailed analysis:" - echo " ./compare-zaneyos-config.sh -r $remote_url -b $current_branch" - fi - fi - - # Check for uncommitted changes - if git diff-index --quiet HEAD -- 2>/dev/null; then - echo " ✅ No uncommitted changes" - else - echo " ⚠️ UNCOMMITTED CHANGES DETECTED!" - echo " You have uncommitted changes that won't be preserved." - echo " Consider committing or stashing them before upgrade." - uncommitted_files=$(git status --porcelain | wc -l) - echo " Number of modified files: $uncommitted_files" - fi - - # Last commit info - if git rev-parse HEAD >/dev/null 2>&1; then - last_commit=$(git log -1 --format="%h - %s (%cr)" 2>/dev/null) - echo " 📝 Last commit: $last_commit" - fi - else - echo " ⚠️ Not a git repository" - echo " Consider initializing git for better version control:" - echo " git init && git add . && git commit -m 'Initial ZaneyOS configuration'" - fi - echo "" - - # Check for other common customization locations - echo "🔍 OTHER CUSTOMIZATIONS ANALYSIS:" - other_custom_found=false - - # Check for custom modules - if [ -d "./modules" ]; then - echo " 📂 Checking modules directory for customizations..." - # Find any .nix files that might be custom - find ./modules -name "*.nix" -type f | while read -r file; do - if [[ "$file" =~ (personal|custom|local) ]]; then - echo " ⚠️ $file - PERSONAL/CUSTOM FILE (REQUIRES MANUAL MERGE)" - other_custom_found=true - fi - done - fi - - # Check for wallpapers - if [ -d "./wallpapers" ]; then - wallpaper_count=$(find ./wallpapers -type f | wc -l) - if [ "$wallpaper_count" -gt 10 ]; then # Assuming default has ~10 wallpapers - echo " 🖼️ Custom wallpapers detected: $wallpaper_count total (WILL BE PRESERVED)" - fi - fi - - if [ "$other_custom_found" = false ]; then - echo " ✅ No other major customizations detected" - fi - echo "" - - # Migration summary - echo "============================================" - echo "📋 MIGRATION SUMMARY:" - echo "============================================" - echo "" - echo "✅ WILL BE AUTOMATICALLY MIGRATED:" - echo " • All host configurations (variables.nix with 2.4 format conversion)" - echo " • Hardware configurations (hardware.nix)" - echo " • Host-specific packages (host-packages.nix)" - echo " • Customized host imports (default.nix if modified)" - echo " • Global packages (modules/core/packages.nix if customized)" - echo " • Wallpapers and themes" - echo "" - echo "⚠️ REQUIRES MANUAL ATTENTION AFTER UPGRADE:" - if [ "$custom_inputs" != " None detected" ]; then - echo " • Custom flake.nix inputs - you'll need to re-add these" - fi - if [ "$shell_custom_found" = true ]; then - echo " • Shell customizations (zsh/bash personal files and modifications)" - fi - if [ "$other_custom_found" = true ]; then - echo " • Custom/personal module files" - fi - # Check for Hyprland configs to add to manual attention list - if [ -d "./modules/home/hyprland" ] && [ "$(find ./modules/home/hyprland -name '*.nix' -type f 2>/dev/null | wc -l)" -gt 0 ]; then - echo " • 🚨 HYPRLAND CONFIGURATIONS - Cannot be auto-migrated, manual review required" - fi - if [ "$custom_inputs" = " None detected" ] && [ "$shell_custom_found" = false ] && [ "$other_custom_found" = false ]; then - echo " • No manual intervention required - standard configuration detected!" - fi - echo "" - echo "📁 BACKUP LOCATION (after upgrade starts):" - echo " ~/.config/zaneyos-backups/zaneyos-2.3-upgrade-backup-$TIMESTAMP/" - echo "" - echo "📝 POST-UPGRADE TODO:" - echo " 1. Reboot system after successful upgrade" - echo " 2. Verify all applications and settings work correctly" - if [ "$custom_inputs" != " None detected" ] || [ "$shell_custom_found" = true ] || [ "$other_custom_found" = true ]; then - echo " 3. Manually merge any flagged customizations from backup" - fi - echo " 4. Review new 2.4 features and packages" - echo "" - echo "============================================" - echo "End of Analysis Report" - echo "============================================" - - } | tee "$analysis_file" - - print_success "Analysis complete! Report saved to: $analysis_file" - echo "" - - # Ask user if they want to continue after seeing the analysis - prompt_yes "Based on this analysis, do you want to proceed with the upgrade? (Y/N):" - if [[ ! $REPLY =~ ^[Yy]$ ]]; then - print_info "Upgrade cancelled by user after analysis review." - print_info "Analysis report is saved for your reference at: $analysis_file" - exit 0 - fi -} - -# Run the pre-check analysis -perform_precheck_analysis - -# Create backup FIRST before making any changes -if ! create_backup; then - print_error "Failed to create backup. Aborting upgrade." - exit 1 -fi - -# Confirm with user before proceeding -echo "" -echo -e "${GREEN}✅ Backup created successfully!${NC}" -echo -e "${YELLOW}📍 Backup location: $BACKUP_DIR${NC}" -echo "" -prompt_yes "Continue with the upgrade to ZaneyOS 2.4? (Y/N):" -if [[ ! $REPLY =~ ^[Yy]$ ]]; then - print_info "Upgrade cancelled by user." - print_info "Your backup is preserved at: $BACKUP_DIR" - exit 0 -fi - -print_header "Fetching ZaneyOS 2.4" - -# Switch to main robustly, handling uncommitted changes and divergent branches -switch_to_main_handling_dirty - -print_header "Discovering Host Configurations" - -# Important: Discover hosts from the BACKUP, not the current working tree -# This ensures we preserve user hosts even if switching branches removed them -print_info "Discovering custom hosts from backup to avoid any branch-change side effects..." -HOST_DIRS=() -if [ -d "$BACKUP_DIR/zaneyos/hosts" ]; then - for dir in "$BACKUP_DIR/zaneyos/hosts"/*/; do - [ -d "$dir" ] || continue - hostname=$(basename "$dir") - if [ "$hostname" != "default" ]; then - HOST_DIRS+=("$hostname") - fi - done -fi - -if [ ${#HOST_DIRS[@]} -eq 0 ]; then - print_error "No custom host configurations found in backup" - print_error "This upgrade script requires at least one custom host configuration" - exit 1 -fi - -print_success "Found ${#HOST_DIRS[@]} host configuration(s): ${HOST_DIRS[*]}" - -print_header "Upgrading Host Configurations" - -# Function to merge variables from 2.3 to 2.4 -merge_variables() { - local hostname=$1 - local old_vars_file="$BACKUP_DIR/zaneyos/hosts/$hostname/variables.nix" - local new_vars_file="./hosts/$hostname/variables.nix" - - print_info "Processing host: $hostname" - - # Create host directory if it doesn't exist - mkdir -p "./hosts/$hostname" - - # Copy the new 2.4 template - cp "./hosts/default/variables.nix" "$new_vars_file" - - # Extract values from old 2.3 configuration - if [ -f "$old_vars_file" ]; then - # Extract key values using more robust parsing - local git_username=$(grep 'gitUsername' "$old_vars_file" | sed 's/.*= *"\([^"]*\)".*/\1/') - local git_email=$(grep 'gitEmail' "$old_vars_file" | sed 's/.*= *"\([^"]*\)".*/\1/') - local browser=$(grep 'browser' "$old_vars_file" | sed 's/.*= *"\([^"]*\)".*/\1/') - local terminal=$(grep 'terminal' "$old_vars_file" | sed 's/.*= *"\([^"]*\)".*/\1/') - local keyboard_layout=$(grep 'keyboardLayout' "$old_vars_file" | sed 's/.*= *"\([^"]*\)".*/\1/') - local console_keymap=$(grep 'consoleKeyMap' "$old_vars_file" | sed 's/.*= *"\([^"]*\)".*/\1/') - local enable_nfs=$(grep 'enableNFS' "$old_vars_file" | sed 's/.*= *\([^;]*\);.*/\1/') - local print_enable=$(grep 'printEnable' "$old_vars_file" | sed 's/.*= *\([^;]*\);.*/\1/') - local thunar_enable=$(grep 'thunarEnable' "$old_vars_file" | sed 's/.*= *\([^;]*\);.*/\1/') - local clock_24h=$(grep 'clock24h' "$old_vars_file" | sed 's/.*= *\([^;]*\);.*/\1/') - - # Extract additional 2.4 variables that might exist in 2.3 - local doom_emacs_enable=$(grep 'doomEmacsEnable' "$old_vars_file" | sed 's/.*= *\([^;]*\);.*/\1/') - local intel_id=$(grep 'intelID' "$old_vars_file" | sed 's/.*= *"\([^"]*\)".*/\1/') - local nvidia_id=$(grep 'nvidiaID' "$old_vars_file" | sed 's/.*= *"\([^"]*\)".*/\1/') - local host_id=$(grep 'hostId' "$old_vars_file" | sed 's/.*= *"\([^"]*\)".*/\1/') - - # Apply the values to new configuration - [ -n "$git_username" ] && sed -i "s/gitUsername = \".*\";/gitUsername = \"$git_username\";/" "$new_vars_file" - [ -n "$git_email" ] && sed -i "s/gitEmail = \".*\";/gitEmail = \"$git_email\";/" "$new_vars_file" - [ -n "$browser" ] && sed -i "s/browser = \".*\";/browser = \"$browser\";/" "$new_vars_file" - [ -n "$terminal" ] && sed -i "s/terminal = \".*\";/terminal = \"$terminal\";/" "$new_vars_file" - [ -n "$keyboard_layout" ] && sed -i "s/keyboardLayout = \".*\";/keyboardLayout = \"$keyboard_layout\";/" "$new_vars_file" - [ -n "$console_keymap" ] && sed -i "s/consoleKeyMap = \".*\";/consoleKeyMap = \"$console_keymap\";/" "$new_vars_file" - [ -n "$enable_nfs" ] && sed -i "s/enableNFS = .*/enableNFS = $enable_nfs;/" "$new_vars_file" - [ -n "$print_enable" ] && sed -i "s/printEnable = .*/printEnable = $print_enable;/" "$new_vars_file" - [ -n "$thunar_enable" ] && sed -i "s/thunarEnable = .*/thunarEnable = $thunar_enable;/" "$new_vars_file" - [ -n "$clock_24h" ] && sed -i "s/clock24h = .*/clock24h = $clock_24h;/" "$new_vars_file" - - # Apply additional 2.4 variables if they existed in 2.3 - [ -n "$doom_emacs_enable" ] && sed -i "s/doomEmacsEnable = .*/doomEmacsEnable = $doom_emacs_enable;/" "$new_vars_file" - [ -n "$intel_id" ] && sed -i "s/intelID = \".*\";/intelID = \"$intel_id\";/" "$new_vars_file" - [ -n "$nvidia_id" ] && sed -i "s/nvidiaID = \".*\";/nvidiaID = \"$nvidia_id\";/" "$new_vars_file" - [ -n "$host_id" ] && sed -i "s/hostId = \".*\";/hostId = \"$host_id\";/" "$new_vars_file" - - # Handle terminal-specific enables - CRITICAL for 2.4 - case "$terminal" in - "alacritty") - sed -i "s/alacrittyEnable = false;/alacrittyEnable = true;/" "$new_vars_file" - print_success "✓ Enabled Alacritty for host $hostname" - ;; - "wezterm") - sed -i "s/weztermEnable = false;/weztermEnable = true;/" "$new_vars_file" - print_success "✓ Enabled WezTerm for host $hostname" - ;; - "ghostty") - sed -i "s/ghosttyEnable = false;/ghosttyEnable = true;/" "$new_vars_file" - print_success "✓ Enabled Ghostty for host $hostname" - ;; - "kitty") - print_info "✓ Kitty is enabled by default" - ;; - *) - print_warning "Unknown terminal '$terminal' - keeping kitty as default" - sed -i "s/terminal = \".*\";/terminal = \"kitty\";/" "$new_vars_file" - ;; - esac - - # Copy stylixImage, waybarChoice, and animChoice if they exist - local stylix_image=$(grep 'stylixImage' "$old_vars_file" | head -1) - if [ -n "$stylix_image" ]; then - # Replace the active stylixImage line - local line_num=$(grep -n 'stylixImage = .*mountainscapedark.jpg;' "$new_vars_file" | cut -d: -f1) - if [ -n "$line_num" ]; then - sed -i "${line_num}s|.*| $stylix_image|" "$new_vars_file" - print_success "✓ Preserved stylixImage setting" - fi - fi - - local waybar_choice=$(grep 'waybarChoice = ' "$old_vars_file" | grep -v '^[[:space:]]*#') - if [ -n "$waybar_choice" ]; then - # Replace the active waybarChoice line - local line_num=$(grep -n 'waybarChoice = .*waybar-curved.nix;' "$new_vars_file" | cut -d: -f1) - if [ -n "$line_num" ]; then - sed -i "${line_num}s|.*| $waybar_choice|" "$new_vars_file" - print_success "✓ Preserved waybarChoice setting" - fi - fi - - local anim_choice=$(grep 'animChoice = ' "$old_vars_file" | grep -v '^[[:space:]]*#') - if [ -n "$anim_choice" ]; then - # Replace the active animChoice line - local line_num=$(grep -n 'animChoice = .*animations-def.nix;' "$new_vars_file" | cut -d: -f1) - if [ -n "$line_num" ]; then - sed -i "${line_num}s|.*| $anim_choice|" "$new_vars_file" - print_success "✓ Preserved animChoice setting" - fi - fi - - # Handle monitor settings - local monitor_start=$(grep -n 'extraMonitorSettings = "' "$old_vars_file" | cut -d: -f1) - if [ -n "$monitor_start" ]; then - local monitor_end=$(tail -n +"$monitor_start" "$old_vars_file" | grep -n '";' | head -1 | cut -d: -f1) - if [ -n "$monitor_end" ]; then - local total_end=$((monitor_start + monitor_end - 1)) - local monitor_settings=$(sed -n "${monitor_start},${total_end}p" "$old_vars_file") - - # Replace the monitor settings in new file - local new_monitor_start=$(grep -n 'extraMonitorSettings = "' "$new_vars_file" | cut -d: -f1) - if [ -n "$new_monitor_start" ]; then - local new_monitor_end=$(tail -n +"$new_monitor_start" "$new_vars_file" | grep -n '";' | head -1 | cut -d: -f1) - if [ -n "$new_monitor_end" ]; then - local new_total_end=$((new_monitor_start + new_monitor_end - 1)) - # Delete old monitor settings and insert new ones - sed -i "${new_monitor_start},${new_total_end}d" "$new_vars_file" - sed -i "$((new_monitor_start - 1))r /dev/stdin" "$new_vars_file" <<< "$monitor_settings" - print_success "✓ Preserved monitor settings" - fi - fi - fi - fi - - # Final safety: remove any duplicate keys that might have slipped in - cleanup_duplicates "$new_vars_file" - - print_success "Configuration merged for host: $hostname" - else - print_warning "No backup found for host: $hostname, using defaults" - fi - - # Also copy hardware.nix if it exists - if [ -f "$BACKUP_DIR/zaneyos/hosts/$hostname/hardware.nix" ]; then - cp "$BACKUP_DIR/zaneyos/hosts/$hostname/hardware.nix" "./hosts/$hostname/" - print_success "✓ Preserved hardware.nix for host: $hostname" - fi - - # Also copy host-packages.nix if it exists (user's custom packages) - if [ -f "$BACKUP_DIR/zaneyos/hosts/$hostname/host-packages.nix" ]; then - cp "$BACKUP_DIR/zaneyos/hosts/$hostname/host-packages.nix" "./hosts/$hostname/" - print_success "✓ Preserved host-packages.nix for host: $hostname" - fi - - # Also copy default.nix if it was customized (compare with template first) - if [ -f "$BACKUP_DIR/zaneyos/hosts/$hostname/default.nix" ]; then - # Check if it's different from the template default.nix - if ! cmp -s "$BACKUP_DIR/zaneyos/hosts/$hostname/default.nix" "./hosts/default/default.nix"; then - cp "$BACKUP_DIR/zaneyos/hosts/$hostname/default.nix" "./hosts/$hostname/" - print_success "✓ Preserved customized default.nix for host: $hostname" - else - print_info "✓ Using template default.nix for host: $hostname (no customizations detected)" - fi - fi -} - -# Process each host -for hostname in "${HOST_DIRS[@]}"; do - merge_variables "$hostname" -done - -print_header "Checking Global Package Customizations" - -# Check if user has customized the global packages.nix file -if [ -f "$BACKUP_DIR/zaneyos/modules/core/packages.nix" ]; then - print_info "Checking for custom packages in global packages.nix..." - - # Compare with new template to see if there are customizations - if ! cmp -s "$BACKUP_DIR/zaneyos/modules/core/packages.nix" "./modules/core/packages.nix"; then - print_warning "Custom packages detected in global packages.nix" - - # Create a backup of the new packages.nix - cp "./modules/core/packages.nix" "./modules/core/packages.nix.template" - - # Copy the user's customized version - cp "$BACKUP_DIR/zaneyos/modules/core/packages.nix" "./modules/core/packages.nix" - - print_success "✓ Preserved custom global packages.nix" - print_info "📋 Note: Your custom packages have been preserved" - print_info "📋 New template available at: modules/core/packages.nix.template" - print_info "📋 You may want to review for new packages to add from the template" - - # Offer to show differences - echo "" - prompt_yes "Would you like to see what packages were added in 2.4? (Y/N):" - if [[ $REPLY =~ ^[Yy]$ ]]; then - print_info "New packages available in ZaneyOS 2.4:" - echo -e "${CYAN}=== Differences between your packages.nix and 2.4 template ===${NC}" - diff -u "./modules/core/packages.nix" "./modules/core/packages.nix.template" || true - echo "" - print_info "You can manually add any new packages you want from the template" - fi - else - print_success "✓ No custom packages detected - using new 2.4 packages.nix" - fi -else - print_warning "No backup found for modules/core/packages.nix - using defaults" -fi - -# Function to detect and update flake.nix with user's actual configuration -update_flake_configuration() { - print_header "Updating Flake Configuration" - - # Detect current username (prefer from old config, fallback to current user) - local detected_username - if [ -n "${HOST_DIRS[0]}" ] && [ -f "$BACKUP_DIR/zaneyos/hosts/${HOST_DIRS[0]}/variables.nix" ]; then - detected_username=$(grep 'gitUsername' "$BACKUP_DIR/zaneyos/hosts/${HOST_DIRS[0]}/variables.nix" | sed 's/.*= *"\([^"]*\)".*/\1/' | head -1) - fi - detected_username=${detected_username:-$(whoami)} - - # Detect current hostname (prefer from system, fallback to first host directory) - local detected_hostname=$(hostname) - if [[ "$detected_hostname" == "nixos" ]] || [[ -z "$detected_hostname" ]]; then - detected_hostname=${HOST_DIRS[0]} - fi - - # Detect GPU profile from hardware or ask user - local detected_profile="vm" # default fallback - print_info "Detecting GPU profile..." - - # Check for NVIDIA - if lspci | grep -i nvidia >/dev/null 2>&1; then - # Check if it's a laptop/mobile GPU - if lspci | grep -i nvidia | grep -i "mobile\|laptop" >/dev/null 2>&1; then - detected_profile="nvidia-laptop" - else - detected_profile="nvidia" - fi - # Check for AMD - elif lspci | grep -i amd | grep -i "VGA\|Display" >/dev/null 2>&1; then - detected_profile="amd" - # Check for Intel - elif lspci | grep -i intel | grep -i "VGA\|Display" >/dev/null 2>&1; then - detected_profile="intel" - # Check if we're in a VM environment - elif systemd-detect-virt >/dev/null 2>&1; then - detected_profile="vm" - print_info "Virtual machine environment detected" - fi - - print_info "Detected configuration:" - print_info " Username: $detected_username" - print_info " Hostname: $detected_hostname" - print_info " GPU Profile: $detected_profile" - - # Confirm with user before updating - echo "" - prompt_yes "Update flake.nix with detected configuration? (Y/N):" - if [[ ! $REPLY =~ ^[Yy]$ ]]; then - print_warning "Skipping flake.nix update - using current values" - return 0 - fi - - # Update flake.nix with detected values - print_info "Updating flake.nix..." - sed -i "s/username = \"[^\"]*\";/username = \"$detected_username\";/" ./flake.nix - sed -i "s/host = \"[^\"]*\";/host = \"$detected_hostname\";/" ./flake.nix - sed -i "s/profile = \"[^\"]*\";/profile = \"$detected_profile\";/" ./flake.nix - - print_success "✓ Updated flake.nix with detected configuration" - - # Show what was updated - print_info "Updated flake.nix contents:" - echo -e "${CYAN}$(grep -A 3 -E 'host =|username =|profile =' ./flake.nix)${NC}" - echo "" -} - -# Update flake.nix with user's actual configuration -update_flake_configuration - -print_header "Building ZaneyOS 2.4" - -print_warning "Using 'boot' option to avoid SDDM display issues" -print_info "This is safer than 'switch' when changing display managers" - -# Get the GPU profile from flake.nix (this determines which nixosConfiguration to use) -# The actual build target is the GPU profile (amd, nvidia, nvidia-laptop, intel, vm) -# not the internal 'profile' variable which is just passed to modules -GPU_PROFILE=$(grep 'profile = ' ./flake.nix | sed 's/.*= *"\([^"]*\)".*/\1/') -print_info "Using GPU profile for build: $GPU_PROFILE" - -# Build the system -echo "" -prompt_yes "Ready to build ZaneyOS 2.4? This may take several minutes. (Y/N):" -if [[ ! $REPLY =~ ^[Yy]$ ]]; then - print_info "Build cancelled. You can run this script again later." - print_info "To revert to 2.3: $0 --revert" - exit 0 -fi - -print_info "Starting build process..." - -BUILD_SUCCESS=false - -if [ "$USE_NH" = true ]; then - print_info "Using NH for build..." - if nh os boot ~/zaneyos --hostname "$GPU_PROFILE"; then - BUILD_SUCCESS=true - fi -else - print_info "Using nixos-rebuild for build..." - if sudo nixos-rebuild boot --flake ~/zaneyos/#"$GPU_PROFILE"; then - BUILD_SUCCESS=true - fi -fi - -print_header "Upgrade Results" - -if [ "$BUILD_SUCCESS" = true ]; then - print_success_banner - - echo "" - echo -e "${CYAN}🔧 Key Changes in ZaneyOS 2.4:${NC}" - echo -e " • SDDM is now the default display manager" - echo -e " • Terminal applications can be individually enabled/disabled" - echo -e " • New application enable/disable toggles available" - echo -e " • Improved configuration structure" - echo "" - - echo -e "${YELLOW}📝 Next Steps:${NC}" - echo -e " 1. Reboot your system to complete the upgrade" - echo -e " 2. SDDM will be your new login screen" - echo -e " 3. Your custom settings have been preserved" - echo -e " 4. Check that all your preferred applications are still available" - echo "" - - echo -e "${CYAN}🔄 Revert Option:${NC}" - echo -e " If you encounter issues, run: $0 --revert" - echo -e " Your 2.3 backup is preserved at: $BACKUP_DIR" - echo "" - - # Prompt for reboot - prompt_yes "Would you like to reboot now? (Y/N):" - if [[ $REPLY =~ ^[Yy]$ ]]; then - print_info "Rebooting in 5 seconds... (Press Ctrl+C to cancel)" - sleep 5 - sudo reboot - else - echo -e "${GREEN}✅ Upgrade complete! Remember to reboot when convenient.${NC}" - fi - -else - print_failure_banner - echo "" - echo -e "${YELLOW}🔄 Recovery Options:${NC}" - echo -e " • Run revert command: $0 --revert" - echo -e " • Your backup is available at: $BACKUP_DIR" - echo -e " • Review the log file: $LOG_FILE" - echo "" - - prompt_yes "Would you like to automatically revert to ZaneyOS 2.3? (Y/N):" - if [[ $REPLY =~ ^[Yy]$ ]]; then - revert_from_backup - else - print_info "Manual revert available with: $0 --revert" - fi - - exit 1 -fi diff --git a/profiles/amd-nvidia-hybrid/default.nix b/profiles/amd-nvidia-hybrid/default.nix index 783bca3..f4386eb 100644 --- a/profiles/amd-nvidia-hybrid/default.nix +++ b/profiles/amd-nvidia-hybrid/default.nix @@ -1,24 +1,22 @@ -{host, ...}: let - inherit (import ../../hosts/${host}/variables.nix) amdgpuID nvidiaID; -in { - imports = [ - ../../hosts/${host} - ../../modules/drivers - ../../modules/core - ]; +{ + config, + lib, + ... +}: { + config = lib.mkIf (config.zaneyos.gpuProfile == "amd-nvidia-hybrid") { + # Enable AMD+NVIDIA hybrid drivers (Prime offload with AMD as primary) + drivers.nvidia-amd-hybrid = { + enable = true; + amdgpuBusId = config.zaneyos.amdgpuID; + nvidiaBusId = config.zaneyos.nvidiaID; + }; - # Enable AMD+NVIDIA hybrid drivers (Prime offload with AMD as primary) - drivers.nvidia-amd-hybrid = { - enable = true; - amdgpuBusId = "${amdgpuID}"; - nvidiaBusId = "${nvidiaID}"; + # Ensure other driver toggles are off for this profile + drivers.amdgpu.enable = false; + drivers.nvidia.enable = false; + drivers.nvidia-prime.enable = false; + drivers.intel.enable = false; + + vm.guest-services.enable = false; }; - - # Ensure other driver toggles are off for this profile - drivers.amdgpu.enable = false; - drivers.nvidia.enable = false; - drivers.nvidia-prime.enable = false; - drivers.intel.enable = false; - - vm.guest-services.enable = false; } diff --git a/profiles/amd/default.nix b/profiles/amd/default.nix index 1b5506b..4006b56 100644 --- a/profiles/amd/default.nix +++ b/profiles/amd/default.nix @@ -1,13 +1,14 @@ -{host, ...}: { - imports = [ - ../../hosts/${host} - ../../modules/drivers - ../../modules/core - ]; - # Enable GPU Drivers - drivers.amdgpu.enable = true; - drivers.nvidia.enable = false; - drivers.nvidia-prime.enable = false; - drivers.intel.enable = false; - vm.guest-services.enable = false; +{ + config, + lib, + ... +}: { + config = lib.mkIf (config.zaneyos.gpuProfile == "amd") { + # Enable GPU Drivers + drivers.amdgpu.enable = true; + drivers.nvidia.enable = false; + drivers.nvidia-prime.enable = false; + drivers.intel.enable = false; + vm.guest-services.enable = false; + }; } diff --git a/profiles/default.nix b/profiles/default.nix new file mode 100644 index 0000000..c34d9d5 --- /dev/null +++ b/profiles/default.nix @@ -0,0 +1,10 @@ +_: { + imports = [ + ./amd + ./amd-nvidia-hybrid + ./intel + ./nvidia + ./nvidia-laptop + ./vm + ]; +} diff --git a/profiles/intel/default.nix b/profiles/intel/default.nix index f99a114..3ed110e 100644 --- a/profiles/intel/default.nix +++ b/profiles/intel/default.nix @@ -1,13 +1,14 @@ -{host, ...}: { - imports = [ - ../../hosts/${host} - ../../modules/drivers - ../../modules/core - ]; - # Enable GPU Drivers - drivers.amdgpu.enable = false; - drivers.nvidia.enable = false; - drivers.nvidia-prime.enable = false; - drivers.intel.enable = true; - vm.guest-services.enable = false; +{ + config, + lib, + ... +}: { + config = lib.mkIf (config.zaneyos.gpuProfile == "intel") { + # Enable GPU Drivers + drivers.amdgpu.enable = false; + drivers.nvidia.enable = false; + drivers.nvidia-prime.enable = false; + drivers.intel.enable = true; + vm.guest-services.enable = false; + }; } diff --git a/profiles/nvidia-laptop/default.nix b/profiles/nvidia-laptop/default.nix index 2c4444b..45762a8 100644 --- a/profiles/nvidia-laptop/default.nix +++ b/profiles/nvidia-laptop/default.nix @@ -1,19 +1,18 @@ -{host, ...}: let - inherit (import ../../hosts/${host}/variables.nix) intelID nvidiaID; -in { - imports = [ - ../../hosts/${host} - ../../modules/drivers - ../../modules/core - ]; - # Enable GPU Drivers - drivers.amdgpu.enable = false; - drivers.nvidia.enable = true; - drivers.nvidia-prime = { - enable = true; - intelBusID = "${intelID}"; - nvidiaBusID = "${nvidiaID}"; +{ + config, + lib, + ... +}: { + config = lib.mkIf (config.zaneyos.gpuProfile == "nvidia-laptop") { + # Enable GPU Drivers + drivers.amdgpu.enable = false; + drivers.nvidia.enable = true; + drivers.nvidia-prime = { + enable = true; + intelBusID = config.zaneyos.intelID; + nvidiaBusID = config.zaneyos.nvidiaID; + }; + drivers.intel.enable = false; + vm.guest-services.enable = false; }; - drivers.intel.enable = false; - vm.guest-services.enable = false; } diff --git a/profiles/nvidia/default.nix b/profiles/nvidia/default.nix index 5b50370..26810f5 100644 --- a/profiles/nvidia/default.nix +++ b/profiles/nvidia/default.nix @@ -1,13 +1,14 @@ -{host, ...}: { - imports = [ - ../../hosts/${host} - ../../modules/drivers - ../../modules/core - ]; - # Enable GPU Drivers - drivers.amdgpu.enable = false; - drivers.nvidia.enable = true; - drivers.nvidia-prime.enable = false; - drivers.intel.enable = false; - vm.guest-services.enable = false; +{ + config, + lib, + ... +}: { + config = lib.mkIf (config.zaneyos.gpuProfile == "nvidia") { + # Enable GPU Drivers + drivers.amdgpu.enable = false; + drivers.nvidia.enable = true; + drivers.nvidia-prime.enable = false; + drivers.intel.enable = false; + vm.guest-services.enable = false; + }; } diff --git a/profiles/vm/default.nix b/profiles/vm/default.nix index 130c1b7..8df48de 100644 --- a/profiles/vm/default.nix +++ b/profiles/vm/default.nix @@ -1,13 +1,15 @@ -{host, ...}: { - imports = [ - ../../hosts/${host} - ../../modules/drivers - ../../modules/core - ]; - # Enable GPU Drivers - drivers.amdgpu.enable = false; - drivers.nvidia.enable = false; - drivers.nvidia-prime.enable = false; - drivers.intel.enable = false; - vm.guest-services.enable = true; +{ + config, + lib, + ... +}: { + config = lib.mkIf (config.zaneyos.gpuProfile == "vm") { + # Enable GPU Drivers + drivers.amdgpu.enable = false; + drivers.nvidia.enable = false; + drivers.nvidia-prime.enable = false; + drivers.intel.enable = false; + vm.guest-services.enable = true; + zaneyos.enableSmartD = lib.mkForce false; + }; } diff --git a/scripts/update_timezone.py b/scripts/update_timezone.py new file mode 100644 index 0000000..fec9eae --- /dev/null +++ b/scripts/update_timezone.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +import sys +import re +from pathlib import Path + +def main() -> int: + if len(sys.argv) != 3: + print("usage: update_timezone.py ", file=sys.stderr) + return 2 + path = Path(sys.argv[1]) + tz = sys.argv[2] + try: + text = path.read_text(encoding="utf-8") + except Exception as e: + print(f"error: unable to read {path}: {e}", file=sys.stderr) + return 1 + + pattern = re.compile(r'^(\s*time\.timeZone\s*=\s*")[^"]*(";\s*)$', re.M) + new_text, n = pattern.subn(lambda m: m.group(1) + tz + m.group(2), text, count=1) + + if n == 0: + print("warning: did not find a time.timeZone line to update", file=sys.stderr) + return 0 + + try: + path.write_text(new_text, encoding="utf-8") + except Exception as e: + print(f"error: unable to write {path}: {e}", file=sys.stderr) + return 1 + + return 0 + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/update_vars.py b/scripts/update_vars.py new file mode 100644 index 0000000..4155468 --- /dev/null +++ b/scripts/update_vars.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +import sys +import re +import pathlib + +def main() -> int: + if len(sys.argv) != 9: + print( + "usage: update_vars.py ", + file=sys.stderr, + ) + return 2 + + file_path = pathlib.Path(sys.argv[1]) + values = sys.argv[2:] + keys = [ + "gitUsername", + "gitEmail", + "hostName", + "gpuProfile", + "keyboardLayout", + "keyboardVariant", + "consoleKeyMap", + ] + + try: + text = file_path.read_text(encoding="utf-8") + except Exception as e: + print(f"error: unable to read {file_path}: {e}", file=sys.stderr) + return 1 + + for key, val in zip(keys, values): + # Replace lines of the form: key = "..."; + # Works whether the line is top-level or inside a block + pattern = re.compile(rf'^(\s*{re.escape(key)}\s*=\s*")[^"]*(";\s*)$', re.M) + text = pattern.sub(lambda m, v=val: m.group(1) + v + m.group(2), text) + + try: + file_path.write_text(text, encoding="utf-8") + except Exception as e: + print(f"error: unable to write {file_path}: {e}", file=sys.stderr) + return 1 + + return 0 + +if __name__ == "__main__": + raise SystemExit(main())