Is it possible to install ML4W Hyprland dotfiles on NixOS? The answer is yes, but with a catch.
Hi all, and welcome back to MusaBase! In my previous guide on How to Install JaKooLit Hyprland Dotfiles on NixOS, I covered all steps (even the steps that the official JaKooLit GitHub Repo's Readme is missing) to install JaKooLit on NixOS. But in essence, it was already supported by the developers for NixOS. I'm also a developer and I have this itch to do things that are normally difficult or haven't been done before. So what's next after JaKooLit? Well, the ML4W from Stephan Raabe. I have been using Arch Linux as my daily driver for a year now. And I have installed almost all of the popular Hyprland dotfiles on Arch Linux which is pretty easy since all of the dotfiles GitHub repo provides us with the installation steps, but the story is different for NixOS or any other Linux distro which is not supported by these dotfiles. So on paper, ML4W Hyprland dotfiles are strictly Arch specific (at the moment). So I decided, why not try to install it on NixOS? In today's article, I'm going to show you how to install ML4W Hyprland Dotfiles on NixOS.
In this ML4W Hyprland Dotfiles on NixOS guide, we will cover how to:
- Add Hyprland and Hyprland Desktop Portals on NixOS
- Find and add the correct packages and dependencies of ML4W Hyprland Dotfiles for NixOS
- Build and compile ML4W Dotfiles components on NixOS
- Clone ML4W Dotfiles on NixOS
- Apply ML4W dotfiles for Hyprland session on NixOS
- Find and execute ML4W dotfiles scripts for ML4W itself with Waybar and Hyprland for autostart
- And finally, logging into properly installed ML4W Hyprland Dotfiles on NixOS
By following this guide step-by-step, we will have ML4W dotfiles working flawlessly on our NixOS system.
⚡ TL;DR: Install ML4W Hyprland Dotfiles on NixOS
A quick reference for installing and configuring ML4W Hyprland dotfiles on a base NixOS system, including adding Hyprland services, installing dependencies, cloning dotfiles, executing scripts, and logging into the ML4W Hyprland session.
-
Add Hyprland and XDG Desktop Services to configuration.nix:
Add:sudo nano /etc/nixos/configuration.nixprograms.hyprland.enable = true;,xdg.portal.enable = true;,xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-gtk ];,security.polkit.enable = true;,services.flatpak.enable = true;,qt.enable = true;, and the systemd-tmpfiles rule for/bin/bash. (See the "Adding Hyprland and XDG Desktop Services" section for details.) -
Add ML4W packages and dependencies to configuration.nix:
Undersudo nano /etc/nixos/configuration.nixenvironment.systemPackages, add all ML4W core tools, Hyprland stack, Wayland UI components, audio/network tools, Python dependencies, fonts, wallpaper daemons, andquickshell. (Full list is in the "Add ML4W Hyprland Dotfiles Dependencies" section.) -
Rebuild NixOS and apply the changes:
This takes roughly 5-15 minutes depending on your internet speed and CPU. Some packages like quickshell compile from source.sudo nixos-rebuild switch
Create the systemd-tmpfiles symbolic link:sudo systemd-tmpfiles --create -
Clone ML4W Hyprland Dotfiles and apply configs:
Double-check the directory structure in the cloned dotfiles before running these commands, as filenames may change in future versions.cd ~/Downloads git clone https://github.com/mylinuxforwork/dotfiles.git cd dotfiles/ cp -r dotfiles/.config/. ~/.config cp dotfiles/.bashrc ~/.bashrc cp dotfiles/.zshrc ~/.zshrc cp dotfiles/.gtkrc-2.0 ~/.gtkrc-2.0 cp dotfiles/.Xresources ~/.Xresources -
Execute ML4W scripts and create the mydotfiles directory:
The mydotfiles directory is required for the autostart script's log redirection.find ~/.config/hypr -name "*.sh" -exec chmod +x {} \; find ~/.config/waybar/ -name "*.sh" -exec chmod +x {} \; find ~/.config/ml4w -type f -path "*/scripts/*" -exec chmod +x {} \; mkdir -p ~/.mydotfiles -
Reboot and log into ML4W Hyprland:
From your login manager's session menu, select Hyprland, enter your password, and enjoy your new ML4W desktop!reboot
💡 If you encounter "Could not resolve host" errors while downloading packages or cloning repos, add custom nameservers (1.1.1.1 and 8.8.8.8) to your configuration.nix with networking.nameservers = [ "1.1.1.1" "8.8.8.8" ]; and networking.networkmanager.dns = "none";, then rebuild. Keep your root partition at 30GB+ (ML4W takes about 15GB) to ensure enough space for all packages and dependencies.
Prerequisites
To install ML4W Hyprland dotfiles, we only need a base NixOS system installed. I'm installing it on my NixOS system with Budgie as its desktop environment. If you don't have NixOS installed, I would recommend you first follow my guide:
Install NixOS with Budgie or any desktop environment you want, then come back to this guide and continue. Make sure to give your root partition enough space, like around 30 GB+, because the total amount of space after installing ML4W is 15 GB. The remaining space is for your other data.
System Requirements for ML4W on NixOS:
- Processor: Any x86-64 compatible
- RAM: Minimum 8GB (but more RAM is better)
- Storage: Minimum 30GB (it's only for NixOS system files and ML4W files), you will need more storage space for additional packages and files
- GPU: Any 2015+ GPU
- OS: Minimal/base NixOS
- Stable internet connection
Step 1: Add Hyprland and XDG Desktop Services
In this step, we will add Hyprland, XDG, Polkit, systemd-tmpfiles, and other services to /etc/nixos/configuration.nix that are needed to run ML4W Hyprland on NixOS.
- Open terminal and run:
sudo nano /etc/nixos/configuration.nix - In the configuration.nix add the following services:
programs.hyprland.enable = true; xdg.portal.enable = true; xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-gtk]; security.polkit.enable = true; services.flatpak.enable = true; qt.enable = true; systemd.tmpfiles.rules = [ "L+ /bin/bash - - - - ${pkgs.bash}/bin/bash" ];
- To save the file, press CTRL + O and press ENTER.
Could not resolve host during NixOS rebuild
If you hit errors like Could not resolve hostname (X) Could not resolve host or 1 dependency failed while downloading packages or repos from GitHub, this usually happens because of the default nameserver provided by your ISP, which may block access to certain packages or GitHub altogether. This issue might be region‑specific, but the fix below works for NixOS.
🔍 This does not mean your configuration is wrong. In most cases, it is caused by one of the following:
- Network or Firewall Restrictions: Your local firewall, ISP, or proxy may be blocking outbound connections on certain ports.
- Mirror Issues: The NixOS cache mirror you are using may be slow, temporarily down, or unreachable.
- DNS Problems: Your configured nameserver may be failing to resolve the mirror's or GitHub's IP address.
✅ Quick fix for NixOS: add custom nameservers to your configuration:
sudo nano /etc/nixos/configuration.nix
Then add these lines inside the { ... } block:
networking.nameservers = [
"1.1.1.1"
"8.8.8.8"
];
networking.networkmanager.dns = "none";
Save the file (CTRL+O, ENTER, then CTRL+X) and rebuild:
sudo nixos-rebuild switch
This sets Cloudflare and Google DNS as your resolvers and tells NetworkManager not to override them.
Step 2: Add and Install ML4W Hyprland Dotfiles Packages on NixOS
In this step, we will add the core packages and components that are needed to run ML4W Hyprland dotfiles on NixOS. At this step, I was jumping back and forth on the internet between the official ML4W readme doc and forums because of the package mismatches and alternatives, especially the Wayland's QT5 and QT6 packages.
2.1: Add ML4W Hyprland Dotfiles Dependencies on NixOS
- To add ML4W packages and components, open /etc/nixos/configuration.nix:
sudo nano /etc/nixos/configuration.nix - Next, in the environment.systemPackages, add the following packages and components for ML4W:
environment.systemPackages = with pkgs; [ # ML4W core tools wget unzip gum rsync git figlet xdg-user-dirs jq xclip htop fastfetch eza fzf neovim vlc # Hyprland stack hyprland hyprpaper hyprlock hypridle hyprpicker xdg-desktop-portal-gtk xdg-desktop-portal-hyprland # Wayland UI specifics waybar rofi swaynotificationcenter wlogout waypaper nwg-dock-hyprland nwg-look qt5Packages.qt6ct papirus-icon-theme bibata-cursors kdePackages.breeze-icons # Audio / Network / Bluetooth pavucontrol networkmanagerapplet blueman # Misc brightnessctl imagemagick tumbler gvfs tesseract libnotify kitty gnome-calculator qt5.qtwayland qt6.qtwayland qt6.qt5compat # Python dependencies python3Packages.pip python3Packages.pygobject3 python3Packages.screeninfo # Fonts font-awesome fira-sans fira-code # Theme / Wallpaper daemon awww matugen kore-icon-theme # Quickshell quickshell ]; fonts.packages = with pkgs; [ nerd-fonts.fira-code ];
ML4W Packages Purpose
- wget: A command-line utility for downloading files from the web.
- unzip: A utility for extracting files from ZIP archives.
- gum: A command-line tool for creating interactive and user-friendly shell scripts.
- rsync: A utility for efficiently synchronizing and copying files between directories or systems.
- git: A distributed version control system used to download, manage, and track source code repositories.
- figlet: A command-line utility that displays text using large ASCII-art characters.
- xdg-user-dirs: Creates and manages standard user directories such as Documents, Downloads, Music, Pictures, and Videos.
- jq: A lightweight command-line processor for parsing and manipulating JSON data.
- xclip: A command-line utility for accessing and manipulating the X11 clipboard.
- htop: An interactive process viewer that displays CPU, memory, and running process information.
- fastfetch: A system information utility that displays hardware and operating system details in the terminal.
- eza: A modern replacement for the traditional ls command with improved file listing features.
- fzf: A fast, general-purpose command-line fuzzy finder used to interactively search and select files, commands, and other text.
- neovim: A modern, extensible version of the Vim text editor designed for efficient terminal-based editing.
- vlc: A versatile multimedia player capable of playing a wide range of audio and video formats.
- hyprland: A dynamic Wayland compositor that provides window management and the graphical desktop environment.
- hyprpaper: A lightweight wallpaper utility designed for Hyprland and Wayland.
- hyprlock: A screen locker designed specifically for Hyprland and Wayland.
- hypridle: An idle management daemon for Hyprland that can trigger actions such as locking the screen or turning off displays after periods of inactivity.
- hyprpicker: A Wayland color picker that allows users to select and copy colors directly from the screen.
- xdg-desktop-portal-gtk: A GTK-based XDG portal backend that provides desktop integration features such as file dialogs for applications.
- xdg-desktop-portal-hyprland: A portal backend for Hyprland that provides Wayland desktop integration features such as screen sharing and screenshots.
- waybar: A highly customizable status bar for Wayland compositors that displays information such as workspaces, network, audio, and system resources.
- rofi: An application launcher and window switcher that provides a searchable interface for launching applications and performing other actions.
- swaynotificationcenter: A notification daemon and notification center designed for Wayland desktops.
- wlogout: A graphical logout menu for Wayland that provides actions such as logout, shutdown, reboot, suspend, and lock.
- waypaper: A graphical wallpaper manager for Wayland compositors that simplifies selecting and applying wallpapers.
- nwg-dock-hyprland: A dock application designed for Hyprland that provides quick access to applications and desktop controls.
- nwg-look: A GTK settings utility for configuring the appearance of GTK applications on Wayland desktops.
- qt5Packages.qt6ct: Provides qt6ct, a graphical configuration tool for customizing the appearance and behavior of Qt 6 applications.
- papirus-icon-theme: A modern icon theme that provides consistent icons for applications and desktop components.
- bibata-cursors: A modern cursor theme that provides customizable mouse pointers for the desktop environment.
- kdePackages.breeze-icons: The Breeze icon set used by KDE applications and other desktop applications that support the theme.
- pavucontrol: A graphical PulseAudio/PipeWire volume control utility for managing audio devices, applications, and input/output levels.
- networkmanagerapplet: A graphical system tray applet for managing network connections through NetworkManager.
- blueman: A graphical Bluetooth manager for discovering, pairing, and managing Bluetooth devices.
- brightnessctl: A command-line utility for controlling the brightness of supported displays and backlight devices.
- imagemagick: A powerful image manipulation toolkit used for converting, resizing, editing, and processing images.
- tumbler: A thumbnail generation service used by file managers to create previews of images, videos, and other files.
- gvfs: Provides virtual filesystem support that allows desktop applications to access resources such as network locations, removable devices, and remote filesystems.
- tesseract: An optical character recognition (OCR) engine used to extract text from images.
- libnotify: A library that allows applications to display desktop notifications.
- kitty: A fast and feature-rich terminal emulator with support for GPU acceleration, tabs, layouts, and extensive customization.
- gnome-calculator: A graphical calculator application supporting basic and advanced mathematical calculations.
- qt5.qtwayland: Provides Wayland support for Qt 5 applications, allowing them to run natively on Wayland compositors.
- qt6.qtwayland: Provides Wayland support for Qt 6 applications, allowing them to run natively on Wayland compositors.
- qt6.qt5compat: Provides compatibility APIs that allow Qt 6 applications to use certain APIs originally provided by Qt 5.
- python3Packages.pip: The Python package installer used to install and manage Python packages.
- python3Packages.pygobject3: Provides Python bindings for GObject-based libraries, allowing Python applications to interact with GTK and other GNOME libraries.
- python3Packages.screeninfo: A Python library used to retrieve information about connected displays and their screen resolutions and positions.
- font-awesome: A popular icon font that provides a large collection of icons for applications, panels, and desktop interfaces.
- fira-sans: A clean, highly readable sans-serif font commonly used for graphical user interfaces and desktop applications.
- fira-code: A programming font that includes ligatures designed to improve the readability of source code.
- awww: A Wayland wallpaper daemon that provides fast and smooth wallpaper transitions and dynamic wallpaper management.
- matugen: A material-based color generation tool that creates color palettes from images, commonly used to dynamically theme desktop applications.
- kore-icon-theme: An icon theme that provides an alternative modern icon set for Linux desktop environments.
- quickshell: A framework for creating highly customizable desktop panels, widgets, launchers, and other graphical components using QML.
Purpose of the Fonts Configuration:
- fonts.packages: Defines the fonts that NixOS installs and makes available system-wide.
- nerd-fonts.fira-code: Installs the Fira Code Nerd Font, which combines Fira Code with additional icons and symbols used by terminal applications, prompts, and desktop widgets.
- After adding the ML4W Hyprland dependencies, press CTRL + O to save the changes then press ENTER, then press CTRL + X to exit the file.
2.2: Install ML4W Hyprland Dotfiles Dependencies on NixOS
Now that the ML4W Hyprland dotfiles dependencies have been added, let's rebuild the NixOS system so the new changes can be applied.
- In the terminal, run:
sudo nixos-rebuild switch
- After running the rebuild command, the NixOS system will read the configuration.nix file, and start downloading and installing all the new packages we just added.
- Some of the packages will need to compile and build from source, such as quickshell.
- The whole process will take roughly 5 to 15 minutes depending on the speed of the internet and CPU for compiling.
- After the rebuild is completed, we also need to initiate the systemd-tmpfiles rule for the /bin/bash symbolic link we created in the Adding Hyprland and XDG Desktop Services step. Run:
sudo systemd-tmpfiles --create
Step 3: Clone ML4W Hyprland and Apply Dotfiles on NixOS
In this step, we will clone the actual ML4W Hyprland Dotfiles from GitHub and apply configs to our NixOS system.
3.1: Clone ML4W Hyprland Dotfiles on NixOS
3.2: Apply ML4W Hyprland Dotfiles to NixOS
Step 4: Execute ML4W Hyprland Dotfiles Start Scripts on NixOS and Reboot
In this step, we will find and execute the ML4W Hyprland dotfiles scripts that are responsible for launching ML4W's configs, services, themes, applications, wallpaper daemon, quickshell/waybar and other components. We need to do this, so these ML4W scripts autostart their components on each Hyprland session.
4.1: Search and Execute ML4W Scripts on NixOS
4.2: Create mydotfiles Directory
4.3: Reboot
Now that everything is set and applied for ML4W Hyprland dotfiles on NixOS, reboot the PC to log into the ML4W Hyprland session.
- Run the reboot command:
reboot
Step 5: Log into ML4W Hyprland Dotfiles on NixOS
Now, I have installed budgie as my desktop environment on NixOS while installing NixOS so its default login manager lightdm got installed automatically, if you are using NixOS without any desktop environment then install a lightweight login manager or just run Hyprland to log into the ML4W Hyprland session on NixOS. I have a login manager installed so from my session's dropdown menu, I will select Hyprland and enter my password.
And, we are in!
❓ Frequently Asked Questions: Installing ML4W Hyprland Dotfiles on NixOS
Why would I want to install ML4W Hyprland dotfiles manually on NixOS instead of using the official installer?
The official ML4W installer is designed specifically for Arch Linux and assumes a standard Arch environment with systemd and pacman. NixOS uses a completely different package management and system configuration approach (declarative, with configuration.nix). Installing manually gives you full control over which packages are added, how services are configured, and allows you to integrate ML4W with your existing NixOS setup without breaking the declarative model.
What are the prerequisites for this manual installation?
You need a base NixOS system already installed (with or without a desktop environment). I used Budgie with LightDM as my login manager, but any desktop environment works. Make sure your root partition has at least 30 GB of free space (ML4W itself takes about 15 GB after installation). You'll also need a stable internet connection and sudo/root access.
Why do I need to add the systemd-tmpfiles rule for /bin/bash?
ML4W's autostart scripts and some components rely on /bin/bash being present at that exact path. NixOS does not create this symlink by default because it uses a different filesystem hierarchy. The systemd-tmpfiles rule we add creates a symbolic link from /bin/bash to the Bash executable provided by NixOS, ensuring that all ML4W scripts that reference /bin/bash work correctly.
What should I do if I get a "Could not resolve host" error while downloading packages or cloning repos?
This usually happens because your ISP's default nameserver is blocking or failing to resolve GitHub or NixOS cache domains. The fix is to add custom nameservers (like 1.1.1.1 and 8.8.8.8) to your /etc/nixos/configuration.nix with networking.nameservers = [ "1.1.1.1" "8.8.8.8" ]; and networking.networkmanager.dns = "none";, then rebuild your system. This is covered in detail in the "Fix 'Could not resolve host' Error" section of the guide.
How long does the entire installation process take?
The nixos-rebuild step (Step 2.2) takes roughly 5 to 15 minutes depending on your internet speed and CPU, as some packages like quickshell compile from source. The rest of the steps (cloning, copying configs, executing scripts) take only a few minutes. Overall, the entire process should take 15 to 25 minutes on average.
What is the mydotfiles directory for, and why do I need to create it manually?
The ~/.mydotfiles directory is required by ML4W's autostart process. The file ~/.config/hypr/conf/autostart.lua redirects the output of the ml4w-autostart script to ~/.mydotfiles/ml4w-autostart.log. Without this directory, the shell cannot create the log file, causing the redirection to fail before the autostart script even runs. The official ML4W installer creates this directory automatically, but since we are doing a manual installation on NixOS, we need to create it ourselves.
Can I dual-boot ML4W Hyprland with my existing desktop environment on NixOS?
Yes, absolutely. Since NixOS allows you to have multiple desktop environments installed simultaneously, you can keep your existing desktop (like Budgie, GNOME, or KDE) and simply select Hyprland from your login manager's session menu. Your existing desktop environment remains untouched and fully functional.
What if I don't have a login manager installed on my NixOS system?
If you installed NixOS without any desktop environment, you likely don't have a display/login manager installed. In that case, you can simply install a lightweight one like LightDM or SDDM, or you can start Hyprland directly from the terminal by running Hyprland after logging in. The guide explains both approaches.
Is the rollback feature included with this manual installation?
No, the rollback feature is not included by default in this manual installation because NixOS itself has a built-in rollback mechanism through its generations system. Every time you run sudo nixos-rebuild switch, a new generation is created, and you can boot into previous generations from the GRUB menu. You don't need Snapper or grub-btrfs on NixOS – the system already provides robust rollback capabilities.
What are the minimum system requirements for ML4W Hyprland on NixOS?
Since ML4W is a feature-rich Hyprland configuration, you need at least 8 GB RAM (16 GB recommended), a 64-bit processor (x86-64 compatible), and a GPU from 2015 or later with decent Vulkan support. For storage, make sure your root partition has at least 30 GB of free space, as the total installation (system + ML4W) takes about 15 GB, and you'll need additional space for future packages.
Can I update ML4W dotfiles after installation?
Yes. Since you cloned the dotfiles from the official GitHub repository, you can simply pull the latest changes by running git pull inside the ~/Downloads/dotfiles directory and then re-apply the configs (Step 3.2). However, keep in mind that future updates may change the directory structure or filenames, so always double-check the contents of the updated dotfiles before copying them over.
What if I make a mistake during installation – can I start over?
Yes. Since NixOS is declarative, you can simply revert changes by editing your configuration.nix to remove the ML4W packages and services, then run sudo nixos-rebuild switch to roll back your system state. For the dotfiles themselves, you can delete the ~/.config/hypr, ~/.config/ml4w, and other related directories, and start fresh from Step 3. Your base NixOS system remains intact.
🚀 ML4W Hyprland on NixOS: Fully Set Up!
We now have ML4W's feature‑rich, beginner‑friendly Hyprland environment running on a declarative NixOS base, blending the polished workflow of Stephan Raabe's design with the rock‑solid reproducibility of Nix. Between the built‑in settings app, the curated GTK aesthetics, and the tiling Wayland workflow, your NixOS desktop is genuinely complete.
If this completed your NixOS Hyprland journey, stick around — MusaBase has plenty more Linux, BSD, and virtualization guides where this came from.
101 out, I'll see you in the next one! 🚀




