I recently started using nix-darwin, allowing me to use Nix for managing both macOS and NixOS.
My dotfiles are organized in modules, and I planned to enable/disable modules based on which OS I’m using. However, nix throws an error on macOS if it sees a NixOS-only config value (e.g. services.xserver
), even when those options are disabled explicitly with mkIf false
.
What’s the best way to use modules across NixOS and macOS? Do I need conditional imports?