Skip to main content

How to Enroll NixOS Devices into Swif.ai MDM

Updated this week

Swif.ai supports NixOS as part of its Linux MDM platform, enabling centralized device management, policy enforcement, and compliance monitoring.


Prerequisites

  • A supported NixOS installation.

  • Admin/root privileges on the device.


Enrollment Methods

You can integrate Swif.ai with NixOS using either:

  1. Default NixOS Configuration

  2. Flake-based Configuration


1. Default NixOS Configuration

  1. Download swifteam.zip from the Swif console.

  2. Extract the file and move the swifteam/ folder into /etc/nixos.

  3. Configure the swifteam settings in /etc/nixos/configuration.nix

    { config, pkgs, lib, ... }:
    let
    swifteamTarball = builtins.fetchTarball {
    url = "https://cdn.swifteam.com/st-agent-linux/{version}/nixos/swifteam.tar.gz";
    sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
    };
    in
    {
    imports = [
    (import "${swifteamTarball}")
    ];
    # Please fill in the required information in the configuration.
    services.swifteam = {
    enable = true;
    teamId = "{teamId}";
    name = "{name}";
    surname = "{surname}";
    email = "{email}";
    };
    }
  4. Rebuild NixOS

    $ sudo nixos-rebuild switch
  5. Reboot system

  6. Check if swif-agent.service is running

    $ sudo systemctl status swif-agent.service

2. Flake-based Configuration

  1. Download swifteam.zip.

  2. Extract and place swifteam/ into your flake directory.

  3. Configure swifteam settings in flake.nix

    {
    inputs = {
    swifteamTarball = {
    url = "https://cdn.swifteam.com/st-agent-linux/{version}/nixos/swifteam.tar.gz";
    flake = false;
    };
    };

    outputs = { self, nixpkgs, swifteamTarball, ... }@inputs: {
    nixosConfigurations.swifteamHostname = nixpkgs.lib.nixosSystem {
    modules = [
    (import "${swifteamTarball}")
    ({ ... }: {
    services.swifteam = {
    enable = true;
    teamId = "";
    name = "";
    surname = "";
    email = "";
    };
    })
    ];
    };
    };
    }
  4. Rebuild the flake environment:

    $ sudo nixos-rebuild switch --flake <nixRootPath>#<flakeHostname>
  5. Reboot system

  6. Check if swif-agent.service is running

    $ sudo systemctl status swif-agent.service

Verification

After rebuilding:

  1. Run to verify the Swif agent installation.

    $sudo systemctl status swif-agent.service
  2. Check the device’s status in Swif Console → Device Inventory.


Troubleshooting

  • Check system logs for swifteam service errors:

    journalctl -u swifteam
  • Re-run nixos-rebuild if configuration changes are made.

Did this answer your question?