{
  pkgs,
  lib,
  inputs,
  mainUser,
  ...
}:
{
  # these settings propagate to home-manager's nixpkgs
  nixpkgs = {
    config = {
      allowUnfree = true;
      allowUnfreePredicate = _: true;
      cudaSupport = true;
    };
  };

  nix = {
    # add flake inputs to our registry to allow global use
    registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
    settings = {
      # trusted-users = ["bolt" "plank"];
      experimental-features = [
        "nix-command"
        "flakes"
        "pipe-operator"
      ];
      substitute = true;
    };
    extraOptions = ''
      keep-outputs = true
      keep-derivations = true
    '';
    optimise.automatic = true;
    # package = pkgs.lix;
  };

  # services.smooooth = {
  #   enable = true;
  #   path = "/home/${mainUser}/.nix";
  #   blockers = [
  #     "hx"
  #     {
  #       nix = "die";
  #     }
  #   ];
  #   nixPackage = pkgs.lix;
  # };

  programs.meat = {
    enable = true;
    flake = "/home/${mainUser}/.nix";
  };

  environment.systemPackages = builtins.attrValues {
    inherit (pkgs)
      home-manager
      cachix
      nixfmt-rfc-style
      ;
    inherit (inputs.nil.packages.${pkgs.system}) nil;
  };
}
