{
  description = "Madeleine's dots for the illiterate (sydnix)";

  inputs = {
    disko.url = "github:nix-community/disko";
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    impermanence.url = "github:nix-community/impermanence";
    home-manager.url = "github:nix-community/home-manager";
    sops-nix.url = "github:Mic92/sops-nix";
    copyparty = {
      url = "github:9001/copyparty";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    emacs-overlay.url = "github:nix-community/emacs-overlay";
    niri.url = "github:sodiboo/niri-flake";
    stylix.url = "github:danth/stylix";
    nixcord.url = "github:KaylorBen/nixcord";
    vpn-confinement.url = "github:Maroka-chan/VPN-Confinement";
    nixarr = {
      url = "github:rasmus-kirk/nixarr/beta";
      inputs.nixpkgs.follows = "nixpkgs";
      inputs.vpnconfinement.follows = "vpn-confinement";
    };
    # Used for Firefox extensions/addons.
    nur = {
      url = "github:nix-community/NUR";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    tf2-nix.url = "gitlab:msyds/tf2-nix";
    syd-fcitx5-tables.url = "gitlab:msyds/syd-fcitx5-tables";
    sydpkgs.url = "github:msyds/sydpkgs";
  };

  outputs = { self, nixpkgs, ... }@inputs:
    # TODO: Move to utils.nix.
    let list-nix-directory = dir:
          builtins.attrNames
            (nixpkgs.lib.filterAttrs
              (k: _v: nixpkgs.lib.hasSuffix ".nix" k)
              (builtins.readDir dir));
        # Given a path to a directory, return a module that imports «path»/*.nix
        collectModules = path:
          let modules = list-nix-directory path;
          in { pkgs, lib, ... }: {
            imports = builtins.map (m: ./${path}/${m}) modules;
          };
    in {
      # REVIEW: Why don't we put each module under nixosModules.<name>?
      # TODO: Deduplicate.
      nixosModules.default =
        let modules = list-nix-directory ./modules/nixos;
        in { pkgs, lib, ... }: {
          imports =
            builtins.map (m: ./modules/nixos/${m}) modules;
        };

      # TODO: Deduplicate.
      homeManagerModules.default =
        let modules = list-nix-directory ./modules/home;
        in { pkgs, lib, ... }: {
          imports =
            builtins.map (m: ./modules/home/${m}) modules;
        };

      nixosConfigurations = import ./outputs/nixosConfigurations.nix inputs;

      homeConfigurations = import ./outputs/homeConfigurations.nix inputs;

      packages.x86_64-linux.live-minimal =
        self.nixosConfigurations.live-minimal.config.system.build.isoImage;
    };

  nixConfig = {
    extra-substituters = [
      "https://nix-community.cachix.org"
      "https://niri.cachix.org"
    ];
    extra-trusted-public-keys = [
      "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
      "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
    ];
  };
}
