Skip to content

Commit

Permalink
Remove obsolete terraform deployment code (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
matrss authored Mar 18, 2024
1 parent b5d8f82 commit 0054bfa
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 39 deletions.
2 changes: 0 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
nixpkgs-fmt
opentofu
generate-hostnames
dply
nixos-config-path
jq
];
};
Expand Down
18 changes: 0 additions & 18 deletions infra.tf
Original file line number Diff line number Diff line change
Expand Up @@ -240,21 +240,3 @@ resource "cloudflare_record" "_spf_matrss_xyz" {
name = "@"
value = "v=spf1 include:mailbox.org ~all"
}

data "external" "instantiate" {
for_each = toset(["hazuno.m.0px.xyz", "nelvte.m.0px.xyz"])

program = ["nixos-config-path", each.key]
}

resource "null_resource" "deploy" {
for_each = data.external.instantiate

triggers = {
derivation = each.value.result["path"]
}

provisioner "local-exec" {
command = "dply ${each.key}"
}
}
2 changes: 0 additions & 2 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
_final: prev:

{
dply = prev.callPackage (import ./scripts.nix).dply { };
generate-hostnames = prev.callPackage (import ./scripts.nix).generate-hostnames { };
nixos-config-path = prev.callPackage (import ./scripts.nix).nixos-config-path { };
smtp2paperless = prev.callPackage ./smtp2paperless.nix { };
}
17 changes: 0 additions & 17 deletions pkgs/scripts.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
{
dply = { writeShellApplication, nixos-rebuild }: writeShellApplication {
name = "dply";
runtimeInputs = [ nixos-rebuild ];
text = ''
nixos-rebuild switch --flake .#"$1" --target-host "root@$1" --use-substitutes
'';
};

nixos-config-path = { writeShellApplication, jq }: writeShellApplication {
name = "nixos-config-path";
runtimeInputs = [ jq ];
text = ''
nix path-info --json .#nixosConfigurations.\""$1"\".config.system.build.toplevel |
jq 'to_entries | { "path": .[0].key }'
'';
};

generate-hostnames = { writeShellApplication, python3 }: writeShellApplication {
name = "generate-hostnames";
runtimeInputs = [ python3 ];
Expand Down

0 comments on commit 0054bfa

Please sign in to comment.