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

{
  description = "Clicks Infrastructure";

  inputs = {
    agenix.url = "github:ryantm/agenix";

    agenix-rekey = {
      url = "github:oddlama/agenix-rekey";
      inputs.nixpkgs.follows = "nixpkgs";
    };

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

    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    flake-utils.url = "github:numtide/flake-utils";

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

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

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

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

    aux--docs-site = {
      url = "git+https://git.auxolotl.org/auxolotl/docs-site";
      inputs.nixpkgs.follows = "nixpkgs";
      inputs.snowfall-lib.follows = "snowfall-lib";
      inputs.wiki.follows = "aux--wiki";
    };
    aux--wiki = {
      url = "git+https://git.auxolotl.org/auxolotl/wiki";
      flake = false;
    };
  };

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

        src = ./.;

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

      systems.modules.nixos = [
        inputs.agenix.nixosModules.default
        inputs.agenix-rekey.nixosModules.default
        inputs.impermanence.nixosModules.impermanence
        {
          config.clicks.defaults.enable = true;
          # set defaults that are clicks-specific, such as our backups module
          # being enabled...
        }
      ];

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

      agenix-rekey = inputs.agenix-rekey.configure {
        userFlake = inputs.self // { outPath = lib.pipe "" [
          lib.snowfall.fs.get-snowfall-file
          (lib.strings.removeSuffix "/")
        ]; };
        nodes = inputs.self.nixosConfigurations;
      };

      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;
      };
    };
}
