# SPDX-FileCopyrightText: 2024 Auxolotl Infrastructure Contributors
# SPDX-FileCopyrightText: 2024 Clicks Codes
#
# SPDX-License-Identifier: GPL-3.0-only

{
  description = "Clicks Infrastructure";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
    unstable.url = "github:nixos/nixpkgs/nixos-unstable";


    deploy-rs = {
      url = "github:serokell/deploy-rs";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    snowfall-lib = {
      url = "github:snowfallorg/lib";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    sops-nix = {
      url = "github:Mic92/sops-nix";
      inputs = {
        nixpkgs.follows = "unstable";
        nixpkgs-stable.follows = "nixpkgs";
      };
    };

    impermanence.url = "github:nix-community/impermanence";
  };

  outputs =
    inputs:
    let
      lib = (inputs.snowfall-lib.mkLib {
        inherit inputs;

        src = ./.;

        snowfall = {
          namespace = "clicks";
        };
      }).snowfall.internal.system-lib;
    in
    lib.mkFlake {
      overlays = with inputs; [ ];

      systems.modules.nixos = [
        inputs.impermanence.nixosModules.impermanence
        inputs.sops-nix.nixosModules.sops
      ];

      deploy = lib.clicks.deploy.mkDeploy {
        inherit (inputs) self;
        overrides = {
          teal.hostname = "teal.alpha.clicks.domains";
        };
      };

      outputs-builder = channels: {
        specs = let
          nixFiles = lib.snowfall.fs.get-nix-files-recursive ./.;
          specFiles = builtins.filter (lib.clicks.strings.endsWith ".spec.nix") nixFiles;
          importedSpecs = lib.forEach specFiles (file: {
            name = builtins.unsafeDiscardStringContext (builtins.baseNameOf file);
            value = import file {
              inherit channels lib;
            };
          });
        in builtins.listToAttrs importedSpecs;

        formatter = channels.nixpkgs.nixfmt-rfc-style;

        checks = let
          allChecks = {
            deploy-rs = lib.deploy-rs.${channels.nixpkgs.system}.deployChecks inputs.self.deploy;
            clicks = lib.clicks.checks channels.nixpkgs;
          };

          mergedChecks = lib.trivial.pipe allChecks [
            (lib.attrsets.mapAttrsToList (sourceName: (lib.attrsets.mapAttrsToList (checkName: value: {
              name = "${sourceName}:${checkName}";
              inherit value;
            }))))
            lib.lists.flatten
            builtins.listToAttrs
          ];
        in mergedChecks;
      };
    };
}
