I’m trying to run the Happ proxy utility on NixOS. The problem is that the program only comes as a DEB/RPM package; there’s not even an AppImage or source code to build from. I tried running the DEB via steam-run and even through a Docker container, but nothing worked (reports missing libcom package or can’t access graphics server). Is there any way to run Happ on NixOS?
Привет, получилось как-нибудь запустить happ?
Hello, is there any progress solving it?
It seems I could install. Here is the instruction:
- Setup docker or podman in your configuration.nix.
- Append distrobox to the systemPackages.
- nixos-rebuild switch
- Create container with image of arch linux:
distrobox create --name happ-arch –image archlinux:latest –additional-flags “–cap-add=NET_ADMIN” –additional-flags “–device=/dev/net/tun” - Enter to container: distrobox enter happ-arch
- Update pacman: sudo pacman -Syu
- Install wget: sudo pacman -S wget
- Install fontconfig: sudo pacman -Syu fontconfig
- Download Happ: wget https://github.com/Happ-proxy/happ-desktop/releases/latest/download/Happ.linux.x64.pkg.tar.zst
- Install Happ from tar: sudo pacman -U Happ.linux.x64.pkg.tar.zst --noconfirm
Now you can run happ from command line, it should be started. I couldn’t configure the TUN, but I was able to configure the SOCKS. It helped me to fix my Telegram. Also I had SOCKS plugin in my Chrome.
Here is my implementation, as a nixos module. WARNING: this includes privileged happd daemon which may corrupt network settings!
This module could be improved by adding some settings like services.happ.enable, but it already works as is.
{ pkgs, lib, ... }:
let
happ = pkgs.stdenv.mkDerivation rec {
pname = "happ";
version = "2.16.2";
src = pkgs.fetchurl {
url = "https://github.com/Happ-proxy/happ-desktop/releases/download/${version}/Happ.linux.x64.deb";
hash = "sha256-UffOBCmk2vXsAgGndYZBBU796vrHdihaB4jlBrOL//U=";
};
nativeBuildInputs = with pkgs; [
autoPatchelfHook
dpkg
];
buildInputs = with pkgs; [
stdenv.cc.cc # for libstdc++
libGL
libxcb
libz
fontconfig
freetype
libgpg-error
e2fsprogs # for libcom_err
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -r usr/share $out/
cp -r opt/ $out/
ln -s ../opt/happ/bin/Happ $out/bin/happ
# openssl libs are loaded dynamically, make them visible for happ
ln -s ${lib.getLib pkgs.openssl}/lib/libcrypto.so $out/opt/happ/lib/
ln -s ${lib.getLib pkgs.openssl}/lib/libssl.so $out/opt/happ/lib/
# broken - missing libQt6WlShellIntegration.so.6
rm $out/opt/happ/lib/plugins/wayland-shell-integration/libwl-shell-plugin.so
runHook postInstall
'';
};
in {
environment.systemPackages = [
happ
];
systemd.services.happd = {
# replicate systemd settings from the package
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${happ}/opt/happ/bin/happd";
Restart = "on-failure";
RestartSec = "5s";
NoNewPrivileges = false;
TimeoutStopSec = "10s";
KillMode = "mixed";
KillSignal = "SIGTERM";
};
};
}
Hey everyone, I wrote my own implementation to get Happ working.
Here’s the repository: GitHub - MrShitFox/happ-nixos: Happ for NixOS · GitHub
There are instructions there, give it a try if you’re interested.
PR’s are welcome.
Everything runs perfectly—you just follow the instructions like an idiot, and that’s it. Zero hassle.
Thanks for the feedback, comrade
works perfectly
please add it to the NixOS repo
Given how picky the Nix Repo maintainers are, I don’t think it’s worth the effort. Thanks for feedback.
The HWID issue has been resolved in version, v0.2
If you do not specifically need Happ, you can use other proxy utilities available in NixOS. I recommend using the unstable versions, since they are outdated in version 26.05 “Yarara.” Here are a few similar utilities in NixOS:
Comrade, I’d be glad to use them, and I think everyone else would too. But all of them are either mediocre on their own, or ruined by the Nix Repo maintainers who strip out mandatory dependencies for reasons known only to them.
Throne is decent - I’ve used it myself. But it’s based on sing-box, which at the very least lacks XHTTP support, and that’s a dealbreaker given current realities.
v2rayA is just weird, doesn’t support the required configurations either, and lags even further behind Throne.
v2rayN is actually a good client; I used to use it and recommend it to people myself. But this is exactly where the Nix maintainers are at fault: it doesn’t have xray-core or sing-box in its dependencies, and it doesn’t even include geo-files for routing. Using it in this state is simply impossible - it’s completely against the “Reproducible and Declarative” approach.
So, none of the listed clients are suitable anymore for handling the harsh conditions of the “Great Russian Firewall.”
That’s why I created happ-nixos. It’s not a perfect tool, Hysteria doesn’t work, but it’s still much better than what the official repositories offer.
happ-nix - modern flake with program and nixosModule which also works on wayland
thanks MrShitFox for inspiring, i didn’t watch into problem with Hysteria, but vless and tun work so i am happy
will be glad to see your feedback, issues, mr’s
What’s the point of downloading your flake when there’s an option that’s simpler—and more declarative, you could say? I don’t see the point of your “development”—whatever inspired it.
P.S I’d like to say in advance that I’m not trying to offend anyone with my reply; I’m just speaking my mind.
I see what you mean, although the reply feels a little harsh)
As I mentioned, the main reason for my rewrite was that I wanted it to be a proper flake. That’s simply the direction I prefer for Nix projects nowadays, and it seems to be where most of the ecosystem is heading as well. A flake provides a standard interface for packages, apps, devShells, NixOS modules, and so on.
It also makes the project more convenient to use. For example, you can just run it directly from command line to test it out, or install it as a NixOS module if you want the tunnel capabilities.
As for the point of my work, I also fixed a few things that didn’t fit well with NixOS. For example, the original project stored its data under /opt, which isn’t really in line with Nix conventions, so I moved it into the /nix/store.
I also wasn’t quite sure what you meant by “more declarative.” From my point of view, flakes actually push things further in that direction because they pin dependencies and make the outputs reproducible. Maybe I’m missing your point though, correct me if i’m wrong.



