Skip to content

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Warning

Deprecated: migrate to nixpkgs as soon as reasonably possible. nixos-unstable now includes fleet-orbit, fleet-desktop, and the services.orbit NixOS module through nixpkgs PR #525702, built on work from this repository, Adriel Velazquez's earlier integration, and other contributors. Please use that maintained integration rather than starting new deployments with this flake.

This repository will remain available with best-effort automated updates until May 2027, around the NixOS 27.05 release, to give existing users time to migrate. At that point, updates and support will end and the repository will be archived. I no longer have NixOS machines running Fleet to verify runtime behavior.

Before migrating, compare the packaged Orbit version and module options with your deployment. At the time of writing, nixos-unstable packages Orbit 1.55.0; the update to use Fleet's upstream NixOS support is still open (#556865). Migration need not mean an immediate downgrade: plan the switch when the nixpkgs package meets your deployment's requirements.

fleet-nixos

Fleet Orbit and Fleet Desktop integration for NixOS, packaged as a Nix flake.

Overview

This repository provides NixOS modules and packages for deploying Fleet Orbit and Fleet Desktop on NixOS systems. It builds the latest releases from FleetDM’s GitHub, applies custom patches for Nix compatibility, and exposes a flexible module for configuration.

Features

  • Packages: Builds and provides orbit and fleet-desktop binaries.
  • NixOS Module: Easily enable and configure Fleet Orbit and Fleet Desktop via services.orbit.
  • Systemd Integration: Sets up system and user services for Orbit and Fleet Desktop.
  • Custom Patches: Adds extra flags for NixOS compatibility (see below).
  • Update Script: Automates updating to the latest Fleet Orbit release.

Installation

