Skip to content

NixOS Configuration

We start by including the NixOS module in our NixOS configuration and enabling the service:

flake.nix
{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    data-mesher = {
      url = "git+https://git.clan.lol/clan/data-mesher?shallow=1&ref=main";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  output =
    inputs@{ nixpkgs, ... }:
    let
      inherit (nixpkgs) lib;
    in
    {
      nixosConfigurations.basic = lib.nixosSystem {
        modules = [
          inputs.data-mesher.nixosModules.data-mesher # (2)
          {
            config.services.data-mesher = {
              enable = true;
              # elided for brevity
            };
          }
        ];

      };
    };
}
configuration.nix
{
  imports = [
    # Import module
    "${
      (builtins.fetchTarball { url = "https://git.clan.lol/clan/data-mesher/archive/main.tar.gz"; })
    }/modules/nixos/data-mesher.nix"
  ];

  # Configure the service
  config.services.data-mesher = {
    enable = true;
    # elided for brevity
  };
}