Skip to content

richen604/hydenix

Repository files navigation

// design by t2

NixOS Unstable Release Last Commit

Nix Flake Check



wallbash_720p.mp4


   

Hydenix

Hydenix is a Nix & home-manager configuration for HyDE. The nix ecosystem brings a reproducable environment to the HyDE experience; allowing for build-time configuration options, easy updates, and more.

Features:

  • Includes HyDE-cli by default
  • NixOS VM that can be run with any supported distro
  • Themes are fetched at build-time, for faster setup
  • config.nix for easy configuration
  • Includes beta cross-distro support using home-manager, more on that here.

Why Nix?:

  • Reproducible environment
  • Easy to manage packages, dependencies, and configurations
  • changes in configuration can be rolled back easily
  • home-manager for managing dotfiles

Important

NixOS is entirely different than Arch. Experience in functional programming is recommended. If you are new to Nix, please refer to the Nix Resources. Feel free to ask questions in discussions or discord.


Limitations

  • important - Custom modules in config.nix may override hydenix defaults.
  • important - Configurations will RESET on reboot/relog/rebuilds if your configuration does not match commands run in Hyde; such as active theme and waybar styles. This by design, as nixos and home-manager rerun.
  • Some Hyde-cli commands are not supported
    • Hyde theme import use config.nix options
    • Hyde restore/backup/control while these commands will work, hydenix makes edits to hyde files by default.
    • Hyde override changing the user dir conflics with home-manager, rebuilds won't run as expected
    • Hyde inject not supported, use nixos options
  • Any other issues, see Troubleshooting & Issues

Requirements


Installation Options


Caution

Templated flake is designed for a minimal install of NixOS. YMMV.

1. Template the Flake

  1. in a new directory, nix flake init -t github:richen604/hydenix
  2. edit config.nix with your preferences
  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 vm nix run .
    • for rebuild sudo nixos-rebuild switch/test/boot --flake .

2. Running as a nixos VM

If your system supports it, the NixOS VM is the quickest way to get up and running. If you have issues running the VM, see the virtio faq

# run the flake remotely
nix run github:richen604/hydenix

note: any changes require the vm to be rebuilt. run rm hydenix.qcow2 to remove the old one.

3. (BETA) Cross-distro VMs

Currently Arch & Fedora VMs are supported Same VM requirements as VM virtio guide

nix run github:richen604/hydenix/#build-fedora-vm # or #build-arch-vm

# after the vm is built, run the flake from the vm
nix run github:richen604/hydenix/#run-fedora-vm # or #run-arch-vm

Upgrading

Hydenix can be upgraded, downgraded, or version locked easy.

in your template flake folder, update hydenix to main using

nix flake update hydenix

or define a specific version in your flake.nix template

inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    hydenix = {
      # Available inputs:
      # Main: github:richen604/hydenix
      # Dev: github:richen604/hydenix/dev 
      # Commit: github:richen604/hydenix/<commit-hash>
      # Version: github:richen604/hydenix/v1.0.0
      url = "github:richen604/hydenix";
    };
  };

run nix flake update hydenix again to apply the changes

Directory Structure

Below is a brief reference of the directory structure to hydenix:

/hosts

Contains host-specific configurations and settings.

/hosts/nixos

NixOS-specific configurations:

  • configuration.nix - main nixos system configuration, anything that cannot be done in home-manager
  • default.nix - nixos configuration function used in lib/mkConfig.nix
  • drivers.nix - Hardware driver config - used in config.nix
  • home.nix - base home-manager config

/hosts/vm

Virtual machine related configurations:

  • arch-vm.nix - Arch Linux VM configuration
  • fedora-vm.nix - Fedora VM configuration
  • nix-vm.nix - NixOS VM configuration
  • vm-utils.nix - Shared VM utilities for non-nixos
  • /scripts - VM management scripts

/hydenix