The instructions below are for the legacy flake. Prefer nixpkgs' built-in services.orbit module; see the migration and retirement notice above.

  1. Add the flake as an input:

    inputs.fleet-nix = {
      url = "github:adamcik/fleet-nixos";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  2. Import the module in your NixOS configuration:

    imports = [
      inputs.fleet-nix.nixosModules.fleet-nixos
    ];

Configuration

Enable the service and configure options under services.orbit. You must set either enrollSecret or enrollSecretPath.

Example Configuration

services.orbit = {
  enable = true;
  fleetUrl = "https://your-fleet.example.com";
  # WARNING: use enrollSecretPath for secrets outside nix-store
  enrollSecret = "your-enroll-secret";
  debug = true;
  devMode = false;
  hostIdentifier = "uuid";
  enableScripts = false;
  fleetCertificate = "/etc/ssl/certs/ca-bundle.crt";
  fleetDesktopAlternativeBrowserHost = null;
  fleetManagedHostIdentityCertificate = false;
  endUserEmail = null;
  insecure = false;
};

Configuration Options and Environment Variables

Option Description
enable Enable Fleet Orbit systemd service
fleetUrl Base URL of the Fleet server (ORBIT_FLEET_URL)
enrollSecret Enroll secret for Fleet server (ORBIT_ENROLL_SECRET)
enrollSecretPath Path to enroll secret file (ORBIT_ENROLL_SECRET_PATH)
fleetCertificate Path to Fleet server certificate chain (ORBIT_FLEET_CERTIFICATE)
debug Enable debug logging (ORBIT_DEBUG)
devMode Enable development mode (ORBIT_DEV_MODE)
hostIdentifier Host identifier mode (e.g., "uuid") (ORBIT_HOST_IDENTIFIER)
enableScripts Enable script execution (ORBIT_ENABLE_SCRIPTS)
fleetDesktopAlternativeBrowserHost Alternative browser host for Fleet Desktop (ORBIT_FLEET_DESKTOP_ALTERNATIVE_BROWSER_HOST)
fleetManagedHostIdentityCertificate Use TPM-backed key for Fleet EE (requires license) (ORBIT_FLEET_MANAGED_HOST_IDENTITY_CERTIFICATE)
endUserEmail End user email (experimental) (ORBIT_END_USER_EMAIL)
insecure Disable TLS certificate verification (ORBIT_INSECURE)

Design Decisions

Some Orbit flags and environment variables are hardcoded or omitted for NixOS compatibility:

  • Updates: All update-related flags are omitted/hardcoded because NixOS manages packages declaratively. Orbit’s auto-update logic is disabled.
  • Keystore: Always disabled for NixOS to avoid storing secrets in OS-specific keystores.
  • Paths: State, logs, and osquery DB paths are hardcoded for security and consistency.
  • Channels: Update channels are not exposed; updates are managed by Nix, not Orbit.
  • Deprecated/Platform-specific flags: Omitted as not relevant for NixOS.
  • NixOS-specific flags: Extra flags are added via patches to ensure correct binary usage, log placement, and Fleet Desktop integration.

Systemd Services

  • systemd.services.orbit: Runs the Orbit agent as a system service.
  • systemd.user.services.fleet-desktop: Runs Fleet Desktop as a user service for graphical sessions.

NOTE: Orbit does not log everything to journald. Check /var/log/orbit/ for logs.

Patches

The remaining local patch extends Orbit's NixOS compatibility:

  • scripts-nixos.patch: Relaxes Orbit's shebang validation to allow NixOS-specific paths and /usr/bin/env interpreters in scripts.

Orbit 1.63.0 includes upstream NixOS support:

The local patch only extends shebang validation to accept explicit system-profile paths.

Development

Running Checks

To run all checks (formatting and package builds) locally, use:

nix flake check
nix flake check ./dev

This is the same command used in CI to ensure the repository is in a good state.

Cachix

CI pushes build outputs to the public fleet-nixos Cachix cache. The development flake is configured to use it:

nixConfig = {
  extra-substituters = ["https://fleet-nixos.cachix.org"];
  extra-trusted-public-keys = ["fleet-nixos.cachix.org-1:WuxM+Kqv8GoWP+kTmxHBUk9qVXvjvrYzoG17LtqJ4xc="];
};

GitHub Actions requires CACHIX_AUTH_TOKEN to push to the cache.

When using direnv, use the development flake and accept its cache configuration:

use flake ./dev --accept-flake-config

Formatting

This project uses alejandra for formatting Nix files. You can format the entire project with:

nix fmt ./dev

Updating Fleet Orbit

To update to the latest Fleet Orbit release, run:

./update.sh

For a specific release or a read-only preview:

./update.sh --version 1.63.0
./update.sh --version 1.63.0 --dry-run

Run from the repository root. The flake app supplies the updater's tools from locked nixpkgs; no Nix channel or separately installed nix-update is needed. GitHub reads use GH_TOKEN, GITHUB_TOKEN, or RENOVATE_TOKEN when available.

The updater reads the selected tag's exact commit and go.mod, preserves the current Go compiler when it satisfies that requirement, or selects the oldest suitable compiler available in locked nixpkgs. It compares full patch versions, not just Go families. Only if no compiler is suitable does it refresh the nixpkgs flake input and retry once. It never downloads a compiler outside Nix.

orbit.json records the requested release; pkgs/default.nix records generated package metadata. CI requires these versions to match, so a failed or skipped post-upgrade task cannot leave a green PR that merely relabels old source.

The explicit goVersion family, release metadata, source hash, and shared vendor hash are updated together in pkgs/default.nix. Both packages and the compiler compatibility and release-version checks must build successfully. Builds run sequentially to limit scratch-space use. On failure, all three files are restored to their entry state, preserving Renovate's requested release while leaving the old generated version in place for CI to reject. Dry runs do not change files, refresh nixpkgs, or build packages; they report when a lock refresh would be needed.

Renovate integration and rollout

Renovate updates orbit.json from stable orbit-vX.Y.Z tags and passes its selected version to /opt/nix-post-upgrade update-release update-orbit X.Y.Z. The updater must not independently select a different release after Renovate has applied version or approval policies. The runner's launcher invokes the update-orbit flake app; this is an explicit opt-in, not general shell-command permission.

Land the update-release launcher support in adamcik/renovate-runner before enabling this repository's Renovate rule. Check extraction and artifact generation in an isolated runner checkout before permitting publication. Full Renovate dry runs can still execute local post-upgrade work. The existing go-nix-module preset is not applicable: Fleet's Go manifest is in fetched source, not this repo.

Renovate is the only release PR writer. .github/workflows/update.yml remains a read-only scheduled/manual integration check and keeps the existing success pulse. It does not use UPDATE_PAT or publish branches or PRs; that secret can be retired after rollout. Normal nixpkgs updates remain separate unless the release requires a compiler not available in the current lock.

Updater regression tests run as checks.<system>.updater, including offline release fixtures, rollback/idempotence checks, and the real Nix compiler selector.

Patch workflow

Patch files in patches/ should be treated as exported commits from a Fleet checkout, not hand-edited long-term.

  1. Materialize a patch branch in ../fleet from local patch files:

    ./import-patches.sh --base-tag orbit-v1.63.0 --branch orbit-nixos-patches

    This applies each patches/NNNN-*.patch file in lexical order and creates one commit per patch on top of the base tag.

  2. Rebase that branch in ../fleet onto a newer Orbit tag as needed.

  3. Export the rebased commit range back into patch files:

    ./export-patches.sh --base orbit-v1.63.0 --head orbit-nixos-patches

    This writes patches/NNNN-*.patch (one per commit), where each filename is derived from the first line of the commit message.

This keeps patches reproducible and makes upstream churn easier to manage.

Fleet Desktop

Fleet Desktop is enabled as a user service when Orbit is enabled. It uses the same configuration and integrates with graphical sessions.

Troubleshooting & Tips

  • Required: You must set either enrollSecret or enrollSecretPath.
  • Debugging: Set debug = true for verbose logs.
  • Secrets: Use enrollSecretPath with sops-nix for secure secret management.
  • Logs: Check /var/log/orbit/ for logs.

For more details on Orbit configuration, see orbit.go upstream.

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages