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

      nixosModuleDependencies = {
        agenix = inputs.agenix.nixosModules.default;
        agenix-rekey = inputs.agenix-rekey.nixosModules.default;
        impermanence = inputs.impermanence.nixosModules.impermanence;
      };
    in
    lib.mkFlake {
      overlays = [
        inputs.agenix-rekey.overlays.default 
      ];

      systems.modules.nixos = [
        {
          config.clicks.defaults.enable = true;
          # set defaults that are clicks-specific, such as our backups module
          # being enabled...
        }
      ] ++ (lib.attrsets.attrValues nixosModuleDependencies);

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

      # We need to re-export dependencies, as this is *invalid* unless
      # environment.persistence is defined, so importing all our modules will
      # otherwise break evaluation
      #
      # config = lib.mkIf false {
      #   environment.persistence = {
      #     ...
      #   };
      # };
      #
      modules.nixos = lib.attrsets.mapAttrs' (name: value: {
        name = "dependency/${name}";
        inherit value;
      }) nixosModuleDependencies;

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