{
  inputs,
  pkgs,
  ...
}: {
  imports = [
    inputs.lix.nixosModules.default # this is universal, despite the 'nixos'
  ];

  config = {
    nix = {
      package = pkgs.lix;

      # Pin system <nixpkgs> to flake nixpkgs version.
      # i.e. for use in pkgs = import <nixpkgs> {}.
      nixPath = ["nixpkgs=${inputs.nixpkgs}"];

      # Pin flake registry nixpkgs to flake nixpkgs version.
      # i.e. for use in nix search nixpkgs.
      registry = {
        nixpkgs.flake = inputs.nixpkgs;
      };

      settings = {
        experimental-features = ["nix-command" "flakes"];

        trusted-users = [
          "root"
          # @wheel/@admin are added in OS specific modules.
        ];

        # Set up caches.
        extra-substituters = [
          "https://marleyos.cachix.org"
          "https://nix-community.cachix.org"
        ];

        trusted-public-keys = [
          "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
          "marleyos.cachix.org-1:q2kEtqvS5CoQ8BmKlWOfOnN+fi4gUoSuL6HRKy37eCA="
          "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
        ];

        # Disable that annoying "git tree is dirty" warning.
        warn-dirty = false;

        auto-optimise-store = true;

        use-xdg-base-directories = true;
      };
    };

    nixpkgs = import ./nixpkgs.nix {inherit inputs;};

    # More useful repl.
    environment.systemPackages = let
      nrepl =
        pkgs.writeShellScriptBin "nrepl"
        # sh
        ''
          nix repl --file "${toString ../../repl.nix}" "$@"
        '';
    in [
      nrepl
    ];
  };
}
