From cee6cd42d59903584b804300017a3cf5a8d48157 Mon Sep 17 00:00:00 2001 From: bangae1 Date: Sat, 1 Nov 2025 10:30:13 +0900 Subject: [PATCH] first --- .gitignore | 4 + README.md | 68 ++++++ configuration.nix | 98 ++++++++ docs/assets/option-search.png | Bin 0 -> 16094 bytes docs/community.md | 10 + docs/contributing.md | 65 ++++++ docs/faq.md | 428 ++++++++++++++++++++++++++++++++++ docs/installation.md | 65 ++++++ docs/options.md | 251 ++++++++++++++++++++ docs/troubleshooting.md | 30 +++ docs/upgrading.md | 56 +++++ flake.nix | 43 ++++ hardware-configuration.nix | 39 ++++ modules/hm/default.nix | 17 ++ modules/system/default.nix | 12 + 15 files changed, 1186 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 configuration.nix create mode 100644 docs/assets/option-search.png create mode 100644 docs/community.md create mode 100644 docs/contributing.md create mode 100644 docs/faq.md create mode 100644 docs/installation.md create mode 100644 docs/options.md create mode 100644 docs/troubleshooting.md create mode 100644 docs/upgrading.md create mode 100644 flake.nix create mode 100644 hardware-configuration.nix create mode 100644 modules/hm/default.nix create mode 100644 modules/system/default.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..946cb50 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.direnv +*.qcow2 +result +.git-hooks \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b8df57e --- /dev/null +++ b/README.md @@ -0,0 +1,68 @@ +NixOS + +# hydenix template flake + +This is now your personal NixOS configuration.\ +Add packages, customize themes, or even disable hydenix and setup your own wm/de.\ +Enjoy the full power of Nix! + +visit the [docs/installation.md](./docs/installation.md) to get started. + +## file structure + +### core configuration files + +| file | description | +|------|-------------| +| `flake.nix` | main flake configuration and entry point | +| `configuration.nix` | nixos system configuration | +| `hardware-configuration.nix` | hardware-specific settings (auto-generated) | + +### documentation + +| file | purpose | +|------|---------| +| [`docs/installation.md`](./docs/installation.md) | installation guide and setup instructions | +| [`docs/options.md`](./docs/options.md) | available module configuration options | +| [`docs/faq.md`](./docs/faq.md) | frequently asked questions and solutions | +| [`docs/troubleshooting.md`](./docs/troubleshooting.md) | common issues and fixes | +| [`docs/upgrading.md`](./docs/upgrading.md) | how to upgrade your configuration | +| [`docs/contributing.md`](./docs/contributing.md) | guidelines for contributing | +| [`docs/community.md`](./docs/community.md) | community configurations and examples | + +### write your own modules + +> **note:** Use these directories to override or extend hydenix modules with your custom configurations. + +| directory | type | purpose | +|-----------|------|---------| +| `modules/hm/` | home manager | custom home-manager module definitions (and for `hydenix.hm` options) | +| `modules/system/` | nixos system | custom system-level module definitions (and for `hydenix` options) | + +### directory tree + +```bash +hydenix/ +├── README.md +├── flake.nix +├── configuration.nix +├── hardware-configuration.nix +├── docs/ +│ ├── *.md files +│ └── assets/ +└── modules/ + ├── hm/default.nix + └── system/default.nix +``` + +## next steps + +- to learn more about nix, see [nix resources](./docs/faq.md#how-do-i-learn-more-about-nix) +- see [module options](./docs/options.md) for configuration +- check the [faq](./docs/faq.md) and [troubleshooting](./docs/troubleshooting.md) guides + +## getting help + +- [hydenix issues](https://github.com/richen604/hydenix/issues) +- [hydenix discussions](https://github.com/richen604/hydenix/discussions) +- [hyde discord](https://discord.gg/AYbJ9MJez7) diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..7292729 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,98 @@ +{ + inputs, + ... +}: +let + # FOLLOW THE BELOW INSTRUCTIONS LINE BY LINE TO SET UP YOUR SYSTEM + + # Package configuration - sets up package system with proper overlays + # Most users won't need to modify this section + system = "x86_64-linux"; + pkgs = import inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + overlays = [ + inputs.hydenix.overlays.default + ]; + }; +in +{ + nixpkgs.pkgs = pkgs; # Set pkgs for hydenix globally + + imports = [ + # hydenix inputs - Required modules, don't modify unless you know what you're doing + inputs.hydenix.inputs.home-manager.nixosModules.home-manager + inputs.hydenix.nixosModules.default + ./modules/system # Your custom system modules + ./hardware-configuration.nix # Auto-generated hardware config + + # Hardware Configuration - Uncomment lines that match your hardware + # Run `lshw -short` or `lspci` to identify your hardware + + # GPU Configuration (choose one): + # inputs.nixos-hardware.nixosModules.common-gpu-nvidia # NVIDIA + # inputs.nixos-hardware.nixosModules.common-gpu-amd # AMD + + # CPU Configuration (choose one): + # inputs.nixos-hardware.nixosModules.common-cpu-amd # AMD CPUs + # inputs.nixos-hardware.nixosModules.common-cpu-intel # Intel CPUs + + # Additional Hardware Modules - Uncomment based on your system type: + # inputs.nixos-hardware.nixosModules.common-hidpi # High-DPI displays + # inputs.nixos-hardware.nixosModules.common-pc-laptop # Laptops + # inputs.nixos-hardware.nixosModules.common-pc-ssd # SSD storage + ]; + + # If enabling NVIDIA, you will be prompted to configure hardware.nvidia + # hardware.nvidia = { + # open = true; # For newer cards, you may want open drivers + # prime = { # For hybrid graphics (laptops), configure PRIME: + # amdBusId = "PCI:0:2:0"; # Run `lspci | grep VGA` to get correct bus IDs + # intelBusId = "PCI:0:2:0"; # if you have intel graphics + # nvidiaBusId = "PCI:1:0:0"; + # offload.enable = false; # Or disable PRIME offloading if you don't care + # }; + # }; + + # Home Manager Configuration - manages user-specific configurations (dotfiles, themes, etc.) + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { inherit inputs; }; + # User Configuration - REQUIRED: Change "hydenix" to your actual username + # This must match the username you define in users.users below + users."hydenix" = + { ... }: + { + imports = [ + inputs.hydenix.homeModules.default + ./modules/hm # Your custom home-manager modules (configure hydenix.hm here!) + ]; + }; + }; + + # User Account Setup - REQUIRED: Change "hydenix" to your desired username (must match above) + users.users.hydenix = { + isNormalUser = true; + initialPassword = "hydenix"; # SECURITY: Change this password after first login with `passwd` + extraGroups = [ + "wheel" + "networkmanager" + "video" + ]; # User groups (determines permissions) + shell = pkgs.zsh; # Default shell (options: pkgs.bash, pkgs.zsh, pkgs.fish) + }; + + # Hydenix Configuration - Main configuration for the Hydenix desktop environment + hydenix = { + enable = true; # Enable Hydenix modules + # Basic System Settings (REQUIRED): + hostname = "hydenix"; # REQUIRED: Set your computer's network name (change to something unique) + timezone = "America/Vancouver"; # REQUIRED: Set timezone (examples: "America/New_York", "Europe/London", "Asia/Tokyo") + locale = "en_CA.UTF-8"; # REQUIRED: Set locale/language (examples: "en_US.UTF-8", "en_GB.UTF-8", "de_DE.UTF-8") + # For more configuration options, see: ./docs/options.md + }; + + # System Version - Don't change unless you know what you're doing (helps with system upgrades and compatibility) + system.stateVersion = "25.05"; +} diff --git a/docs/assets/option-search.png b/docs/assets/option-search.png new file mode 100644 index 0000000000000000000000000000000000000000..155af1c18491995561eebbd4a6640adcf6065792 GIT binary patch literal 16094 zcmb7r1yoeuyEZ0D3P{(FQKUnVE|rp&pl1?y?5PjEf#0b+3(rC&v~BbeRueKRe3@@8ax~v972V6GGH8>ySqTTWZr0cr|-;q=|1hE#ohCQ3B?fM-KBV4@nwRX z+`goujw)IrN!KhgocTmIx8hG(IJ`3yej1a*`s-bsF>(FU#r2Kw^Ixw>M0i@TYYRS= zLSkZv18Y)8gcr_kfV40CY~~aseucx`8!MC(i+8-`1dw{sOCf9(nnSJ zDL`^;mZLGLrlyj$#s;`Ie{1NfFQ;p<-Oj=jshibvXyu>;&C?>wIwFwm-uiKtS4|rI z1hD(ZB*s%akwaL4OJ)rwp{#`Btd>keQU>ZyRajo5)%Q=o826C(qMkelY+uhU<5|im zgOc0JjM}d!BfH;jt;O}8X?j^#O#pTQnUDT93NP-*cjL~1UNC!%(mS?#D+XjB&@e(D z`a_?)_keuX@88fb$&HW{`dqP^o#VZCx6FaNt<{V1!x64n5~t3;UHXrn{g>U=9t_4; zq?YdBwdf9lwSB`H15cdY9?9nM5s+kcktleBp)#ybY&8`blDVGlfmfiM+)A*K!+JwL zDhnuHigJ8n{+qXd+ahNo!`{AB>9FJ7v1s$kj)MBkkUJN>J}Qd%tlq2Tz#Z1le6M|C zQn94e-4r&Gz@7n>23p6sv@%PbxlJt^AW(kd-#^6M`$_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dC1$ED)8!@gvxC>QLJR<`g0Q&Za!Kx6Dd4rLq3I3(4j3&ag@NC{dKiqGJv}&5S3L&+=mi0d`uf5{xEz}j0^tPS z3Dk(njj5;q$HNo0j!xvL+}n_NdC~T#q;5nLP;N-$MxkHwtK^4^w-MEf4T;4pB#-lI z9gOFaCm{a2$NipmIPxk`HzhHN z%GcCuc_*Ihg`=q8F-K^Bpxdn>yv?n|P@I1eguRyFDMWCt3XmMnUcG~jFkEH3+zAM1 z6pCArsmAuHlxmCB8*FuQO%VZtB&5Tvr)US4;Guqv&1yfA5+JRHeQ7mfH*xRsw~~3@ zC0~nanAti$BMpz7$k^^j7Ip~<(li_$%^)I1zao+H?n0Y@&vKu{{g@5-RfL85sB{~qBr(Q z3JA@QF=5&~sn=IMxxb6=;=JBqS5*CiOZiEG-1c~2EipA=d3(`n69^Uh`Quw}>uuAl z0h)+TB(UqHc>Q0^GG*P$0Viixx><$(E{XcyQtO=zgCC;6v2E5DegAvl^lu7sg*Z4R zPg74X>@>>?5EyaZr}m0YJkRgND@~GTKV%1uBWG9mzy1wNd#`D{%MJVMMg5z@D%{r# z29Ff~wuS&TsW|=!5s; zZ3V_$YK45Yz*%ces6fcLwal=8@}JQn{fh4fdSdp-e?OG10Ik#^sgO;HeaX)HucO{) mzZZa>|Mw@r|IG< + +# hydenix community + +here are a list of community configs using hydenix. + +- [richen604/richendots](https://github.com/richen604/richendots) +- [Razkaroth/solitude](https://github.com/Razkaroth/solitude) + +if you have a config you'd like to share, please open a PR to add it to the list. diff --git a/docs/contributing.md b/docs/contributing.md new file mode 100644 index 0000000..b4ef459 --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1,65 @@ +NixOS + +# contributing + +this project uses [direnv](https://direnv.net/) 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](template/README.md) + +this project enforces [conventional commits](https://www.conventionalcommits.org/) format for all commit messages. each commit message must follow this structure: + +```bash +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: + - 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](https://www.conventionalcommits.org/). diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 0000000..1ec0c0c --- /dev/null +++ b/docs/faq.md @@ -0,0 +1,428 @@ +NixOS + +# faq + +## general FAQ + +- [faq](#faq) + - [general FAQ](#general-faq) + - [why should I use nixos?](#why-should-i-use-nixos) + - [how do I learn more about nix?](#how-do-i-learn-more-about-nix) + - [hydenix FAQ](#hydenix-faq) + - [how do I upgrade hydenix?](#how-do-i-upgrade-hydenix) + - [when should I upgrade?](#when-should-i-upgrade) + - [how do I fix (nix error / system error / bug / etc)?](#how-do-i-fix-nix-error--system-error--bug--etc) + - [common errors](#common-errors) + - [`Existing file '...' is in the way of '...'`](#existing-file--is-in-the-way-of-) + - [what are the module options?](#what-are-the-module-options) + - [what if I want to customize hydenix?](#what-if-i-want-to-customize-hydenix) + - [what are some example configurations?](#what-are-some-example-configurations) + - [how do I persist changes on reboot/rebuild/etc?](#how-do-i-persist-changes-on-rebootrebuildetc) + - [how do I add a new theme?](#how-do-i-add-a-new-theme) + - [what is mutable.nix?](#what-is-mutablenix) + - [why do themes still show after I remove them from `hydenix.hm.theme.themes`?](#why-do-themes-still-show-after-i-remove-them-from-hydenixhmthemethemes) + - [requesting features](#requesting-features) + - [other faq](#other-faq) + - [how do I run hyprland in a vm?](#how-do-i-run-hyprland-in-a-vm) + +### why should I use nixos? + +nixos offers several key advantages: + +1. **reproducible setups**: roll back to working states instantly if something breaks. +2. **configuration as code**: version control your entire OS setup. +3. **no dependency hell**: packages are isolated, allowing multiple versions side by side. +4. **declarative approach**: describe the desired end state rather than steps to achieve it. +5. **risk-free experimentation**: test configurations without permanent consequences. +6. **developer-friendly**: create isolated environments with precise dependencies. + +there's a learning curve, but the benefits are worth it. + + + +### how do I learn more about nix? + +> [!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 + +- [nix packages](https://search.nixos.org/packages) +- [nix options](https://search.nixos.org/options) +- [home manager options](https://home-manager-options.extranix.com/?query=&release=master) +- [nixos wiki](https://nixos.wiki) +- [nixpkgs discussions](https://discourse.nixos.org) +- [nixpkgs issues](https://github.com/NixOS/nixpkgs/issues) + + + +## hydenix FAQ + +### how do I upgrade hydenix? + +hydenix can be upgraded, downgraded, or version locked easy. +in your template flake folder, update hydenix to main using + +```bash +nix flake update hydenix +``` + +or define a specific version in your `flake.nix` template + +```nix +inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + hydenix = { + # Available inputs: + # Main: github:richen604/hydenix + # Dev: github:richen604/hydenix/dev + # Commit: github:richen604/hydenix/ + # Version: github:richen604/hydenix/v1.0.0 + url = "github:richen604/hydenix"; + }; + }; +``` + +run `nix flake update hydenix` again to load the update, then rebuild your system to apply the changes + +### when should I upgrade? + +```mermaid +graph TD + A[v2.3.1] --> B[major] + A --> C[minor] + A --> D[patch] + B --> E[breaking changes
review release notes for api changes] + C --> F[new features
safe to update] + D --> G[bug fixes
safe to update] + + style A fill:#c79bf0,stroke:#ebbcba,stroke-width:2px,color:#000 + style B fill:#ebbcba,stroke:#c79bf0,stroke-width:2px,color:#000 + style C fill:#ebbcba,stroke:#c79bf0,stroke-width:2px,color:#000 + style D fill:#ebbcba,stroke:#c79bf0,stroke-width:2px,color:#000 + style E fill:#f6f6f6,stroke:#c79bf0,stroke-width:2px,color:#000 + style F fill:#f6f6f6,stroke:#c79bf0,stroke-width:2px,color:#000 + style G fill:#f6f6f6,stroke:#c79bf0,stroke-width:2px,color:#000 +``` + +- **always review [release notes](https://github.com/richen604/hydenix/releases) for major updates (api changes)** +- keep up with patches for stability +- update to minor versions for new features + +### how do I fix (nix error / system error / bug / etc)? + +please see the [troubleshooting](./troubleshooting.md) guide for more information on how to diagnose and fix issues. +or create an issue in the [hydenix GitHub repository](https://github.com/richen604/hydenix/issues). + +### common errors + +#### `Existing file '...' is in the way of '...'` + +this error occurs when home-manager tries to manage a file that already exists and wasn't created by home-manager. + +example: + +```bash +Existing file '/home/user/.config/kitty/kitty.conf' is in the way of '/nix/store/...-home-manager-files/.config/kitty/kitty.conf' +``` + +**solution 1: remove existing files (recommended)** + +remove the conflicting files and let home-manager recreate them: + +```bash +# Remove the specific file +rm ~/.config/kitty/kitty.conf + +# Or remove entire config directory if needed (careful not to delete important files) +rm -rf ~/.config/kitty/ +``` + +**solution 2: backup existing files** + +if you want to preserve your existing configuration: + +```bash +# Create backup +mv ~/.config/kitty/kitty.conf ~/.config/kitty/kitty.conf.backup + +# Then rebuild to let home-manager create the new file +sudo nixos-rebuild switch +``` + +**solution 3: force home-manager to backup automatically** + +add this to your `configuration.nix` to automatically backup conflicting files: + +```nix +{ + home-manager.backupFileExtension = "backup"; +} +``` + +this will automatically rename existing files with a `.backup` extension when home-manager encounters conflicts, allowing the rebuild to proceed without manual intervention only once. + +> [!WARNING] +> if there is a conflict again, home-manager will error for you to manually resolve it. i don't include this by default as automating backups may not be ideal for users and it does not really solve the issue with managing backups + +### what are the module options? + +Visit [options.md](./options.md) for more information on the module options. + +### what if I want to customize hydenix? + +hydenix is designed to be customizable outside of the module options. write your own modules, import your own flakes, packages, etc. + +if you need to disable any of the modules above in [module options](#what-are-the-module-options), simply disable the module and write your own configuration. ideally referencing the module in the source code. + +note however, it's very easy to overwrite hydenix defaults this way and may lead to bugs. feel free to ask questions in our [discord](https://discord.gg/AYbJ9MJez7) if you need help. + + + +### what are some example configurations? + +see [community configs](./community.md) for examples. + +### how do I persist changes on reboot/rebuild/etc? + +> [!IMPORTANT] +> do not edit any mutable files at runtime as they may be overwritten on rebuild
+> all edits must be done in your flake via nixos & home-manager options + +some state files in hydenix are mutable by design. this allows certain theme changes during runtime. + +example: + +lets say you have the default theme set to `Catppuccin Mocha` in `hydenix.hm.theme.active`. + +you change a theme during runtime using `Meta + Shift + T` to `Catppuccin Latte`. +your config is unchanged so when you reboot/relog/rebuild, the theme will revert to `Catppuccin Mocha`. + +```nix +{ + hydenix.hm.theme.active = "Catppuccin Mocha"; +} +``` + +simply change the theme in your config to match your desired theme and rebuild. + +```nix +{ + hydenix.hm.theme.active = "Catppuccin Latte"; +} +``` + +but what about file you want to stop from reverting? waybar position or kitty config? +home-managers `home.file` allows you to do this + +```nix +# any file in `./modules/hm/` +{ + home.file = { + # copy kitty config to your template flake + # cp ~/.config/kitty/kitty.conf ~/path/to/flake/kitty.conf + ".config/kitty/kitty.conf" = { + source = ./kitty.conf; # path to your kitty config in your template flake + }; + # copy waybar position state to your template flake + # cp ~/.config/waybar/config.ctl ~/path/to/flake/config.ctl + ".config/waybar/config.ctl" = { + source = ./config.ctl; # path to your waybar config in your template flake + }; + }; +} +``` + +see [home.file options](https://home-manager-options.extranix.com/?query=home.file&release=master) for more information + + + +### how do I add a new theme? + + + +### what is mutable.nix? + +> [!IMPORTANT] +> do not edit any mutable files at runtime as they may be overwritten on rebuild
+> all edits must be done in your flake via nixos & home-manager options + +`mutable.nix` is a custom module that allows certain files to be copied instead of symlinked during system builds, making them writable at runtime. key points: + +- extends `home.file`, `xdg.configFile`, and `xdg.dataFile` with a `mutable` option +- files marked as `mutable = true` (and `force = true`) will be writable +- changes persist across rebuilds +- useful for programs that need runtime configuration changes + +example usage in scripts: + +```nix +home.activation = { + example = lib.hm.dag.entryAfter [ "mutableGeneration" ] '' + $DRY_RUN_CMD echo "example" + ''; +} +``` + +credit: [@piousdeer](https://gist.github.com/piousdeer/b29c272eaeba398b864da6abf6cb5daa) + + + +### why do themes still show after I remove them from `hydenix.hm.theme.themes`? + +themes are saved in `~/.config/hydenix/themes` so they will still show after you remove them from `hydenix.hm.theme.themes`. +to clear the saved themes, run `rm -rf ~/.config/hydenix/themes/THEME_NAME` for each theme you want to remove. + + + +### requesting features + +please open a [feature request](https://github.com/richen604/hydenix/issues/new?template=feature_request.md) if you have any feature requests. + + + +## other faq + +### how do I run hyprland in a vm? + +hyprland vm is not well supported. check out [hyprland - running in a vm](https://wiki.hyprland.org/Getting-Started/Installation/#running-in-a-vm) + +best bet is to have virtio, opengl, and VT-x support + +non-nixos hosts should run with [nixGL](https://github.com/nix-community/nixGL) eg `nixGL nix run .` + +
+hardware requirements +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 + +
+ +
+ +
+1. install drivers + +```bash +# Nvidia +sudo apt install nvidia-driver nvidia-utils # Debian/Ubuntu +sudo pacman -S nvidia nvidia-utils # Arch +# NixOS configuration +{ + hardware.graphics.enable = true; + hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; + hardware.nvidia.modesetting.enable = true; +} + +# AMD +sudo apt install mesa-utils vulkan-tools # Debian/Ubuntu +sudo pacman -S mesa lib32-mesa vulkan-radeon # Arch +# NixOS configuration +{ + hardware.graphics.enable = true; + hardware.graphics.extraPackages = with pkgs; [ amdvlk ]; +} + +# Intel +sudo apt install mesa-utils intel-media-va-driver # Debian/Ubuntu +sudo pacman -S mesa lib32-mesa intel-media-driver # Arch +# NixOS configuration +{ + hardware.graphics.enable = true; + hardware.graphics.extraPackages = with pkgs; [ intel-media-driver ]; +} + +# KVM modprobe +modprobe kvm +modprobe kvm_intel # or kvm_amd +# NixOS configuration +{ + boot.kernelModules = [ "kvm-intel" ]; # or "kvm-amd" for AMD processors + virtualisation.libvirtd.enable = true; +} +``` + +
+ +
+ +
+2. verify setup + +```bash +# Verify KVM support +egrep -c '(vmx|svm)' /proc/cpuinfo # Should return > 0 +lsmod | grep kvm # Check KVM modules + +# Host: Check OpenGL +glxinfo | grep "OpenGL" +``` + +
+ +
+ +
+3. setup the vm + +to set up the vm, follow the instructions in the [hyprland - running in a vm](https://wiki.hyprland.org/Getting-Started/Installation/#running-in-a-vm) guide. + +additionally, the following qemu options have been found to be successful: + +```bash +-device virtio-vga-gl +-display gtk,gl=on,grab-on-hover=on +-usb -device usb-tablet +-cpu host +-enable-kvm +-machine q35 +-device intel-iommu +-device ich9-intel-hda +-device hda-output +-vga none +``` + +
+ + diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 0000000..08b44e8 --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,65 @@ +NixOS + +# installation + +> [!CAUTION] +> the templated flake is designed for a minimal install of nixos. install nixos first, then follow the instructions below. + +## 1. initialize the flake template + +```bash +# create a new directory and initialize the template +mkdir hydenix && cd hydenix +nix flake init -t github:richen604/hydenix +``` + +## 2. configure your system + +edit `configuration.nix` following the detailed comments: + +- **optional:** see [module options](./options.md) for advanced configuration + +## 3. generate hardware configuration + +```bash +sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix +``` + +## 4. initialize git repository + +```bash +git init && git add . +``` + +we do this because flakes must be managed via git. and its good practice to version control your configuration + +## 5. build and switch to the new configuration + +```bash +sudo nixos-rebuild switch --flake .#hydenix +``` + +> [!NOTE] +> if you made mistakes, it will fail here. try following: +> +> - read the error carefully, it may be self-explanatory +> - troubleshooting steps in [troubleshooting & issues](./troubleshooting.md) +> - read the [faq](./faq.md), it may have the answer you're looking for +> - please don't hesitate to ask in [discord](https://discord.gg/AYbJ9MJez7) or [github discussions](https://github.com/richen604/hydenix/discussions)! + +## 6. launch hydenix + +reboot and log in. + +> [!IMPORTANT] +> do not forget to set your password +> +> ```bash +> passwd +> ``` + +you can generate the theme cache with the below: + +```bash +hyde-shell reload +``` diff --git a/docs/options.md b/docs/options.md new file mode 100644 index 0000000..d7228b4 --- /dev/null +++ b/docs/options.md @@ -0,0 +1,251 @@ +NixOS + +# hydenix options + +- [hydenix options](#hydenix-options) + - [module documentation](#module-documentation) + - [required options](#required-options) + - [default options](#default-options) + +## module documentation + +going to let you in on a secret: the nix options system *is* the documentation.\ +let's walk through an example. say you want to find info about `hydenix.hm.theme`.\ +the easiest way is to search the github repo for the options: + +[search for `hydenix.hm.theme`](https://github.com/richen604/hydenix/search?q=hydenix.hm.theme) + +you'll see the options in the search results, something like this: + +![options search example](./assets/option-search.png) + +click on the file to see the actual options definition, which looks something like this: + +```nix + options.hydenix.hm.theme = { + enable = lib.mkOption { + type = lib.types.bool; + default = config.hydenix.hm.enable; + description = "Enable theme module"; + }; + + active = lib.mkOption { + type = lib.types.str; + default = "Catppuccin Mocha"; + description = "Active theme name"; + }; + + themes = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ + "Catppuccin Mocha" + "Catppuccin Latte" + ]; + description = "Available theme names"; + }; + }; +``` + +notice that `active` has type `str`, which means it accepts a string. +so you'd configure it like this: + +```nix +hydenix.hm.theme.active = "Catppuccin Mocha"; +``` + +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; + }; +} +``` + +## default options + +below are the default options for hydenix. they are in *object format* and any options you may follow the steps above to see any of the options implementation and documentation. + +> [!important] +> `hydenix.hm` options must be used within a home-manager module, eg `./modules/hm/default.nix`. + +```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 + + system.enable = true; # enable system module + + # home-manager hydenix options + hm = { + enable = true; # enable home-manager module + 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 + 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 config appended to userprefs.conf + overrideMain = null; # complete override of hyprland.conf + suppressWarnings = false; # suppress warnings + # Animation configurations + animations = { + enable = true; # enable animation configurations + preset = "standard"; # string from override or default: "standard" # or "LimeFrenzy", "classic", "diablo-1", "diablo-2", "disable", "dynamic", "end4", "fast", "high", "ja", "me-1", "me-2", "minimal-1", "minimal-2", "moving", "optimized", "standard", "vertical" + extraConfig = ""; # additional animation configuration + overrides = { }; # override specific animation files by name + }; + # Shader configurations + shaders = { + enable = true; # enable shader configurations + active = "disable"; # string from override or default: "disable" # or "blue-light-filter", "color-vision", "custom", "grayscale", "invert-colors", "oled", "oled-saver", "paper", "vibrance", "wallbash" + overrides = { }; # override or add custom shaders + }; + # Workflow configurations + workflows = { + enable = true; # enable workflow configurations + active = "default"; # string from override or default: "default" # or "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) + }; + # Pyprland configurations + pyprland = { + enable = true; # enable pyprland configurations + extraConfig = ""; # additional pyprland configuration + overrideConfig = null; # complete pyprland 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 + 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/docs/troubleshooting.md b/docs/troubleshooting.md new file mode 100644 index 0000000..3a8baeb --- /dev/null +++ b/docs/troubleshooting.md @@ -0,0 +1,30 @@ +NixOS + +# troubleshooting & issues + +## nix errors + +nix errors can be tricky to diagnose, but the below might assist in diagnosing the issue. + +> [!TIP] +> rerun the command with `-v` to get more verbose output. +> you can also rerun the command with `--show-trace` to get a more detailed traceback. +> if the nix error is not clear, often the correct error message is somewhere in the *middle* of the error message. + +## system errors & bugs + +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 below. + +1. **system logs** + + ```bash + journalctl -b # System logs + sudo systemctl status home-manager-$HOSTNAME.service # Home-manager status + ``` + +2. **system information** + + ```bash + nix-shell -p nix-info --run "nix-info -m" + ``` diff --git a/docs/upgrading.md b/docs/upgrading.md new file mode 100644 index 0000000..9dd089c --- /dev/null +++ b/docs/upgrading.md @@ -0,0 +1,56 @@ +NixOS + +# upgrading + +hydenix can be upgraded, downgraded, or version locked easy. +in your template flake folder, update hydenix to main using: + +```bash +nix flake update hydenix +``` + +or define a specific version in your `flake.nix` template: + +```nix +inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + hydenix = { + # Available inputs: + # Main: github:richen604/hydenix + # Dev: github:richen604/hydenix/dev + # Commit: github:richen604/hydenix/ + # Version: github:richen604/hydenix/v1.0.0 + url = "github:richen604/hydenix"; + }; + }; +``` + +run `nix flake update hydenix` again to load the update, then rebuild your system to apply the changes. + +## when to upgrade + +```mermaid +graph TD + A[v2.3.1] --> B[major] + A --> C[minor] + A --> D[patch] + B --> E[breaking changes
review release notes for api changes] + C --> F[new features
safe to update] + D --> G[bug fixes
safe to update] + + style A fill:#c79bf0,stroke:#ebbcba,stroke-width:2px,color:#000 + style B fill:#ebbcba,stroke:#c79bf0,stroke-width:2px,color:#000 + style C fill:#ebbcba,stroke:#c79bf0,stroke-width:2px,color:#000 + style D fill:#ebbcba,stroke:#c79bf0,stroke-width:2px,color:#000 + style E fill:#f6f6f6,stroke:#c79bf0,stroke-width:2px,color:#000 + style F fill:#f6f6f6,stroke:#c79bf0,stroke-width:2px,color:#000 + style G fill:#f6f6f6,stroke:#c79bf0,stroke-width:2px,color:#000 +``` + +
+ +> [!Important] +> +> - **always review [release notes](https://github.com/richen604/hydenix/releases) for major updates (API changes)** +> - update to minor versions for new features +> - keep up with patches for stability diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d6710b2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "template for hydenix"; + + inputs = rec { + # Your nixpkgs + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + # Hydenix + hydenix = { + # Available inputs: + # Main: github:richen604/hydenix + # Commit: github:richen604/hydenix/ + # Version: github:richen604/hydenix/v1.0.0 - note the version may not be compatible with this template + url = "github:richen604/hydenix"; + + # uncomment the below if you know what you're doing, hydenix updates nixos-unstable every week or so + # inputs.nixpkgs.follows = "nixpkgs"; + }; + + # Hardware Configuration's, used in ./configuration.nix. Feel free to remove if unused + nixos-hardware.url = "github:nixos/nixos-hardware/master"; + }; + + outputs = + { ... }@inputs: + let + system = "x86_64-linux"; + hydenixConfig = inputs.nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs; + }; + modules = [ + ./configuration.nix + ]; + }; + + in + { + nixosConfigurations.hydenix = hydenixConfig; + nixosConfigurations.default = hydenixConfig; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..2c4a073 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,39 @@ +# 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-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/af6c4c4b-f5c7-4d5b-a62c-a967c6d6113c"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/F95B-2B72"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/9334dd40-c30f-4a69-b2c8-a5b746be8097"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/modules/hm/default.nix b/modules/hm/default.nix new file mode 100644 index 0000000..ec4ce80 --- /dev/null +++ b/modules/hm/default.nix @@ -0,0 +1,17 @@ +{ ... }: + +{ + imports = [ + # ./example.nix - add your modules here + ]; + + # home-manager options go here + home.packages = [ + # pkgs.vscode - hydenix's vscode version + # pkgs.userPkgs.vscode - your personal nixpkgs version + ]; + + # hydenix home-manager options go here + hydenix.hm.enable = true; + # Visit https://github.com/richen604/hydenix/blob/main/docs/options.md for more options +} diff --git a/modules/system/default.nix b/modules/system/default.nix new file mode 100644 index 0000000..f5f885e --- /dev/null +++ b/modules/system/default.nix @@ -0,0 +1,12 @@ +{ ... }: + +{ + imports = [ + # ./example.nix - add your modules here + ]; + + environment.systemPackages = [ + # pkgs.vscode - hydenix's vscode version + # pkgs.userPkgs.vscode - your personal nixpkgs version + ]; +}