{ inputs, system, pkgs, drive_paths, ... }:
let
  inherit (inputs) self home-manager deploy-rs nixpkgs;
  config = (self.nixosConfigurations.clicks.extendModules { modules = [ ./hardware-configuration.nix ]; });
  deploy = {
    sudo = "doas -u";
    profiles = {
      system = {
        user = "root";
        path = deploy-rs.lib.x86_64-linux.activate.nixos config;
      };
    } // (let
      mkServiceConfig = service: {
        user = service;

        profilePath = "/nix/var/nix/profiles/per-user/${service}/home-manager";
        path = deploy-rs.lib.x86_64-linux.activate.home-manager
          (home-manager.lib.homeManagerConfiguration {
            inherit pkgs;
            modules = [
              {
                home.homeDirectory = "/services/${service}";
                home.username = service;
                home.stateVersion = "22.11";
                programs.home-manager.enable = true;
              }
              "${../../services}/${service}"
            ];
            extraSpecialArgs = {
              inherit (inputs) nixpkgs-clicksforms;
              inherit system drive_paths;
            };
          });
      };
    in nixpkgs.lib.pipe ../../services [
      builtins.readDir
      (nixpkgs.lib.filterAttrs (_name: value: value == "directory"))
      builtins.attrNames
      (map (name: {
        inherit name;
        value = mkServiceConfig name;
      }))
      builtins.listToAttrs
    ]) // (let
      mkBlankConfig = username: {
        user = username;

        profilePath = "/nix/var/nix/profiles/per-user/${username}/home-manager";
        path = deploy-rs.lib.x86_64-linux.activate.home-manager
          (home-manager.lib.homeManagerConfiguration {
            inherit pkgs;
            modules = [
              {
                home.username = username;
                home.stateVersion = "22.11";
                programs.home-manager.enable = true;
              }
              "${../../homes}/${username}"
            ];
          });
      };
    in nixpkgs.lib.pipe ../../homes [
      builtins.readDir
      (nixpkgs.lib.filterAttrs (_name: value: value == "directory"))
      builtins.attrNames
      (map (name: {
        inherit name;
        value = mkBlankConfig name;
      }))
      builtins.listToAttrs
    ]);
    hostname = "a1d1";
    profilesOrder = [ "system" ];
  };
in { inherit deploy config; }
