Skip to content

mescam/nixearthlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nixearthlayer

Nix flake for xearthlayer - streaming satellite imagery for X-Plane 12 flight simulator.

Binary Cache

Pre-built binaries are available via Cachix:

nix run nixpkgs#cachix -- use mescam

Or add to your NixOS configuration:

{
  nix.settings.substituters = [ "https://mescam.cachix.org" ];
  # Run 'cachix use mescam' to get the public key
}

Installation

Ad-hoc usage

nix run github:mescam/nixearthlayer
nix shell github:mescam/nixearthlayer

Home Manager Module

The Home Manager module provides full declarative configuration and writes ~/.xearthlayer/config.ini.

Setup

# flake.nix
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    home-manager.url = "github:nix-community/home-manager";
    nixearthlayer.url = "github:mescam/nixearthlayer";
  };

  outputs = { nixpkgs, home-manager, nixearthlayer, ... }: {
    homeConfigurations.pilot = home-manager.lib.homeManagerConfiguration {
      pkgs = nixpkgs.legacyPackages.x86_64-linux;
      modules = [
        nixearthlayer.homeManagerModules.default
        {
          programs.xearthlayer = {
            enable = true;
            provider.type = "bing";
          };
        }
      ];
    };
  };
}

Usage

The configuration is quite complex, doing it first time might be too challenging. Consider following manual installation first and creating first config interactively as per upstream's docs. Then you can move your config to Nix. Please read the Configuration Notes below as well.

{
  programs.xearthlayer = {
    enable = true;

    provider = {
      type = "bing";  # bing | go2 | google | apple | arcgis | mapbox | usgs
      # googleApiKey = "...";       # required for type = "google"
      # mapboxAccessToken = "...";  # required for type = "mapbox"
    };

    cache = {
      directory = "/mnt/nvme/xearthlayer-cache";
      memorySize = "4GB";
      diskSize = "100GB";
      diskIoProfile = "nvme";  # auto | hdd | ssd | nvme
    };

    texture = {
      format = "bc1";  # bc1 (smaller) | bc3 (with alpha)
      mipmaps = 5;
    };

    prefetch = {
      enable = true;
      mode = "auto";  # auto | aggressive | opportunistic | disabled
      udpPort = 49002;
    };

    xplane.sceneryDir = "/home/pilot/X-Plane 12/Custom Scenery";
  };
}

Module options

Option Type Default Description
enable bool false Enable xearthlayer
package package pkgs.xearthlayer Package to use
provider.type enum "bing" Imagery provider
provider.googleApiKey string null Google Maps API key
provider.mapboxAccessToken string null MapBox access token
cache.directory string null Cache directory
cache.memorySize string null Memory cache size (e.g., "4GB")
cache.diskSize string null Disk cache size (e.g., "50GB")
cache.diskIoProfile enum null Disk I/O profile
texture.format enum null DDS compression format
texture.mipmaps int null Mipmap levels (1-10)
prefetch.enable bool null Enable tile prefetching
prefetch.mode enum null Prefetch mode
prefetch.udpPort port null X-Plane telemetry UDP port
xplane.sceneryDir string null X-Plane Custom Scenery directory

What the module does

  • Installs xearthlayer to home.packages
  • Generates ~/.xearthlayer/config.ini with your settings

Configuration Notes

⚠️ FUSE requirement: xearthlayer uses FUSE to mount imagery. You must enable FUSE in your NixOS config:

programs.fuse.userAllowOther = true;

Alternatively, use nixearthlayer.nixosModules.default which enables FUSE automatically (and adds the package to environment.systemPackages).

⚠️ Upstream changes: The xearthlayer configuration format may change between versions. This module covers common options but not all settings. If upstream adds new options or changes existing ones, you may need to configure them manually or wait for this flake to be updated.

For the full list of configuration options, see the upstream documentation.

Manual Installation (without Home Manager module)

If you prefer not to use the module:

{ pkgs, nixearthlayer, ... }:
{
  home.packages = [ nixearthlayer.packages.${pkgs.system}.xearthlayer ];
}

Then run xearthlayer setup to create ~/.xearthlayer/config.ini interactively.

Development

nix develop  # Enter dev shell with Rust toolchain
nix build    # Build the package
nix flake check  # Run checks

Auto-updates

This repository includes GitHub Actions that:

  1. Daily update check: Monitors upstream releases and creates PRs for new versions
  2. Build & cache: Builds on push/PR and pushes to Cachix

License

This flake is MIT licensed. xearthlayer itself is MIT licensed.

Disclaimer

This is an unofficial Nix packaging of xearthlayer. I am not the author of xearthlayer and have no affiliation with the upstream project. For issues with xearthlayer itself, please refer to the upstream repository.

About

Nix flake for xearthlayer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages