Table of Contents
- Building on NixOS
- Installing the dependencies under Nix
- Install dependencies with Home Manager (Recommended)
- Install dependencies in a standard Nix configuration
- Build
- OpenGL on non-NixOS
- Launching with nixGLDefault (tries to auto-detect your setup)
- Launching with nixGLNvidia (uses Nvidia drivers)
- Launching with nixGLNvidiaBumblebee (uses Nvidia drivers on hybrid hardware)
- Launching with nixGLIntel (uses Mesa drivers for AMD, Intel, Nouveau, etc.)
- NixOS.txt Contents
Building on NixOS
Warning
This is user-contributed content. NixOS is not directly supported by the DOSBox Staging team. If something doesn't work, please don't contact the core team and don't raise an issue ticket but get in touch with fellow NixOS users and update this wiki page if needed.
Compiling code on Nix requires slightly different inputs from other Linux distros,
since the appropriate environment variables for pkg-config are only avaliable
under the nix-shell command.
Note
CMake support is currently an experimental internal-only, work-in-progress feature; it's not ready for public consumption yet. Please ignore the
CMakeLists.txtfiles in the source tree.
Installing the dependencies under Nix
Nix has a unique toolset where you are not required to install the dependencies to run them. However, if you still want to, we recommend you to do the following:
Install dependencies with Home Manager (Recommended)
-
Install Home-Manager: https://github.com/nix-community/home-manager#installation.
-
After following the installation guide, add the following packages on your home.nix:
home.packages = [ pkg-config gcc_multi cmake ccache SDL2 SDL2_net fluidsynth glib gtest libGL libGLU libjack2 libmt32emu libogg libpng libpulseaudio libslirp libsndfile meson ninja opusfile libselinux speexdsp stdenv alsa-lib xorg.libXi irr1 ] -
Rebuild with the command
home-manager switch
Install dependencies in a standard Nix configuration
-
Add the following packages to configuration.nix:
environment.systemPackages = [ pkg-config gcc_multi cmake ccache SDL2 SDL2_net fluidsynth glib gtest libGL libGLU libjack2 libmt32emu libogg libpng libpulseaudio libslirp libsndfile meson ninja opusfile libselinux speexdsp stdenv alsa-lib xorg.libXi irr1 ];
Build
After you git clone https://github.com/dosbox-staging/dosbox-staging.git and
finish setting it up, create a NixOS.txt (text at the end of this wiki page)
and then run the following command from the terminal, with or without the
dependencies installed:
nix-shell -p $(cat NixOS.txt) --run 'meson setup build'
Once it's finished setting up the build, run:
nix-shell -p $(cat NixOS.txt) --run 'meson compile -C build'
After that, you should be all set! Your binary will be located in build/dosbox!
See more build options in BUILD.md.
OpenGL on non-NixOS
If you are either running in a nixpkgs setup or with NixOS installed inside of another system (using the Chroot method), you may have issues getting OpenGL working with DOSBox Staging. This is caused by how Nix handles OpenGL, and can be fixed with wrappers developed by the community.
Currently, we recommend installing the nixGL wrapper, as it works flawlessly with DOSBox Staging. After installing the wrapper appropriate to your hardware, run the following command in the terminal to launch your binary:
Launching with nixGLDefault (tries to auto-detect your setup)
nixGL ./build/dosbox
Launching with nixGLNvidia (uses Nvidia drivers)
nixGLNvidia ./build/dosbox
Launching with nixGLNvidiaBumblebee (uses Nvidia drivers on hybrid hardware)
nixGLNvidiaBumblebee ./build/dosbox
Launching with nixGLIntel (uses Mesa drivers for AMD, Intel, Nouveau, etc.)
nixGLIntel ./build/dosbox
NixOS.txt Contents
meson ninja gcc_multi cmake ccache SDL2 SDL2_net gtest \
fluidsynth glib libGL libGLU libjack2 libmt32emu libogg libpng libpulseaudio \
libslirp libsndfile opusfile libselinux speexdsp stdenv alsa-lib xorg.libXi \
iir1 pkg-config ffmpeg
General
How-to's
- Adding utilities
- Applications
- Config file examples
- Dual-mouse gaming
- Getting started
- Instant launch
- Joysticks and Gamepads
- Keymapper
- Multiplayer & serial ports
- Windows
Lists
- AUTOTYPE candidates
- CDDA / GUS / MIDI games
- DOS/32A compatibility
- Dual OPL2 and OPL3 games
- Games with enhanced Tandy & PCjr graphics and sound
- Shaders
- Special keys
Audio
- Audio mixer signal flow diagram
- Audio configuration recommendations
- GUS enhancements
- MIDI
- Sound cards
- True 16-bit audio games
Video
Issues
Dev
- How to contribute
- Release process
- Audio tests
- CPU tests
- DOS tests
- Input tests
- Performance tests
- Video tests — Video modes
- Video tests — CRT shaders
- Video tests — Presentation
- Learning DOS programming
- Intel compiler tips