ML4W is a polished Hyprland setup with a GUI settings app, which makes it one of the gentler ways into Hyprland. It is also Arch-only. The installer assumes pacman, assumes systemd laid out the way Arch lays it out, and assumes it can write anywhere.
I ported it to NixOS by hand. Translating the package list was the part I expected to be hard, and it took an afternoon of reading nixpkgs. The part that actually cost me was smaller and far more annoying.
An installer does two things. It installs packages, which is visible and documented, and it creates preconditions, which is neither. On Arch nobody notices the second category because the installer handles it and the assumptions happen to hold. Port it somewhere else and those invisible preconditions are what break you.
For ML4W there were three.
Precondition 1: a path that does not exist on NixOS
ML4W's scripts hardcode /bin/bash. NixOS does not have it, because everything lives in the store.
Rather than patching shebangs across the whole dotfiles tree, create the path:
systemd.tmpfiles.rules = [
"L+ /bin/bash - - - - ${pkgs.bash}/bin/bash"
];
One thing that is easy to miss: after the rebuild you still need to make the rule take effect for the current boot.
sudo systemd-tmpfiles --create
Precondition 2: executable bits
The Arch installer marks ML4W's scripts executable as part of its run. Clone the repo and copy the configs yourself and you are responsible for that:
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 {} \;
Three separate trees, because ML4W keeps scripts in three places. Miss one and you get a desktop with a bar but no working buttons, which is a confusing state to debug because most of it looks fine.
Precondition 3: the one that cost me an evening
This is the good one.
mkdir -p ~/.mydotfiles
That directory holds nothing. Nothing is installed into it. It exists so a log file can be written into it.
Here is the failure chain. ~/.config/hypr/conf/autostart.lua runs ML4W's autostart script and redirects its output to ~/.mydotfiles/ml4w-autostart.log. Shell redirection is set up before the command runs. If the directory does not exist, the shell cannot create the log file, so the redirection fails, so ml4w-autostart never executes at all.
Which means you log into Hyprland and get a bare compositor. No bar, no wallpaper, no dock, no notifications. Nothing that was supposed to autostart started.
And the detail that makes it genuinely nasty: the thing that failed was the log. There is no ml4w-autostart.log to read, because being unable to create ml4w-autostart.log is the entire problem. You go looking for the log that would explain the failure and its absence is the failure.
One mkdir fixes it. The Arch installer has always done it for you, silently, which is why it appears in no troubleshooting guide anywhere.
The package list, briefly
Worth saying the translation was not trivial either, just predictable. Most of ML4W's dependencies map cleanly onto nixpkgs names. The Qt packages were where I lost time, because the Qt5 and Qt6 split is named inconsistently and you need pieces of both:
qt5.qtwayland qt6.qtwayland qt6.qt5compat
qt5Packages.qt6ct
Read that last line twice. qt6ct, the Qt 6 configuration tool, lives under qt5Packages. That is not a typo in my config, it is where nixpkgs keeps it, and I spent a while convinced I had the wrong attribute name.
Alongside that you need the Hyprland stack, the Wayland UI pieces (waybar, rofi, swaynotificationcenter, wlogout, waypaper, nwg-dock-hyprland), three Python modules ML4W's scripts import, and quickshell, which compiles from source and is most of why the rebuild takes 5 to 15 minutes.
The whole sequence
Services and the tmpfiles rule into configuration.nix, packages into environment.systemPackages, then:
sudo nixos-rebuild switch
sudo systemd-tmpfiles --create
Clone upstream and copy the configs across unmodified:
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
Then the three chmod passes, the mkdir, and reboot. Pick Hyprland from your login manager's session menu.
Check the directory layout in the clone before running those copies. ML4W reorganises between releases and these paths are the kind that move.
Also worth knowing: NixOS lets you keep your existing desktop. I ran this on a Budgie install and Budgie was completely untouched, sitting in the session menu next to Hyprland. If the port had gone badly I would have logged back into a working desktop, which is a reasonable safety net for an unsupported install.
The transferable bit
If you are porting installer-based software to a distro it does not support, read the installer for what it creates, not just what it installs.
grep it for mkdir, for chmod, for ln -s, for anything touching paths outside its own tree. The package list is the part everyone translates because the package list is the visible part. The three lines that create a directory, flip some permission bits and make a symlink are the ones that will have you staring at a blank compositor at one in the morning.
The full walkthrough, with the complete annotated package list, the DNS fix if your ISP blocks the Nix cache, screenshots of every step and a long FAQ, is on my site: How to Install ML4W Hyprland Dotfiles on NixOS.
It is one of a set. The same treatment for Caelestia, End-4, JaKooLit and HyDE on NixOS, and a comparison of all five if you have not picked one.
If you have hit your own version of the .mydotfiles bug, a precondition so invisible that its failure destroys the evidence of itself, I would like to read about it in the comments.
Originally published on MusaBase.

Top comments (0)