Installation with Flakes
Mango provides both a NixOS module and a Home Manager module for declarative configuration.
Add Mango to flake inputs
Add the Mango flake to your flake.nix inputs:{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
mango = {
url = "github:mangowm/mango";
inputs.nixpkgs.follows = "nixpkgs";
};
};
# ...
}
Enable NixOS module
Add the Mango NixOS module to your system configuration:{
imports = [
inputs.mango.nixosModules.mango
];
programs.mango.enable = true;
}
This installs Mango and sets up necessary Wayland environment components. Configure with Home Manager
Add the Home Manager module for user-specific configuration:{
imports = [
inputs.mango.hmModules.mango
];
wayland.windowManager.mango = {
enable = true;
settings = ''
# Your Mango configuration
# See config.conf documentation
# Example keybindings
bind = alt,return,exec,foot
bind = alt,space,exec,rofi -show drun
bind = alt,q,killclient
'';
autostart_sh = ''
# Autostart applications
# No shebang needed
waybar &
swaybg -i ~/wallpaper.png &
mako &
'';
};
}
Rebuild your system
Apply the configuration:sudo nixos-rebuild switch --flake .#your-hostname
Complete Flake Example
Here’s a complete example using flake-parts:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
mango = {
url = "github:mangowm/mango";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
debug = true;
systems = [ "x86_64-linux" ];
flake = {
nixosConfigurations = {
hostname = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
inputs.home-manager.nixosModules.home-manager
# Add mango nixos module
inputs.mango.nixosModules.mango
{
programs.mango.enable = true;
}
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "backup";
users."username".imports = [
# Add mango hm module
inputs.mango.hmModules.mango
({ ... }: {
wayland.windowManager.mango = {
enable = true;
settings = ''
# see config.conf
'';
autostart_sh = ''
# see autostart.sh
# Note: here no need to add shebang
'';
};
})
];
};
}
];
};
};
};
};
}
The Nix package automatically includes these dependencies:
Build-time dependencies:
- meson
- ninja
- pkg-config
- wayland-scanner
Runtime dependencies:
- libinput (>=1.27.1)
- libxcb
- libxkbcommon
- pcre2
- pixman
- wayland (>=1.23.1)
- wayland-protocols
- wlroots_0_19 (>=0.19.0)
- scenefx (>=0.4.1)
- libGL
XWayland support (enabled by default):
- libX11
- libxcb-wm
- xwayland
Configuration Options
Enable Mango compositor system-wide
wayland.windowManager.mango.enable
Enable Mango for the current user
wayland.windowManager.mango.settings
Mango configuration content (equivalent to config.conf)
wayland.windowManager.mango.autostart_sh
Autostart script content (no shebang needed)
Suggested Packages
Add these packages to your configuration for a complete environment:
{ pkgs, ... }:
{
home.packages = with pkgs; [
# Terminal
foot
# Launcher
rofi-wayland
# Status bar
waybar
# Wallpaper
swaybg
# Clipboard
wl-clipboard
wl-clip-persist
cliphist
# Screenshots
grim
slurp
satty
# Notifications
mako
# or
# swaync
# Night light
wlsunset
# or
# gammastep
# Authentication
xfce.xfce4-settings # for xfce-polkit
];
}
Next Steps
Configuration
Configure Mango to your preferences
Keybindings
Learn default keybindings and create custom ones