From da1fedaeb12691c14ec22d8daaefad1b9351a473 Mon Sep 17 00:00:00 2001 From: richen604 <56615615+richen604@users.noreply.github.com> Date: Thu, 24 Jul 2025 22:12:06 -0700 Subject: [PATCH 01/12] docs: add options.md guide and simplify template configuration --- README.md | 75 +++++++++---- TODO.md | 125 +++++++-------------- docs/assets/option-search.png | Bin 0 -> 41412 bytes docs/contributing.md | 3 +- docs/faq.md | 148 +------------------------ docs/options.md | 185 ++++++++++++++++++++++++++++++++ template/configuration.nix | 24 +---- template/modules/hm/default.nix | 93 +--------------- 8 files changed, 285 insertions(+), 368 deletions(-) create mode 100644 docs/assets/option-search.png create mode 100644 docs/options.md diff --git a/README.md b/README.md index d2fbd7f2..bd4e25f3 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@
@@ -85,33 +85,69 @@ Why Nix?: ## Documentation -- [Installation Options](#installation-options) +- [Installation](#installation) +- [Module Options](./docs/options.md) - [FAQ](./docs/faq.md) - [Troubleshooting & Issues](./docs/troubleshooting.md) - [Contributing](./docs/contributing.md) -## Installation Options - ---- +## Installation > [!CAUTION] -> Templated flake is designed for a minimal install of NixOS. +> The templated flake is designed for a minimal install of NixOS. Install NixOS first, then follow the instructions below. + +### Quick Start + +1. **Initialize the flake template** + + ```bash + # Create a new directory and initialize the template + mkdir hydenix-config && cd hydenix-config + nix flake init -t github:richen604/hydenix + ``` + +2. **Configure your system** + - Edit `configuration.nix` with your preferences + - Options requiring changes are marked with `! EDIT` + - *(Optional)* Review `./configuration.nix` and `./modules/hm/default.nix` for additional configuration options and overriding defaults, see [Module Options](./docs/options.md) for more information. + +3. **Generate hardware configuration** + + ```bash + sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix + ``` + +4. **Initialize git repository** -### 1. Template the Hydenix Flake + ```bash + git init && git add . + ``` -1. in a new directory, `nix flake init -t github:richen604/hydenix` -2. edit `configuration.nix` with your preferences for hydenix - - options needing to be changed are marked with `! EDIT` - - (optional) in your template flake folder, review both `./configuration.nix` and `./modules/hm/default.nix` for more options -3. run `sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix` -4. `git init && git add .` (flakes have to be managed via git) -5. run any of the packages in your new `flake.nix` - - for rebuild, use `sudo nixos-rebuild switch --flake .` -6. DON'T FORGET: change your password for all users with `passwd` from initialPassword set in `configuration.nix` + > **Note:** Flakes must be managed via git -NOTE: After launching hydenix, you can run `hyde-shell reload` to generate cache for remaining themes if you want. +5. **Build and switch to the new configuration** + + ```bash + sudo nixos-rebuild switch --flake .#nixos + ``` + +6. **Set user passwords** + + ```bash + passwd + ``` + + > **Important:** Change passwords for all users from the `initialPassword` set in `configuration.nix` + +### Post-Installation + +After launching Hydenix, you can generate cache for remaining themes: + +```bash +hyde-shell reload +``` -### 2. Trying Out Hydenix with a VM +## Running The Hydenix VM If your system supports it, the NixOS VM is a great way to try out hydenix without installing it. If you encounter issues running the VM, refer to the [virtio guide](docs/faq.md#how-do-i-run-hyprland-in-a-vm) @@ -140,7 +176,7 @@ inputs = { hydenix = { # Available inputs: # Main: github:richen604/hydenix - # Dev: github:richen604/hydenix/dev + # Dev: github:richen604/hydenix/dev # Commit: github:richen604/hydenix/B?fN
zr=^4JgeOet-E1TuEC$QDD7UsmtXERl$cBrM>aK>^%S3GkQy(sSq1)l3`tQS&3g~~S
z;?H|rt@IkY%*Uvo1Muvby`vI-Sp!?uo4!FJrS~J?PxC(}d=1l5(>QC$f MU;6iv! `spYn5FG
zEzal6N{48G$%co>iI0xE8EoAWe-cCdBeV$ag46-wfeUGpx)xA0yT8iV;hIXHh;t2d
z=L0jg8XFZTWaZ-#1}sL>JSY c@
zjA<#>#@lM+<>W;Lw0?GMZ435q8}i(R1B^Bq1#uqUe(1lRpQJ?C-MeCy+(kj%$9z}>
zdTXCsK)|L^I9O94OpXJ8+#Vufx>$e`ISzE(S|#q42P)*K@}}R{>eJHAjCJU#oK=@?
zN&CGoMEpORt}!^WF4}f%+qP{xnb@{7u_npH$;7s8XQGL1+qUiG_4i)As{VDW`u5S@
zYwdH^IxW kSakGnXBNJZ
zaa%{bqIRB&Ge~!#3g%CmMe?y|+cW!|^MD9Uu#{Rdi(hwkj`AD_9OvF9$q+aqy+&e9
zWXR=OAaw=Ia~zeKS}@s8SM1cSKl@lk4@-=ANcSYj*vumH{x<5)c0q<(DrKG7^aJ-!
zUl+)b)PVa~ko~$uzxN~b%(MAxex5_LBWAELR&Z7+OtX(ue1yNv3soKsFHDQ{FV;>$zKLe1PmBuQs&dZvCb;zU@Sgi
z%+ml>Jke%IvNG5#ZXg7_g*stmg%GoyY|tgs^hqTrDUZg3E`h8XView NixOS hydenix options
-
-```nix
-{
- hydenix = {
-
- #! Important options
- enable = true; # enable hydenix - required, default false
- hostname = "hydenix"; # hostname
- timezone = "America/Vancouver"; # timezone
- locale = "en_CA.UTF-8"; # locale
-
- #! Below are defaults
- audio.enable = true; # enable audio module
- boot = {
- enable = true; # enable boot module
- useSystemdBoot = true; # disable for GRUB
- grubTheme = "Retroboot"; # or "Pochita"
- grubExtraConfig = ""; # additional GRUB configuration
- kernelPackages = pkgs.linuxPackages_zen; # default zen kernel
- };
- gaming.enable = true; # enable gaming module
- hardware.enable = true; # enable hardware module
- network.enable = true; # enable network module
- nix.enable = true; # enable nix module
- sddm = {
- enable = true; # enable sddm module
- theme = "Candy" # or "Corners"
- };
- system.enable = true; # enable system module
- };
-}
-```
-
-View Home Manager hydenix options
-
-```nix
-{
- hydenix.hm = {
-
- #! Important options
- enable = true;
-
- #! Below are defaults
- comma.enable = true; # useful nix tool to run software without installing it first
- dolphin.enable = true; # file manager
- editors = {
- enable = true; # enable editors module
- neovim.enable = true; # enable neovim module
- vscode = {
- enable = true; # enable vscode module
- wallbash = true; # enable wallbash extension for vscode
- };
- vim.enable = true; # enable vim module
- default = "code"; # default text editor
- };
- fastfetch.enable = true; # fastfetch configuration
- firefox.enable = true; # enable firefox module
- gaming.enable = true; # enable gaming module
- git = {
- enable = true; # enable git module
- name = null; # git user name eg "John Doe"
- email = null; # git user email eg "john.doe@example.com"
- };
- hyde.enable = true; # enable hyde module
- hyprland = {
- enable = true; # enable hyprland module
- extraConfig = ""; # extra hyprland config text
- };
- lockscreen = {
- enable = true; # enable lockscreen module
- hyprlock = true; # enable hyprlock lockscreen
- swaylock = false; # enable swaylock lockscreen
- };
- notifications.enable = true; # enable notifications module
- qt.enable = true; # enable qt module
- rofi.enable = true; # enable rofi module
- screenshots = {
- enable = true; # enable screenshots module
- grim.enable = true; # enable grim screenshot tool
- slurp.enable = true; # enable slurp region selection tool
- satty.enable = false; # enable satty screenshot annotation tool
- swappy.enable = true; # enable swappy screenshot editor
- };
- wallpapers.enable = true; # enable wallpapers module
- shell = {
- enable = true; # enable shell module
- zsh = {
- enable = true; # enable zsh shell
- plugins = [ "sudo" ]; # zsh plugins
- configText = ""; # zsh config text
- };
- bash.enable = false; # enable bash shell
- fish.enable = false; # enable fish shell
- pokego.enable = false; # enable Pokemon ASCII art scripts
- p10k.enable = false; # enable p10k prompt
- starship.enable = true; # enable starship prompt
- };
- social = {
- enable = true; # enable social module
- discord.enable = true; # enable discord module
- webcord.enable = true; # enable webcord module
- vesktop.enable = true; # enable vesktop module
- };
- spotify.enable = true; # enable spotify module
- swww.enable = true; # enable swww wallpaper daemon
- terminals = {
- enable = true; # enable terminals module
- kitty = {
- enable = true; # enable kitty terminal
- configText = ""; # kitty config text
- };
- };
- theme = {
- enable = true; # enable theme module
- active = "Catppuccin Mocha"; # active theme name
- themes = [ "Catppuccin Mocha" "Catppuccin Latte" ]; # default enabled themes, full list in https://github.com/richen604/hydenix/tree/main/hydenix/sources/themes
- };
- waybar = {
- enable = true; # enable waybar module
- userStyle = ""; # custom waybar user-style.css
- };
- wlogout.enable = true; # enable wlogout module
- xdg.enable = true; # enable xdg module
- };
-}
-```
-
-
-
-
-
\ No newline at end of file
+
diff --git a/docs/options.md b/docs/options.md
new file mode 100644
index 00000000..aaba0629
--- /dev/null
+++ b/docs/options.md
@@ -0,0 +1,185 @@
+# Hydenix Options
+
+- [Hydenix Options](#hydenix-options)
+ - [Module Documentation](#module-documentation)
+ - [Required Options](#required-options)
+
+## Module Documentation
+
+The Nix options system *is* the documentation
+
+Let's walk through an example. Say you want to find info about `hydenix.hm.hyprland`.
+
+The easiest way is to search the GitHub repo for the options:
+
+[search for `hydenix.hm.hyprland`](https://github.com/richen604/hydenix/search?q=hydenix.hm.hyprland)
+
+You'll see the options in the search results, something like this:
+
+
+
+Click on the file to see the actual options definition, which looks something like this:
+
+```nix
+ options.hydenix.hm.hyprland = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ default = config.hydenix.hm.enable;
+ description = "Enable hyprland module";
+ };
+
+ extraConfig = lib.mkOption {
+ type = lib.types.lines;
+ default = "";
+ description = "Extra config for hyprland";
+ };
+ };
+```
+
+Notice that `extraConfig` has type `lines`, which means it accepts multiline strings.
+So you'd configure it like this:
+
+```nix
+hydenix.hm.hyprland.extraConfig = ''
+ # hyprland.conf
+ windowrule = float, ^(.*)
+''
+```
+
+You can find the full list of option types in the [NixOS manual](https://nlewo.github.io/nixos-manual-sphinx/development/option-types.xml.html).
+
+## Required Options
+
+These are the required options for hydenix.
+You *must* set these options or else hydenix will not load.
+
+```nix
+{
+ hydenix = {
+ enable = true; # enable hydenix - required, default false
+ hostname = "hydenix"; # hostname
+ timezone = "America/Vancouver"; # timezone
+ locale = "en_CA.UTF-8"; # locale
+ hm.enable = true;
+ };
+}
+```
+
+Below will be the default options for hydenix.
+
+```nix
+{
+ hydenix = {
+
+ #! Important options
+ enable = true; # enable hydenix - required, default false
+ hostname = "hydenix"; # hostname
+ timezone = "America/Vancouver"; # timezone
+ locale = "en_CA.UTF-8"; # locale
+
+ #! NixOS hydenix options
+ audio.enable = true; # enable audio module
+ boot = {
+ enable = true; # enable boot module
+ useSystemdBoot = true; # disable for GRUB
+ grubTheme = "Retroboot"; # or "Pochita"
+ grubExtraConfig = ""; # additional GRUB configuration
+ kernelPackages = pkgs.linuxPackages_zen; # default zen kernel
+ };
+ gaming.enable = true; # enable gaming module
+ hardware.enable = true; # enable hardware module
+ network.enable = true; # enable network module
+ nix.enable = true; # enable nix module
+ sddm = {
+ enable = true; # enable sddm module
+ theme = "Candy" # or "Corners"
+ };
+ system.enable = true; # enable system module
+
+ #! Home Manager hydenix options
+ hm = {
+ enable = true; # enable home-manager module
+ #! Below are defaults
+ comma.enable = true; # useful nix tool to run software without installing it first
+ dolphin.enable = true; # file manager
+ editors = {
+ enable = true; # enable editors module
+ neovim.enable = true; # enable neovim module
+ vscode = {
+ enable = true; # enable vscode module
+ wallbash = true; # enable wallbash extension for vscode
+ };
+ vim.enable = true; # enable vim module
+ default = "code"; # default text editor
+ };
+ fastfetch.enable = true; # fastfetch configuration
+ firefox.enable = true; # enable firefox module
+ gaming.enable = true; # enable gaming module
+ git = {
+ enable = true; # enable git module
+ name = null; # git user name eg "John Doe"
+ email = null; # git user email eg "john.doe@example.com"
+ };
+ hyde.enable = true; # enable hyde module
+ hyprland = {
+ enable = true; # enable hyprland module
+ extraConfig = ""; # extra hyprland config text
+ };
+ lockscreen = {
+ enable = true; # enable lockscreen module
+ hyprlock = true; # enable hyprlock lockscreen
+ swaylock = false; # enable swaylock lockscreen
+ };
+ notifications.enable = true; # enable notifications module
+ qt.enable = true; # enable qt module
+ rofi.enable = true; # enable rofi module
+ screenshots = {
+ enable = true; # enable screenshots module
+ grim.enable = true; # enable grim screenshot tool
+ slurp.enable = true; # enable slurp region selection tool
+ satty.enable = false; # enable satty screenshot annotation tool
+ swappy.enable = true; # enable swappy screenshot editor
+ };
+ wallpapers.enable = true; # enable wallpapers module
+ shell = {
+ enable = true; # enable shell module
+ zsh = {
+ enable = true; # enable zsh shell
+ plugins = [ "sudo" ]; # zsh plugins
+ configText = ""; # zsh config text
+ };
+ bash.enable = false; # enable bash shell
+ fish.enable = false; # enable fish shell
+ pokego.enable = false; # enable Pokemon ASCII art scripts
+ p10k.enable = false; # enable p10k prompt
+ starship.enable = true; # enable starship prompt
+ };
+ social = {
+ enable = true; # enable social module
+ discord.enable = true; # enable discord module
+ webcord.enable = true; # enable webcord module
+ vesktop.enable = true; # enable vesktop module
+ };
+ spotify.enable = true; # enable spotify module
+ swww.enable = true; # enable swww wallpaper daemon
+ terminals = {
+ enable = true; # enable terminals module
+ kitty = {
+ enable = true; # enable kitty terminal
+ configText = ""; # kitty config text
+ };
+ };
+ theme = {
+ enable = true; # enable theme module
+ active = "Catppuccin Mocha"; # active theme name
+ themes = [ "Catppuccin Mocha" "Catppuccin Latte" ]; # default enabled themes, full list in https://github.com/richen604/hydenix/tree/main/hydenix/sources/themes
+ };
+ waybar = {
+ enable = true; # enable waybar module
+ userStyle = ""; # custom waybar user-style.css
+ };
+ wlogout.enable = true; # enable wlogout module
+ xdg.enable = true; # enable xdg module
+ };
+ };
+}
diff --git a/template/configuration.nix b/template/configuration.nix
index 6881c9ee..2273a470 100644
--- a/template/configuration.nix
+++ b/template/configuration.nix
@@ -76,7 +76,6 @@ in
};
};
- # IMPORTANT: Customize the following values to match your preferences
hydenix = {
enable = true; # Enable the Hydenix module
@@ -85,28 +84,7 @@ in
timezone = "America/Vancouver"; # Change to your timezone
locale = "en_CA.UTF-8"; # Change to your preferred locale
- /*
- Optionally edit the below values, or leave to use hydenix defaults
- visit ./modules/hm/default.nix for more options
-
- audio.enable = true; # enable audio module
- boot = {
- enable = true; # enable boot module
- useSystemdBoot = true; # disable for GRUB
- grubTheme = "Retroboot"; # or "Pochita"
- grubExtraConfig = ""; # additional GRUB configuration
- kernelPackages = pkgs.linuxPackages_zen; # default zen kernel
- };
- gaming.enable = true; # enable gaming module
- hardware.enable = true; # enable hardware module
- network.enable = true; # enable network module
- nix.enable = true; # enable nix module
- sddm = {
- enable = true; # enable sddm module
- theme = "Candy"; # or "Corners"
- };
- system.enable = true; # enable system module
- */
+ # Visit https://github.com/richen604/hydenix/blob/main/docs/options.md for more options
};
#! EDIT THESE VALUES (must match users defined above)
diff --git a/template/modules/hm/default.nix b/template/modules/hm/default.nix
index 0e10dfa8..ec4ce80c 100644
--- a/template/modules/hm/default.nix
+++ b/template/modules/hm/default.nix
@@ -12,95 +12,6 @@
];
# hydenix home-manager options go here
- hydenix.hm = {
- #! Important options
- enable = true;
- /*
- ! Below are defaults, no need to uncomment them all
- comma.enable = true; # useful nix tool to run software without installing it first
- dolphin.enable = true; # file manager
- editors = {
- enable = true; # enable editors module
- neovim = true; # enable neovim module
- neovim = true; # enable neovim module
- vscode = {
- enable = true; # enable vscode module
- wallbash = true; # enable wallbash extension for vscode
- };
- vim = true; # enable vim module
- default = "code"; # default text editor
- vim = true; # enable vim module
- default = "code"; # default text editor
- };
- fastfetch.enable = true; # fastfetch configuration
- firefox.enable = true; # enable firefox module
- git = {
- enable = true; # enable git module
- name = null; # git user name eg "John Doe"
- email = null; # git user email eg "john.doe@example.com"
- };
- hyde.enable = true; # enable hyde module
- hyprland = {
- enable = true; # enable hyprland module
- extraConfig = ""; # extra hyprland config text
- };
- lockscreen = {
- enable = true; # enable lockscreen module
- hyprlock = true; # enable hyprlock lockscreen
- swaylock = false; # enable swaylock lockscreen
- };
- notifications.enable = true; # enable notifications module
- qt.enable = true; # enable qt module
- rofi.enable = true; # enable rofi module
- screenshots = {
- enable = true; # enable screenshots module
- grim.enable = true; # enable grim screenshot tool
- slurp.enable = true; # enable slurp region selection tool
- satty.enable = false; # enable satty screenshot annotation tool
- swappy.enable = true; # enable swappy screenshot editor
- };
- shell = {
- enable = true; # enable shell module
- zsh = {
- enable = true; # enable zsh shell
- plugins = [ "sudo" ]; # zsh plugins
- configText = ""; # zsh config text
- };
- bash.enable = false; # enable bash shell
- fish.enable = false; # enable fish shell
- pokego.enable = false; # enable Pokemon ASCII art scripts
- p10k.enable = false; # enable p10k prompt
- starship.enable = true; # enable starship prompt
- };
- social = {
- enable = true; # enable social module
- discord.enable = true; # enable discord module
- webcord.enable = true; # enable webcord module
- vesktop.enable = true; # enable vesktop module
- };
- spotify.enable = true; # enable spotify module
- swww.enable = true; # enable swww wallpaper daemon
- terminals = {
- enable = true; # enable terminals module
- kitty = {
- enable = true; # enable kitty terminal
- configText = ""; # kitty config text
- };
- };
- theme = {
- enable = true; # enable theme module
- active = "Catppuccin Mocha"; # active theme name
- themes = [
- "Catppuccin Mocha"
- "Catppuccin Latte"
- ]; # default enabled themes, full list in https://github.com/richen604/hydenix/tree/main/hydenix/sources/themes
- };
- waybar = {
- enable = true; # enable waybar module
- userStyle = ""; # custom waybar user-style.css
- };
- wlogout.enable = true; # enable wlogout module
- xdg.enable = true; # enable xdg module
- */
- };
+ hydenix.hm.enable = true;
+ # Visit https://github.com/richen604/hydenix/blob/main/docs/options.md for more options
}
From bd226bd5395991b2030e9f3ca3f4cf5ce2bbe391 Mon Sep 17 00:00:00 2001
From: richen604 <56615615+richen604@users.noreply.github.com>
Date: Thu, 24 Jul 2025 22:44:58 -0700
Subject: [PATCH 02/12] feat: added additional hyprland options
---
TODO.md | 5 +-
docs/options.md | 50 ++++-
hydenix/modules/hm/default.nix | 2 +-
hydenix/modules/hm/hyprland.nix | 164 ----------------
hydenix/modules/hm/hyprland/animations.nix | 72 +++++++
hydenix/modules/hm/hyprland/default.nix | 72 +++++++
hydenix/modules/hm/hyprland/hypridle.nix | 30 +++
hydenix/modules/hm/hyprland/keybindings.nix | 30 +++
hydenix/modules/hm/hyprland/monitors.nix | 29 +++
hydenix/modules/hm/hyprland/nvidia.nix | 30 +++
hydenix/modules/hm/hyprland/options.nix | 198 ++++++++++++++++++++
hydenix/modules/hm/hyprland/shaders.nix | 67 +++++++
hydenix/modules/hm/hyprland/windowrules.nix | 30 +++
hydenix/modules/hm/hyprland/workflows.nix | 66 +++++++
14 files changed, 677 insertions(+), 168 deletions(-)
delete mode 100644 hydenix/modules/hm/hyprland.nix
create mode 100644 hydenix/modules/hm/hyprland/animations.nix
create mode 100644 hydenix/modules/hm/hyprland/default.nix
create mode 100644 hydenix/modules/hm/hyprland/hypridle.nix
create mode 100644 hydenix/modules/hm/hyprland/keybindings.nix
create mode 100644 hydenix/modules/hm/hyprland/monitors.nix
create mode 100644 hydenix/modules/hm/hyprland/nvidia.nix
create mode 100644 hydenix/modules/hm/hyprland/options.nix
create mode 100644 hydenix/modules/hm/hyprland/shaders.nix
create mode 100644 hydenix/modules/hm/hyprland/windowrules.nix
create mode 100644 hydenix/modules/hm/hyprland/workflows.nix
diff --git a/TODO.md b/TODO.md
index c1c9c68e..fc6e3603 100644
--- a/TODO.md
+++ b/TODO.md
@@ -5,8 +5,8 @@
- docs: improved configuration guide
- docs: better hardware configuration guide, no default hardware options
-- feat: more hyprland options
- - explicit configuration
+- feat: move hyprlock to hyprland module, swaylock should just be swaylock module
+ - assertion to not have both enabled
- feat: new themes to build
## next api update
@@ -20,6 +20,7 @@
## backlog
- finish demo-vm for video
+- docs: documentation generation?
- feat: config.toml options
- chore: remove iso builder and ci, close issue related to it in favor of (hyde)nixos-anywhere
- chore: remove old vm builder
diff --git a/docs/options.md b/docs/options.md
index aaba0629..53661979 100644
--- a/docs/options.md
+++ b/docs/options.md
@@ -123,7 +123,55 @@ Below will be the default options for hydenix.
hyde.enable = true; # enable hyde module
hyprland = {
enable = true; # enable hyprland module
- extraConfig = ""; # extra hyprland config text
+ extraConfig = ""; # extra config appended to userprefs.conf
+ overrideMain = null; # complete override of hyprland.conf
+ # Animation configurations
+ animations = {
+ enable = true; # enable animation configurations
+ preset = "standard"; # animation preset: "classic", "diablo-1", "diablo-2", "dynamic", "disable", "eevee-1", "eevee-2", "high", "low-1", "low-2", "minimal-1", "minimal-2", "moving", "optimized", "standard", "vertical", "LimeFrenzy"
+ extraConfig = ""; # additional animation configuration
+ overrides = { }; # override specific animation files by name
+ };
+ # Shader configurations
+ shaders = {
+ enable = true; # enable shader configurations
+ overrides = { }; # override or add custom shaders
+ };
+ # Workflow configurations
+ workflows = {
+ enable = true; # enable workflow configurations
+ active = "default"; # active workflow preset: "default", "editing", "gaming", "powersaver", "snappy"
+ overrides = { }; # override or add custom workflows
+ };
+ # Hypridle configurations
+ hypridle = {
+ enable = true; # enable hypridle configurations
+ extraConfig = ""; # additional hypridle configuration
+ overrideConfig = null; # complete hypridle configuration override (null or lib.types.lines)
+ };
+ # Keybindings configurations
+ keybindings = {
+ enable = true; # enable keybindings configurations
+ extraConfig = ""; # additional keybindings configuration
+ overrideConfig = null; # complete keybindings configuration override (null or lib.types.lines)
+ };
+ # Window rules configurations
+ windowrules = {
+ enable = true; # enable window rules configurations
+ extraConfig = ""; # additional window rules configuration
+ overrideConfig = null; # complete window rules configuration override (null or lib.types.lines)
+ };
+ # NVIDIA configurations
+ nvidia = {
+ enable = false; # enable NVIDIA configurations (defaults to config.hardware.nvidia.enabled)
+ extraConfig = ""; # additional NVIDIA configuration
+ overrideConfig = null; # complete NVIDIA configuration override (null or lib.types.lines)
+ };
+ # Monitor configurations
+ monitors = {
+ enable = true; # enable monitor configurations
+ overrideConfig = null; # complete monitor configuration override (null or lib.types.lines)
+ };
};
lockscreen = {
enable = true; # enable lockscreen module
diff --git a/hydenix/modules/hm/default.nix b/hydenix/modules/hm/default.nix
index d70c0c75..331f22d3 100644
--- a/hydenix/modules/hm/default.nix
+++ b/hydenix/modules/hm/default.nix
@@ -15,7 +15,7 @@
./gtk.nix
./git.nix
./hyde.nix
- ./hyprland.nix
+ ./hyprland
./lockscreen.nix
./notifications.nix
./qt.nix
diff --git a/hydenix/modules/hm/hyprland.nix b/hydenix/modules/hm/hyprland.nix
deleted file mode 100644
index f5e21717..00000000
--- a/hydenix/modules/hm/hyprland.nix
+++ /dev/null
@@ -1,164 +0,0 @@
-{
- config,
- lib,
- pkgs,
- ...
-}:
-
-let
- cfg = config.hydenix.hm.hyprland;
-in
-{
-
- options.hydenix.hm.hyprland = {
- enable = lib.mkOption {
- type = lib.types.bool;
- default = config.hydenix.hm.enable;
- description = "Enable hyprland module";
- };
-
- extraConfig = lib.mkOption {
- type = lib.types.lines;
- default = "";
- description = "Extra config for hyprland";
- };
- };
-
- config = lib.mkIf cfg.enable {
- home.packages = with pkgs; [
- hyprcursor
- hyprutils
- xdg-desktop-portal-hyprland
- hyprpicker
- hypridle
- ];
-
- home.activation.createHyprConfigs = lib.hm.dag.entryAfter [ "mutableGeneration" ] ''
- mkdir -p "$HOME/.config/hypr/animations"
- mkdir -p "$HOME/.config/hypr/themes"
-
- touch "$HOME/.config/hypr/animations/theme.conf"
- touch "$HOME/.config/hypr/themes/colors.conf"
- touch "$HOME/.config/hypr/themes/theme.conf"
- touch "$HOME/.config/hypr/themes/wallbash.conf"
-
- chmod 644 "$HOME/.config/hypr/animations/theme.conf"
- chmod 644 "$HOME/.config/hypr/themes/colors.conf"
- chmod 644 "$HOME/.config/hypr/themes/theme.conf"
- chmod 644 "$HOME/.config/hypr/themes/wallbash.conf"
- '';
-
- home.file = {
- ".config/hypr/hyprland.conf" = {
- source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/hyprland.conf";
- force = true;
- };
- ".config/hypr/hyde.conf".source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/hyde.conf";
- ".config/hypr/keybindings.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/keybindings.conf";
- ".config/hypr/monitors.conf".source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/monitors.conf";
- ".config/hypr/nvidia.conf".source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/nvidia.conf";
- ".config/hypr/userprefs.conf" = {
- text = ''
- ${cfg.extraConfig}
- '';
- force = true;
- };
- ".config/hypr/windowrules.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/windowrules.conf";
- ".config/hypr/animations.conf" = {
- source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations.conf";
- force = true;
- mutable = true;
- };
- ".config/hypr/animations/classic.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/classic.conf";
- ".config/hypr/animations/diablo-1.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/diablo-1.conf";
- ".config/hypr/animations/diablo-2.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/diablo-2.conf";
- ".config/hypr/animations/dynamic.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/dynamic.conf";
- ".config/hypr/animations/disable.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/disable.conf";
- ".config/hypr/animations/eevee-1.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/eevee-1.conf";
- ".config/hypr/animations/eevee-2.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/eevee-2.conf";
- ".config/hypr/animations/high.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/high.conf";
- ".config/hypr/animations/low-1.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/low-1.conf";
- ".config/hypr/animations/low-2.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/low-2.conf";
- ".config/hypr/animations/minimal-1.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/minimal-1.conf";
- ".config/hypr/animations/minimal-2.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/minimal-2.conf";
- ".config/hypr/animations/moving.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/moving.conf";
- ".config/hypr/animations/optimized.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/optimized.conf";
- ".config/hypr/animations/standard.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/standard.conf";
- ".config/hypr/animations/vertical.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/vertical.conf";
- ".config/hypr/animations/LimeFrenzy.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/LimeFrenzy.conf";
- ".config/hypr/hypridle.conf".source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/hypridle.conf";
-
- # Shaders
- ".config/hypr/shaders/blue-light-filter.frag".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/blue-light-filter.frag";
- ".config/hypr/shaders/color-vision.frag".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/color-vision.frag";
- ".config/hypr/shaders/.compiled.cache.glsl" = {
- source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/.compiled.cache.glsl";
- force = true;
- mutable = true;
- };
- ".config/hypr/shaders.conf" = {
- source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders.conf";
- force = true;
- mutable = true;
- };
- ".config/hypr/shaders/custom.frag".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/custom.frag";
- ".config/hypr/shaders/disable.frag".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/disable.frag";
- ".config/hypr/shaders/grayscale.frag".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/grayscale.frag";
- ".config/hypr/shaders/invert-colors.frag".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/invert-colors.frag";
- ".config/hypr/shaders/oled.frag".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/oled.frag";
- ".config/hypr/shaders/oled-saver.frag".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/oled-saver.frag";
- ".config/hypr/shaders/paper.frag".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/paper.frag";
- ".config/hypr/shaders/vibrance.frag".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/vibrance.frag";
- ".config/hypr/shaders/wallbash.frag".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/wallbash.frag";
- ".config/hypr/shaders/wallbash.inc".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/wallbash.inc";
-
- # Workflows
- ".config/hypr/workflows.conf" = {
- source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/workflows.conf";
- force = true;
- mutable = true;
- };
- ".config/hypr/workflows/default.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/workflows/default.conf";
- ".config/hypr/workflows/editing.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/workflows/editing.conf";
- ".config/hypr/workflows/gaming.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/workflows/gaming.conf";
- ".config/hypr/workflows/powersaver.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/workflows/powersaver.conf";
- ".config/hypr/workflows/snappy.conf".source =
- "${pkgs.hydenix.hyde}/Configs/.config/hypr/workflows/snappy.conf";
- };
- };
-}
diff --git a/hydenix/modules/hm/hyprland/animations.nix b/hydenix/modules/hm/hyprland/animations.nix
new file mode 100644
index 00000000..deb90882
--- /dev/null
+++ b/hydenix/modules/hm/hyprland/animations.nix
@@ -0,0 +1,72 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+let
+ cfg = config.hydenix.hm.hyprland;
+
+ animationPresets = [
+ "classic"
+ "diablo-1"
+ "diablo-2"
+ "dynamic"
+ "disable"
+ "eevee-1"
+ "eevee-2"
+ "high"
+ "low-1"
+ "low-2"
+ "minimal-1"
+ "minimal-2"
+ "moving"
+ "optimized"
+ "standard"
+ "vertical"
+ "LimeFrenzy"
+ ];
+in
+{
+ config = lib.mkIf (cfg.enable && cfg.animations.enable) {
+ home.file = lib.mkMerge [
+ # Active animation preset
+ {
+ ".config/hypr/animations.conf" =
+ if cfg.animations.overrides ? ${cfg.animations.preset} then
+ {
+ text = ''
+ ${cfg.animations.overrides.${cfg.animations.preset}}
+ ${cfg.animations.extraConfig}
+ '';
+ force = true;
+ mutable = true;
+ }
+ else
+ {
+ source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/${cfg.animations.preset}.conf";
+ force = true;
+ mutable = true;
+ };
+ }
+
+ # All animation presets (with overrides)
+ (lib.listToAttrs (
+ map (preset: {
+ name = ".config/hypr/animations/${preset}.conf";
+ value =
+ if cfg.animations.overrides ? ${preset} then
+ {
+ text = cfg.animations.overrides.${preset};
+ force = true;
+ }
+ else
+ {
+ source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/animations/${preset}.conf";
+ };
+ }) animationPresets
+ ))
+ ];
+ };
+}
diff --git a/hydenix/modules/hm/hyprland/default.nix b/hydenix/modules/hm/hyprland/default.nix
new file mode 100644
index 00000000..a245861c
--- /dev/null
+++ b/hydenix/modules/hm/hyprland/default.nix
@@ -0,0 +1,72 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+let
+ cfg = config.hydenix.hm.hyprland;
+in
+{
+ imports = [
+ ./options.nix
+ ./animations.nix
+ ./shaders.nix
+ ./workflows.nix
+ ./hypridle.nix
+ ./keybindings.nix
+ ./windowrules.nix
+ ./nvidia.nix
+ ./monitors.nix
+ ];
+
+ config = lib.mkIf cfg.enable {
+ # Always include packages and base setup
+ home.packages = with pkgs; [
+ hyprcursor
+ hyprutils
+ xdg-desktop-portal-hyprland
+ hyprpicker
+ hypridle
+ ];
+
+ home.activation.createHyprConfigs = lib.hm.dag.entryAfter [ "mutableGeneration" ] ''
+ mkdir -p "$HOME/.config/hypr/animations"
+ mkdir -p "$HOME/.config/hypr/themes"
+ mkdir -p "$HOME/.config/hypr/shaders"
+ mkdir -p "$HOME/.config/hypr/workflows"
+
+ touch "$HOME/.config/hypr/animations/theme.conf"
+ touch "$HOME/.config/hypr/themes/colors.conf"
+ touch "$HOME/.config/hypr/themes/theme.conf"
+ touch "$HOME/.config/hypr/themes/wallbash.conf"
+
+ chmod 644 "$HOME/.config/hypr/animations/theme.conf"
+ chmod 644 "$HOME/.config/hypr/themes/colors.conf"
+ chmod 644 "$HOME/.config/hypr/themes/theme.conf"
+ chmod 644 "$HOME/.config/hypr/themes/wallbash.conf"
+ '';
+
+ home.file = {
+ ".config/hypr/hyprland.conf" =
+ if cfg.overrideMain != null then
+ {
+ text = cfg.overrideMain;
+ force = true;
+ }
+ else
+ {
+ source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/hyprland.conf";
+ force = true;
+ };
+
+ ".config/hypr/hyde.conf".source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/hyde.conf";
+
+ ".config/hypr/userprefs.conf" = {
+ text = cfg.extraConfig;
+ force = true;
+ };
+ };
+ };
+}
diff --git a/hydenix/modules/hm/hyprland/hypridle.nix b/hydenix/modules/hm/hyprland/hypridle.nix
new file mode 100644
index 00000000..b80b4054
--- /dev/null
+++ b/hydenix/modules/hm/hyprland/hypridle.nix
@@ -0,0 +1,30 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+let
+ cfg = config.hydenix.hm.hyprland;
+in
+{
+ config = lib.mkIf (cfg.enable && cfg.hypridle.enable) {
+ home.file = {
+ ".config/hypr/hypridle.conf" =
+ if cfg.hypridle.overrideConfig != null then
+ {
+ text = cfg.hypridle.overrideConfig;
+ force = true;
+ }
+ else
+ {
+ text = ''
+ ${lib.readFile "${pkgs.hydenix.hyde}/Configs/.config/hypr/hypridle.conf"}
+ ${cfg.hypridle.extraConfig}
+ '';
+ force = true;
+ };
+ };
+ };
+}
diff --git a/hydenix/modules/hm/hyprland/keybindings.nix b/hydenix/modules/hm/hyprland/keybindings.nix
new file mode 100644
index 00000000..dfe5f7de
--- /dev/null
+++ b/hydenix/modules/hm/hyprland/keybindings.nix
@@ -0,0 +1,30 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+let
+ cfg = config.hydenix.hm.hyprland;
+in
+{
+ config = lib.mkIf (cfg.enable && cfg.keybindings.enable) {
+ home.file = {
+ ".config/hypr/keybindings.conf" =
+ if cfg.keybindings.overrideConfig != null then
+ {
+ text = cfg.keybindings.overrideConfig;
+ force = true;
+ }
+ else
+ {
+ text = ''
+ ${lib.readFile "${pkgs.hydenix.hyde}/Configs/.config/hypr/keybindings.conf"}
+ ${cfg.keybindings.extraConfig}
+ '';
+ force = true;
+ };
+ };
+ };
+}
diff --git a/hydenix/modules/hm/hyprland/monitors.nix b/hydenix/modules/hm/hyprland/monitors.nix
new file mode 100644
index 00000000..7bd962f3
--- /dev/null
+++ b/hydenix/modules/hm/hyprland/monitors.nix
@@ -0,0 +1,29 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+let
+ cfg = config.hydenix.hm.hyprland;
+in
+{
+ config = lib.mkIf (cfg.enable && cfg.monitors.enable) {
+ home.file = {
+ ".config/hypr/monitors.conf" =
+ if cfg.monitors.overrideConfig != null then
+ {
+ text = cfg.monitors.overrideConfig;
+ force = true;
+ mutable = true;
+ }
+ else
+ {
+ source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/monitors.conf";
+ force = true;
+ mutable = true;
+ };
+ };
+ };
+}
diff --git a/hydenix/modules/hm/hyprland/nvidia.nix b/hydenix/modules/hm/hyprland/nvidia.nix
new file mode 100644
index 00000000..11842ac6
--- /dev/null
+++ b/hydenix/modules/hm/hyprland/nvidia.nix
@@ -0,0 +1,30 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+let
+ cfg = config.hydenix.hm.hyprland;
+in
+{
+ config = lib.mkIf (cfg.enable && cfg.nvidia.enable) {
+ home.file = {
+ ".config/hypr/nvidia.conf" =
+ if cfg.nvidia.overrideConfig != null then
+ {
+ text = cfg.nvidia.overrideConfig;
+ force = true;
+ }
+ else
+ {
+ text = ''
+ ${lib.readFile "${pkgs.hydenix.hyde}/Configs/.config/hypr/nvidia.conf"}
+ ${cfg.nvidia.extraConfig}
+ '';
+ force = true;
+ };
+ };
+ };
+}
diff --git a/hydenix/modules/hm/hyprland/options.nix b/hydenix/modules/hm/hyprland/options.nix
new file mode 100644
index 00000000..2644919c
--- /dev/null
+++ b/hydenix/modules/hm/hyprland/options.nix
@@ -0,0 +1,198 @@
+{
+ config,
+ lib,
+ ...
+}:
+
+let
+ cfg = config.hydenix.hm.hyprland;
+in
+{
+ options.hydenix.hm.hyprland = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ default = config.hydenix.hm.enable;
+ description = "Enable hyprland module";
+ };
+ extraConfig = lib.mkOption {
+ type = lib.types.lines;
+ default = "";
+ description = "Extra config appended to userprefs.conf";
+ };
+ overrideMain = lib.mkOption {
+ type = lib.types.nullOr lib.types.lines;
+ default = null;
+ description = "Complete override of hyprland.conf";
+ };
+
+ # Animation configurations
+ animations = {
+ enable = lib.mkEnableOption "animation configurations" // {
+ default = cfg.enable;
+ };
+ preset = lib.mkOption {
+ type = lib.types.enum [
+ "classic"
+ "diablo-1"
+ "diablo-2"
+ "dynamic"
+ "disable"
+ "eevee-1"
+ "eevee-2"
+ "high"
+ "low-1"
+ "low-2"
+ "minimal-1"
+ "minimal-2"
+ "moving"
+ "optimized"
+ "standard"
+ "vertical"
+ "LimeFrenzy"
+ ];
+ default = "standard";
+ description = "Animation preset to use";
+ };
+ extraConfig = lib.mkOption {
+ type = lib.types.lines;
+ default = "";
+ description = "Additional animation configuration";
+ };
+ overrides = lib.mkOption {
+ type = lib.types.attrsOf lib.types.lines;
+ default = { };
+ description = "Override specific animation files by name";
+ example = lib.literalExpression ''
+ {
+ "classic" = '''
+ animation = windows, 1, 5, default
+ ''';
+ }
+ '';
+ };
+ };
+
+ # Shader configurations
+ shaders = {
+ enable = lib.mkEnableOption "shader configurations" // {
+ default = cfg.enable;
+ };
+ overrides = lib.mkOption {
+ type = lib.types.attrsOf lib.types.lines;
+ default = { };
+ description = "Override or add custom shaders";
+ example = lib.literalExpression ''
+ {
+ "my-filter.frag" = '''
+ precision mediump float;
+ // Custom shader code
+ ''';
+ }
+ '';
+ };
+ };
+
+ # Workflow configurations
+ workflows = {
+ enable = lib.mkEnableOption "workflow configurations" // {
+ default = cfg.enable;
+ };
+ active = lib.mkOption {
+ type = lib.types.enum [
+ "default"
+ "editing"
+ "gaming"
+ "powersaver"
+ "snappy"
+ ];
+ default = "default";
+ description = "Active workflow preset";
+ };
+ overrides = lib.mkOption {
+ type = lib.types.attrsOf lib.types.lines;
+ default = { };
+ description = "Override or add custom workflows";
+ };
+ };
+
+ # Hypridle configurations
+ hypridle = {
+ enable = lib.mkEnableOption "hypridle configurations" // {
+ default = cfg.enable;
+ };
+ extraConfig = lib.mkOption {
+ type = lib.types.lines;
+ default = "";
+ description = "Additional hypridle configuration";
+ };
+ overrideConfig = lib.mkOption {
+ type = lib.types.nullOr lib.types.lines;
+ default = null;
+ description = "Complete hypridle configuration override";
+ };
+ };
+
+ # Keybindings configurations
+ keybindings = {
+ enable = lib.mkEnableOption "keybindings configurations" // {
+ default = cfg.enable;
+ };
+ extraConfig = lib.mkOption {
+ type = lib.types.lines;
+ default = "";
+ description = "Additional keybindings configuration";
+ };
+ overrideConfig = lib.mkOption {
+ type = lib.types.nullOr lib.types.lines;
+ default = null;
+ description = "Complete keybindings configuration override";
+ };
+ };
+
+ # Window rules configurations
+ windowrules = {
+ enable = lib.mkEnableOption "window rules configurations" // {
+ default = cfg.enable;
+ };
+ extraConfig = lib.mkOption {
+ type = lib.types.lines;
+ default = "";
+ description = "Additional window rules configuration";
+ };
+ overrideConfig = lib.mkOption {
+ type = lib.types.nullOr lib.types.lines;
+ default = null;
+ description = "Complete window rules configuration override";
+ };
+ };
+
+ # NVIDIA configurations
+ nvidia = {
+ enable = lib.mkEnableOption "NVIDIA configurations" // {
+ default = config.hardware.nvidia.enabled or false;
+ };
+ extraConfig = lib.mkOption {
+ type = lib.types.lines;
+ default = "";
+ description = "Additional NVIDIA configuration";
+ };
+ overrideConfig = lib.mkOption {
+ type = lib.types.nullOr lib.types.lines;
+ default = null;
+ description = "Complete NVIDIA configuration override";
+ };
+ };
+
+ # Monitor configurations
+ monitors = {
+ enable = lib.mkEnableOption "monitor configurations" // {
+ default = cfg.enable;
+ };
+ overrideConfig = lib.mkOption {
+ type = lib.types.nullOr lib.types.lines;
+ default = null;
+ description = "Complete monitor configuration override";
+ };
+ };
+ };
+}
diff --git a/hydenix/modules/hm/hyprland/shaders.nix b/hydenix/modules/hm/hyprland/shaders.nix
new file mode 100644
index 00000000..223eefc1
--- /dev/null
+++ b/hydenix/modules/hm/hyprland/shaders.nix
@@ -0,0 +1,67 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+let
+ cfg = config.hydenix.hm.hyprland;
+
+ standardShaders = [
+ "blue-light-filter"
+ "color-vision"
+ "custom"
+ "disable"
+ "grayscale"
+ "invert-colors"
+ "oled"
+ "oled-saver"
+ "paper"
+ "vibrance"
+ "wallbash"
+ ];
+in
+{
+ config = lib.mkIf (cfg.enable && cfg.shaders.enable) {
+ home.file = lib.mkMerge [
+ # Standard shaders (generated from list)
+ (lib.mkMerge [
+ # Generate standard shader files from list
+ (lib.listToAttrs (
+ map (shader: {
+ name = ".config/hypr/shaders/${shader}.frag";
+ value = {
+ source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/${shader}.frag";
+ };
+ }) standardShaders
+ ))
+
+ # Additional shader files
+ {
+ ".config/hypr/shaders/.compiled.cache.glsl" = {
+ source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/.compiled.cache.glsl";
+ force = true;
+ mutable = true;
+ };
+ ".config/hypr/shaders.conf" = {
+ source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders.conf";
+ force = true;
+ mutable = true;
+ };
+ ".config/hypr/shaders/wallbash.inc".source =
+ "${pkgs.hydenix.hyde}/Configs/.config/hypr/shaders/wallbash.inc";
+ }
+ ])
+
+ # Custom/override shaders
+ (lib.mapAttrs' (name: content: {
+ name = ".config/hypr/shaders/${name}";
+ value = {
+ text = content;
+ force = true;
+ };
+ }) cfg.shaders.overrides)
+ ];
+ };
+}
diff --git a/hydenix/modules/hm/hyprland/windowrules.nix b/hydenix/modules/hm/hyprland/windowrules.nix
new file mode 100644
index 00000000..889ba059
--- /dev/null
+++ b/hydenix/modules/hm/hyprland/windowrules.nix
@@ -0,0 +1,30 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+let
+ cfg = config.hydenix.hm.hyprland;
+in
+{
+ config = lib.mkIf (cfg.enable && cfg.windowrules.enable) {
+ home.file = {
+ ".config/hypr/windowrules.conf" =
+ if cfg.windowrules.overrideConfig != null then
+ {
+ text = cfg.windowrules.overrideConfig;
+ force = true;
+ }
+ else
+ {
+ text = ''
+ ${lib.readFile "${pkgs.hydenix.hyde}/Configs/.config/hypr/windowrules.conf"}
+ ${cfg.windowrules.extraConfig}
+ '';
+ force = true;
+ };
+ };
+ };
+}
diff --git a/hydenix/modules/hm/hyprland/workflows.nix b/hydenix/modules/hm/hyprland/workflows.nix
new file mode 100644
index 00000000..241bb93c
--- /dev/null
+++ b/hydenix/modules/hm/hyprland/workflows.nix
@@ -0,0 +1,66 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+let
+ cfg = config.hydenix.hm.hyprland;
+
+ workflowPresets = [
+ "default"
+ "editing"
+ "gaming"
+ "powersaver"
+ "snappy"
+ ];
+in
+{
+ config = lib.mkIf (cfg.enable && cfg.workflows.enable) {
+ home.file = lib.mkMerge [
+ # Active workflow
+ {
+ ".config/hypr/workflows.conf" =
+ if cfg.workflows.overrides ? ${cfg.workflows.active} then
+ {
+ text = cfg.workflows.overrides.${cfg.workflows.active};
+ force = true;
+ mutable = true;
+ }
+ else
+ {
+ source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/workflows/${cfg.workflows.active}.conf";
+ force = true;
+ mutable = true;
+ };
+ }
+
+ # All workflow presets (with overrides)
+ (lib.listToAttrs (
+ map (workflow: {
+ name = ".config/hypr/workflows/${workflow}.conf";
+ value =
+ if cfg.workflows.overrides ? ${workflow} then
+ {
+ text = cfg.workflows.overrides.${workflow};
+ force = true;
+ }
+ else
+ {
+ source = "${pkgs.hydenix.hyde}/Configs/.config/hypr/workflows/${workflow}.conf";
+ };
+ }) workflowPresets
+ ))
+
+ # Custom workflows (exclude the standard presets)
+ (lib.mapAttrs' (name: content: {
+ name = ".config/hypr/workflows/${name}.conf";
+ value = {
+ text = content;
+ force = true;
+ };
+ }) (lib.filterAttrs (name: _: !(lib.elem name workflowPresets)) cfg.workflows.overrides))
+ ];
+ };
+}
From 47ad99c3c40d31fd4e2c9ada3ce607f7e27c90d8 Mon Sep 17 00:00:00 2001
From: richen604 <56615615+richen604@users.noreply.github.com>
Date: Tue, 29 Jul 2025 20:52:46 -0700
Subject: [PATCH 03/12] feat: assertions for hm.hyprland and suppressWarnings
option
---
TODO.md | 4 +-
docs/options.md | 4 ++
hydenix/modules/hm/hyprland/assertions.nix | 53 ++++++++++++++++++++++
hydenix/modules/hm/hyprland/default.nix | 1 +
hydenix/modules/hm/hyprland/options.nix | 12 +++++
5 files changed, 73 insertions(+), 1 deletion(-)
create mode 100644 hydenix/modules/hm/hyprland/assertions.nix
diff --git a/TODO.md b/TODO.md
index fc6e3603..72ad49ea 100644
--- a/TODO.md
+++ b/TODO.md
@@ -4,6 +4,7 @@
## now / notes
- docs: improved configuration guide
+- docs: better documented first edits
- docs: better hardware configuration guide, no default hardware options
- feat: move hyprlock to hyprland module, swaylock should just be swaylock module
- assertion to not have both enabled
@@ -16,6 +17,8 @@
- fix: nix-index should be a module in hydenix only, its declared twice
- fix: rename nix-index home-manager module whatever new name
- feat: hydenix follows nixpkgs, no userPkgs overlays
+- feat: vscode-nix-ide part of editors, enabled by default
+- feat: themes as part of hydenix flake inputs
## backlog
@@ -24,7 +27,6 @@
- feat: config.toml options
- chore: remove iso builder and ci, close issue related to it in favor of (hyde)nixos-anywhere
- chore: remove old vm builder
-- docs: better documented first edits
- refactor: revise module hierarchy to be more clear and concise
- feat: assertions for common requirements
- feat: spicetify theme support? flatpak?
diff --git a/docs/options.md b/docs/options.md
index 53661979..3d1afa0e 100644
--- a/docs/options.md
+++ b/docs/options.md
@@ -3,6 +3,7 @@
- [Hydenix Options](#hydenix-options)
- [Module Documentation](#module-documentation)
- [Required Options](#required-options)
+ - [Default Options](#default-options)
## Module Documentation
@@ -65,6 +66,8 @@ You *must* set these options or else hydenix will not load.
}
```
+## Default Options
+
Below will be the default options for hydenix.
```nix
@@ -125,6 +128,7 @@ Below will be the default options for hydenix.
enable = true; # enable hyprland module
extraConfig = ""; # extra config appended to userprefs.conf
overrideMain = null; # complete override of hyprland.conf
+ suppressWarnings = false; # suppress warnings
# Animation configurations
animations = {
enable = true; # enable animation configurations
diff --git a/hydenix/modules/hm/hyprland/assertions.nix b/hydenix/modules/hm/hyprland/assertions.nix
new file mode 100644
index 00000000..6c193a07
--- /dev/null
+++ b/hydenix/modules/hm/hyprland/assertions.nix
@@ -0,0 +1,53 @@
+{
+ config,
+ lib,
+ ...
+}:
+
+let
+ cfg = config.hydenix.hm.hyprland;
+
+ # Collect all active overrides
+ activeOverrides = lib.filter (x: x != null && x != "") [
+ (lib.optionalString (cfg.hypridle.overrideConfig != null) "hypridle.overrideConfig")
+ (lib.optionalString (cfg.keybindings.overrideConfig != null) "keybindings.overrideConfig")
+ (lib.optionalString (cfg.windowrules.overrideConfig != null) "windowrules.overrideConfig")
+ (lib.optionalString (cfg.nvidia.overrideConfig != null) "nvidia.overrideConfig")
+ (lib.optionalString (cfg.monitors.overrideConfig != null) "monitors.overrideConfig")
+ (lib.optionalString (cfg.overrideMain != null) "overrideMain")
+ ];
+in
+{
+ config = lib.mkIf cfg.enable {
+ assertions = [
+ {
+ assertion = cfg.hypridle.overrideConfig == null || cfg.hypridle.overrideConfig != "";
+ message = "hydenix.hm.hyprland.hypridle.overrideConfig is set but empty. This will override Hyde defaults and may break the system. Set to null to use Hyde defaults or provide valid configuration.";
+ }
+ {
+ assertion = cfg.keybindings.overrideConfig == null || cfg.keybindings.overrideConfig != "";
+ message = "hydenix.hm.hyprland.keybindings.overrideConfig is set but empty. This will override Hyde defaults and may break the system. Set to null to use Hyde defaults or provide valid configuration.";
+ }
+ {
+ assertion = cfg.windowrules.overrideConfig == null || cfg.windowrules.overrideConfig != "";
+ message = "hydenix.hm.hyprland.windowrules.overrideConfig is set but empty. This will override Hyde defaults and may break the system. Set to null to use Hyde defaults or provide valid configuration.";
+ }
+ {
+ assertion = cfg.nvidia.overrideConfig == null || cfg.nvidia.overrideConfig != "";
+ message = "hydenix.hm.hyprland.nvidia.overrideConfig is set but empty. This will override Hyde defaults and may break the system. Set to null to use Hyde defaults or provide valid configuration.";
+ }
+ {
+ assertion = cfg.monitors.overrideConfig == null || cfg.monitors.overrideConfig != "";
+ message = "hydenix.hm.hyprland.monitors.overrideConfig is set but empty. This will override Hyde defaults and may break the system. Set to null to use Hyde defaults or provide valid configuration.";
+ }
+ {
+ assertion = cfg.overrideMain == null || cfg.overrideMain != "";
+ message = "hydenix.hm.hyprland.overrideMain is set but empty. This will completely override Hyde's hyprland.conf and may break the system. Set to null to use Hyde defaults or provide valid configuration.";
+ }
+ ];
+
+ warnings = lib.optionals (cfg.enable && activeOverrides != [ ] && !cfg.suppressWarnings) [
+ "hydenix.hm.hyprland: The following configs are overriding Hyde defaults. Note this may break hydenix, hope you know what you're doing! (set suppressWarnings = true to hide this warning): ${lib.concatStringsSep ", " activeOverrides}"
+ ];
+ };
+}
diff --git a/hydenix/modules/hm/hyprland/default.nix b/hydenix/modules/hm/hyprland/default.nix
index a245861c..27f1d4c0 100644
--- a/hydenix/modules/hm/hyprland/default.nix
+++ b/hydenix/modules/hm/hyprland/default.nix
@@ -11,6 +11,7 @@ in
{
imports = [
./options.nix
+ ./assertions.nix
./animations.nix
./shaders.nix
./workflows.nix
diff --git a/hydenix/modules/hm/hyprland/options.nix b/hydenix/modules/hm/hyprland/options.nix
index 2644919c..474b2288 100644
--- a/hydenix/modules/hm/hyprland/options.nix
+++ b/hydenix/modules/hm/hyprland/options.nix
@@ -24,6 +24,11 @@ in
default = null;
description = "Complete override of hyprland.conf";
};
+ suppressWarnings = lib.mkOption {
+ type = lib.types.bool;
+ default = false;
+ description = "Suppress warnings about configuration overrides";
+ };
# Animation configurations
animations = {
@@ -112,6 +117,13 @@ in
type = lib.types.attrsOf lib.types.lines;
default = { };
description = "Override or add custom workflows";
+ example = lib.literalExpression ''
+ {
+ "my-workflow.conf" = '''
+ // Custom workflow configuration
+ ''';
+ }
+ '';
};
};
From 9dd36630132831944d7b2ab49b4f064f4732c08b Mon Sep 17 00:00:00 2001
From: richen604 <56615615+richen604@users.noreply.github.com>
Date: Tue, 29 Jul 2025 21:56:48 -0700
Subject: [PATCH 04/12] refactor: cleaned up flake in preparation for next api
update
removed old vm builder
removed iso, closes #53 in favor of a future nixos-anywhere implementation
---
TODO.md | 10 +-
flake.nix | 100 ++----
hydenix/sources/overlay.nix | 3 -
lib/config/default.nix | 2 +-
lib/dev-shell.nix | 3 +-
lib/hyde-update/default.nix | 3 +-
lib/iso/default.nix | 326 -----------------
lib/iso/nixos-install.sh | 332 ------------------
lib/vms/hydevm/README.md | 148 --------
lib/vms/hydevm/default.nix | 291 ---------------
lib/vms/iso-vm.nix | 47 ---
vm/arch-vm.nix | 113 ------
vm/fedora-vm.nix | 148 --------
vm/scripts/install-nix.sh | 10 -
vm/scripts/install/arch-setup.sh | 131 -------
vm/scripts/install/darwin-setup.sh | 99 ------
vm/scripts/install/debian-setup.sh | 2 -
vm/scripts/install/fedora-setup.sh | 128 -------
vm/scripts/install/nixos-setup.sh | 2 -
vm/scripts/install/ubuntu-setup.sh | 15 -
vm/scripts/preseed/arch-preseed.sh | 76 ----
.../preseed/fedora-kickstart.ks.template | 67 ----
vm/scripts/vm-host/arch-setup.sh | 53 ---
vm/scripts/vm-host/darwin-setup.sh | 42 ---
vm/scripts/vm-host/debian-setup.sh | 41 ---
vm/scripts/vm-host/fedora-setup.sh | 38 --
vm/scripts/vm-host/nixos-setup.sh | 26 --
vm/scripts/vm-host/ubuntu-setup.sh | 41 ---
vm/vm-utils.nix | 77 ----
29 files changed, 40 insertions(+), 2334 deletions(-)
delete mode 100644 lib/iso/default.nix
delete mode 100644 lib/iso/nixos-install.sh
delete mode 100644 lib/vms/hydevm/README.md
delete mode 100644 lib/vms/hydevm/default.nix
delete mode 100644 lib/vms/iso-vm.nix
delete mode 100644 vm/arch-vm.nix
delete mode 100644 vm/fedora-vm.nix
delete mode 100644 vm/scripts/install-nix.sh
delete mode 100644 vm/scripts/install/arch-setup.sh
delete mode 100644 vm/scripts/install/darwin-setup.sh
delete mode 100644 vm/scripts/install/debian-setup.sh
delete mode 100644 vm/scripts/install/fedora-setup.sh
delete mode 100644 vm/scripts/install/nixos-setup.sh
delete mode 100644 vm/scripts/install/ubuntu-setup.sh
delete mode 100644 vm/scripts/preseed/arch-preseed.sh
delete mode 100644 vm/scripts/preseed/fedora-kickstart.ks.template
delete mode 100755 vm/scripts/vm-host/arch-setup.sh
delete mode 100755 vm/scripts/vm-host/darwin-setup.sh
delete mode 100755 vm/scripts/vm-host/debian-setup.sh
delete mode 100755 vm/scripts/vm-host/fedora-setup.sh
delete mode 100755 vm/scripts/vm-host/nixos-setup.sh
delete mode 100755 vm/scripts/vm-host/ubuntu-setup.sh
delete mode 100644 vm/vm-utils.nix
diff --git a/TODO.md b/TODO.md
index 72ad49ea..d08ec8fd 100644
--- a/TODO.md
+++ b/TODO.md
@@ -3,6 +3,11 @@
## now / notes
+- refactor: cleaned up flake in preparation for next api update
+
+removed old vm builder
+removed iso, closes #53 in favor of a future nixos-anywhere implementation
+
- docs: improved configuration guide
- docs: better documented first edits
- docs: better hardware configuration guide, no default hardware options
@@ -12,8 +17,7 @@
## next api update
-- refactor: hydenix nixOsModules to nixosModules
-- refactor: outputs more flexible
+- refactor: removed hydenix.lib to standardize outputs, hydenix nixOsModules to nixosModules
- fix: nix-index should be a module in hydenix only, its declared twice
- fix: rename nix-index home-manager module whatever new name
- feat: hydenix follows nixpkgs, no userPkgs overlays
@@ -25,8 +29,6 @@
- finish demo-vm for video
- docs: documentation generation?
- feat: config.toml options
-- chore: remove iso builder and ci, close issue related to it in favor of (hyde)nixos-anywhere
-- chore: remove old vm builder
- refactor: revise module hierarchy to be more clear and concise
- feat: assertions for common requirements
- feat: spicetify theme support? flatpak?
diff --git a/flake.nix b/flake.nix
index 9c80522c..f2a1280b 100644
--- a/flake.nix
+++ b/flake.nix
@@ -24,23 +24,21 @@
};
outputs =
- { ... }@hydenix-pre-inputs:
+ inputs@{ hydenix-nixpkgs, ... }:
let
- # TODO: multi system support?
system = "x86_64-linux";
- hydenix-inputs = hydenix-pre-inputs // {
- pkgs = import hydenix-pre-inputs.hydenix-nixpkgs {
- inherit system;
- };
- lib = {
- overlays = import ./hydenix/sources/overlay.nix { inputs = hydenix-pre-inputs; };
- nixOsModules = import ./hydenix/modules/system;
- homeModules = import ./hydenix/modules/hm;
- iso = import ./lib/iso/default.nix;
- mkTheme = import ./hydenix/sources/themes/utils/mkTheme.nix;
- inherit system;
- };
+ # Create lib attribute that template expects
+ lib = {
+ inherit system;
+ overlays = import ./hydenix/sources/overlay.nix { inherit inputs; };
+ nixOsModules = ./hydenix/modules/system;
+ homeModules = ./hydenix/modules/hm;
+ };
+
+ # Internal inputs for building packages and configurations
+ hydenix-inputs = inputs // {
+ inherit lib;
};
defaultConfig = import ./lib/config {
@@ -53,78 +51,38 @@
inherit hydenix-inputs;
};
- isoConfig = hydenix-inputs.lib.iso {
- inherit hydenix-inputs;
- };
-
- isoVmConfig = import ./lib/vms/iso-vm.nix {
- inherit hydenix-inputs;
- };
-
demoVmConfig = import ./lib/vms/demo-vm.nix {
inherit hydenix-inputs;
};
- hydevm = import ./lib/vms/hydevm/default.nix {
- pkgs = hydenix-inputs.pkgs;
- lib = hydenix-inputs.pkgs.lib;
- };
-
in
{
- lib = hydenix-inputs.lib;
-
- templates = {
- default = {
- path = ./template;
- description = "Hydenix template";
- welcomeText = ''
- ``` _ _ _ _
- | | | | | | (_)
- | |__| |_ _ __| | ___ _ __ ___ __
- | __ | | | |/ _` |/ _ \ '_ \| \ \/ /
- | | | | |_| | (_| | __/ | | | |> <
- |_| |_|\__, |\__,_|\___|_| |_|_/_/\_\
- __/ |
- |___/ ❄️ Powered by Nix ❄️
- ```
- 1. edit `configuration.nix` with your preferences for hydenix
- - visit https://github.com/richen604/hydenix for module documentation
- 2. run `sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix`
- 3. `git init && git add .` (flakes have to be managed via git)
- 4. run any of the packages in your new `flake.nix`
- - for rebuild, use `sudo nixos-rebuild switch --flake .`
- 5. DON'T FORGET: change your password for all users with `passwd` from initialPassword set in `configuration.nix`
- 6. NOTE: After rebuild, the first boot may take a while depending on how many `hydenix.hm.themes` are enabled, as the system generates cache.
- '';
- };
+ # Main API that template uses
+ # Will be depreciated in the next api update
+ inherit lib;
+
+ # Direct module access
+ homeModules.default = ./hydenix/modules/hm;
+ nixosModules.default = ./hydenix/modules/system;
+
+ overlays.default = import ./hydenix/sources/overlay.nix { inherit inputs; };
+
+ templates.default = {
+ path = ./template;
+ description = "Template for hydenix configuration";
};
+ nixosConfigurations.default = defaultConfig;
+
packages.${system} = {
# Use the VM configuration as default
default = vmConfig.config.system.build.vm;
- # Original NixOS configuration
- nixos = defaultConfig.config.system.build.toplevel;
-
- # Explicitly named VM configuration
- nixos-vm = vmConfig.config.system.build.vm;
+ # WIP: For a future demo installation & usage video
demo-vm = demoVmConfig.config.system.build.vm;
- # Demo VM configuration
- iso-vm = isoVmConfig;
-
- # ISO configuration
- iso = isoConfig.build-iso;
-
- # Add the burn-iso script as a package
- burn-iso = isoConfig.burn-iso;
-
- # Add hyde-update package
+ # Helper to manage hyde updates
hyde-update = import ./lib/hyde-update { inherit hydenix-inputs; };
-
- # Add hydevm packages
- hydevm = hydevm.defaultPackage;
};
devShells.${system}.default = import ./lib/dev-shell.nix { inherit hydenix-inputs; };
diff --git a/hydenix/sources/overlay.nix b/hydenix/sources/overlay.nix
index 4a9bf729..2ee43409 100644
--- a/hydenix/sources/overlay.nix
+++ b/hydenix/sources/overlay.nix
@@ -6,12 +6,9 @@ let
# Define all packages
packages = {
# Hyde core packages
- hyde-cli = callPackage ./hyde-cli.nix { };
hyde-gallery = callPackage ./hyde-gallery.nix { };
- hyprdots = callPackage ./hyprdots.nix { };
# Additional packages
pokego = callPackage ./pokego.nix { };
- pokemon-colorscripts = callPackage ./pokemon-colorscripts.nix { };
python-pyamdgpuinfo = callPackage ./python-pyamdgpuinfo.nix { };
Tela-circle-dracula = callPackage ./Tela-circle-dracula.nix { };
Bibata-Modern-Ice = callPackage ./Bibata-Modern-Ice.nix { };
diff --git a/lib/config/default.nix b/lib/config/default.nix
index 4f33352f..a3a9423c 100644
--- a/lib/config/default.nix
+++ b/lib/config/default.nix
@@ -4,7 +4,7 @@
}:
hydenix-inputs.hydenix-nixpkgs.lib.nixosSystem {
- inherit (hydenix-inputs.lib) system;
+ system = "x86_64-linux";
specialArgs = {
inherit hydenix-inputs;
};
diff --git a/lib/dev-shell.nix b/lib/dev-shell.nix
index f6716650..9ca2f927 100644
--- a/lib/dev-shell.nix
+++ b/lib/dev-shell.nix
@@ -1,8 +1,9 @@
{ hydenix-inputs }:
let
+ system = "x86_64-linux";
pkgs = import hydenix-inputs.hydenix-nixpkgs {
- inherit (hydenix-inputs.lib) system;
+ inherit system;
config.allowUnfree = true;
};
in
diff --git a/lib/hyde-update/default.nix b/lib/hyde-update/default.nix
index c135eae9..0dabb5ee 100644
--- a/lib/hyde-update/default.nix
+++ b/lib/hyde-update/default.nix
@@ -3,8 +3,9 @@
}:
let
+ system = "x86_64-linux";
pkgs = import hydenix-inputs.hydenix-nixpkgs {
- inherit (hydenix-inputs.lib) system;
+ inherit system;
config.allowUnfree = true;
};
diff --git a/lib/iso/default.nix b/lib/iso/default.nix
deleted file mode 100644
index 795606d1..00000000
--- a/lib/iso/default.nix
+++ /dev/null
@@ -1,326 +0,0 @@
-{
- hydenix-inputs,
- flakePath ? null,
- ...
-}:
-let
-
- hydenix-pkgs = import hydenix-inputs.hydenix-nixpkgs {
- inherit (hydenix-inputs.lib) system;
- config.allowUnfree = true;
- overlays = [
- hydenix-inputs.lib.overlays
- ];
- };
-
- # Add the ISO image module
- isoImageModule = "${hydenix-inputs.hydenix-nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix";
-
- # Create the base ISO configuration
- isoSystem = hydenix-inputs.hydenix-nixpkgs.lib.nixosSystem {
- inherit (hydenix-inputs.lib) system;
- modules = [
- isoImageModule
- {
- # Explicitly allow unfree packages in the ISO
- nixpkgs.config.allowUnfree = true;
-
- # Enable nix experimental features
- nix.settings.experimental-features = [
- "nix-command"
- "flakes"
- ];
-
- # Live USB settings
- isoImage.makeEfiBootable = true;
- isoImage.makeUsbBootable = true;
- isoImage.squashfsCompression = "zstd -Xcompression-level 6"; # Better compression ratio and speed
-
- # ISO-specific configuration
- isoImage = {
- edition = hydenix-pkgs.lib.mkForce "hydenix";
- isoBaseName = hydenix-pkgs.lib.mkForce "hydenix";
- isoName = hydenix-pkgs.lib.mkForce "hydenix.iso";
- volumeID = hydenix-pkgs.lib.mkForce "HYDENIX";
- };
-
- # Improve boot experience
- boot.kernelParams = [
- # Better hardware compatibility
- "nomodeset"
- "i915.modeset=1"
- "nouveau.modeset=1"
- # Improve boot messages
- "boot.shell_on_fail"
- # Memory management improvements
- "zswap.enabled=1"
- ];
-
- # Better hardware support
- hardware.enableRedistributableFirmware = true;
- hardware.enableAllFirmware = true;
-
- # Add installation script and required packages to ISO
- environment.systemPackages = with hydenix-pkgs; [
- (writeScriptBin "hydenix-install" (builtins.readFile ./nixos-install.sh))
- # Required by installation script
- fzf
- parted
- dosfstools # for mkfs.fat
- e2fsprogs # for mkfs.ext4
- util-linux # for wipefs, lsblk
- util-linux.bin
- git
- vim
- nano # More beginner-friendly editor
- curl
- wget
- htop # System monitoring
-
- # Networking tools
- networkmanager # Includes nmcli
- iw
- wirelesstools
-
- # Hardware detection and management
- pciutils # for lspci
- usbutils # for lsusb
- dmidecode # for system information
-
- # Filesystem tools
- gptfdisk # for gdisk/sgdisk (advanced partitioning)
- ntfs3g # for NTFS support (dual-boot scenarios)
- btrfs-progs # for btrfs support
- xfsprogs # for XFS support
-
- # Compression tools
- gzip
- bzip2
- xz
- zip
- unzip
-
- # Troubleshooting tools
- lshw # List hardware
- smartmontools # Disk health
-
- # Documentation
- man-pages
- man-pages-posix
- ];
-
- # Enable NetworkManager
- networking.networkmanager.enable = true;
- networking.wireless.enable = false; # Disable wpa_supplicant as we're using NetworkManager
-
- # Better hardware support
- services.xserver.videoDrivers = [
- "modesetting"
- "fbdev"
- "vesa"
- ];
- services.fwupd.enable = true; # Firmware updates
-
- # Improve console experience
- console = {
- font = "Lat2-Terminus16";
- keyMap = hydenix-pkgs.lib.mkForce "us";
- useXkbConfig = true;
- };
-
- # Copy installation script to home directory
- system.activationScripts.copyTemplate =
- let
- # This allows us to use this script for both the default ISO and user template flake
- configPath = if flakePath == null then ../../template else flakePath;
- in
- ''
- mkdir -p /home/nixos
- cp -r ${configPath} /home/nixos/hydenix
- chmod -R u+w /home/nixos/hydenix
- chown -R nixos:nixos /home/nixos/hydenix
-
- # Create a helpful README in the home directory
- cat > /home/nixos/README.txt << 'EOF'
- HydeNix Installation Guide
- =========================
-
- Quick Start:
- 1. Run 'hydenix-install' for guided installation
-
- For WiFi:
- - Run 'nmtui' for a text-based network manager
- - Or use 'nmcli device wifi connect