home-manager module containing most of hydenix's configurations:

  • /hm - Home-manager specific configurations
  • /packages - Custom package definitions
  • /programs - Program-specific configurations
  • /sources - Source files and dependencies, including hyde-cli and themes
  • default.nix - Main configuration entry point

/lib

Shared libraries and utilities:

  • dev-shell.nix - Development shell configuration for pre-commit hook
  • gen-config.sh - Configuration generation script
  • mkConfig.nix - Configuration builder, takes config.nix and returns hydenix

/template

Template for creating your own flake.

Troubleshooting & Issues

The following information is required when creating an issue, please provide as much as possible. It's also possible to diagnose issues yourself with the information provided.

  1. System Logs
journalctl -b                                           # System logs
journalctl --user -b                                   # User logs
sudo systemctl status home-manager-$HOSTNAME.service   # Home-manager status
  1. System Information
nix-shell -p nix-info --run "nix-info -m"
  1. Configuration
  • Link to a github repo with your templated flake or fork

Note

Custom modules in config.nix have limited support.

FAQ

VM Virtio guide

Hyprland vm is not well supported. check out Hyprland - Running in a VM

Best bet is to have virtio, opengl, and VT-x support

Non-NixOS hosts should run with nixGL eg nixGL nix run .

CPU

  • Intel CPU with VT-x or AMD CPU with AMD-V
  • Virtualization enabled in BIOS/UEFI

GPU

  • NVIDIA: GTX 600+ series (proprietary drivers)
  • AMD: HD 7000+ series
  • Intel: HD 4000+ (Ivy Bridge)
  • OpenGL 3.3+ support required

Install Drivers

# Nvidia
sudo apt install nvidia-driver nvidia-utils     # Debian/Ubuntu
sudo pacman -S nvidia nvidia-utils              # Arch

# AMD
sudo apt install mesa-utils vulkan-tools        # Debian/Ubuntu
sudo pacman -S mesa lib32-mesa vulkan-radeon    # Arch

# Intel
sudo apt install mesa-utils intel-media-va-driver  # Debian/Ubuntu
sudo pacman -S mesa lib32-mesa intel-media-driver  # Arch

# KVM modprobe
modprobe kvm
modprobe kvm_intel # or kvm_amd

Add user to groups sudo usermod -a -G render,video,kvm,libvirt $USER

Verify Setup

# Verify KVM support
egrep -c '(vmx|svm)' /proc/cpuinfo    # Should return > 0
lsmod | grep kvm                       # Check KVM modules

# Host: Check OpenGL
glxinfo | grep "OpenGL"

Nix Resources

Tip

Nix is a powerful package manager and configuration system that can be overwhelming at first. Here are some resources to help you get started:

General Resources

Contributing

This project uses direnv for pre-commit hooks. Please install it first:

  • Nix: nix-env -iA nixpkgs.direnv
  • MacOS: brew install direnv
  • Ubuntu/Debian: apt-get install direnv

then run direnv allow to enable the hooks

More documentation on the codebase can be found at Template README

This project enforces Conventional Commits format for all commit messages. Each commit message must follow this structure:

type(optional-scope): subject

[optional body]

[optional footer(s)]

Where:

  • type must be one of:

    • feat: A new feature
    • fix: A bug fix
    • docs: Documentation changes
    • style: Code style changes (formatting, etc)
    • refactor: Code changes that neither fix bugs nor add features
    • perf: Performance improvements
    • test: Adding or modifying tests
    • chore: Maintenance tasks
  • scope is optional but if used:

    • must be lowercase
    • should be descriptive of the area of change
    • examples: vm, themes, home, cli, docs, etc.
  • subject must:

    • be lowercase
    • not end with a period
    • be descriptive

Examples:

  • feat(vm): add support for fedora vm configuration
  • fix: correct wallpaper path in material theme
  • docs: update installation instructions
  • chore: update dependencies

Pull Requests

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes using conventional commits
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Changelog

The changelog is automatically generated from commit messages. Clear, well-formatted commit messages ensure your changes are properly documented.

For more details, see the Conventional Commits specification.