summaryrefslogtreecommitdiff
path: root/tf/default.nix
blob: 01123394ca04b22da9889ffb555fc1e88dfd788d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{inputs, ...}: {
  perSystem = {
    lib,
    pkgs,
    system,
    ...
  }: let
    tfConfig = inputs.terranix.lib.terranixConfiguration {
      inherit system;
      modules = [
        ./cloudflare
        ./tailscale
        ./cloud.nix
        ./vars.nix
        ./versions.nix
      ];
    };
  in {
    apps.gen-tf = {
      type = "app";

      program = pkgs.writeShellApplication {
        name = "gen-tf";

        text = ''
          config_file="config.tf.json"
          [ -e "$config_file" ] && rm -f "$config_file"
          cp ${tfConfig} "$config_file"
        '';
      };
    };
  };
}