A reproducible Nix flake for running Lunar Client on NixOS. This flake wraps the official AppImage, handles all necessary dependencies (OpenGL, PulseAudio, X11), and integrates the application into your desktop environment with a proper icon and shortcut.
You can launch the client immediately without adding it to your system configuration:
nix run github:clonidine/lunar-client-flakeTo install Lunar Client permanently so it appears in your application menu, add this flake to your system configuration.
Update your system's flake.nix to include this repository:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
lunar-client.url = "github:clonidine/lunar-client-flake";
};
outputs = { self, nixpkgs, lunar-client, ... }@inputs: {
nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [ ./configuration.nix ];
};
};
}Include the package in your system packages:
{ pkgs, inputs, ... }: {
environment.systemPackages = [
inputs.lunar-client.packages.${pkgs.stdenv.hostPlatform.system}.default
];
}Then apply the changes:
sudo nixos-rebuild switch --flake .Lunar Client updates frequently. This repository is equipped with a GitHub Action that runs weekly to keep the flake synchronized with official releases.
If you want to update the flake manually:
- Clone this repository.
- Run the updater script:
./updater.sh
- The script will fetch the latest version, update the SRI hash, and patch
flake.nixautomatically.
Ensure you have installed the flake via environment.systemPackages. The flake installs the .desktop file to share/applications and the icon to share/icons/hicolor. You may need to restart your session or refresh your app launcher for changes to take effect.
While the launcher icon is fixed, the game window (e.g., Lunar Client 1.7.10 or 1.21) may still show a generic "gear" icon in the dock. This is due to Java dynamically changing the window's wmclass based on the version launched. The launcher itself is correctly mapped using StartupWMClass.
If the client opens to a black screen, ensure your graphics drivers are correctly configured:
- Nvidia: Verify that
hardware.graphics.enable = true;(orhardware.opengl.enableon older NixOS) andhardware.nvidia.modesetting.enable = true;are set in your configuration.
This flake is licensed under the MIT License. Disclaimer: Lunar Client is proprietary software. By using this flake, you agree to the Lunar Client Terms of Service.