diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-07-21 13:00:38 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-07-21 13:00:38 -0700 |
| commit | 40d6a40b1de18f28003c4aa5f36d9b4b0ef4afdd (patch) | |
| tree | 45a0902743971b1789b1f5d03efde7390cc0e95e /nix/scripts | |
| parent | move user configurations to top-level (diff) | |
| download | infra-40d6a40b1de18f28003c4aa5f36d9b4b0ef4afdd.tar.gz | |
move all profiles, modules, and flakes to top-level
Diffstat (limited to '')
| -rw-r--r-- | scripts/darwin.nix (renamed from nix/scripts/darwin.nix) | 0 | ||||
| -rw-r--r-- | scripts/default.nix (renamed from nix/scripts/default.nix) | 4 | ||||
| -rw-r--r-- | scripts/infra.nix (renamed from nix/scripts/common.nix) | 12 | ||||
| -rw-r--r-- | scripts/linux.nix (renamed from nix/scripts/linux.nix) | 0 |
4 files changed, 9 insertions, 7 deletions
diff --git a/nix/scripts/darwin.nix b/scripts/darwin.nix index c1bbbde..c1bbbde 100644 --- a/nix/scripts/darwin.nix +++ b/scripts/darwin.nix diff --git a/nix/scripts/default.nix b/scripts/default.nix index 90851df..bf91760 100644 --- a/nix/scripts/default.nix +++ b/scripts/default.nix @@ -2,19 +2,23 @@ pkgs, system, inputs, + self, }: let common = import ./common.nix { inherit pkgs; }; + infra = import ./infra.nix { inherit self pkgs; }; darwin = import ./darwin.nix { inherit pkgs system inputs; }; linux = import ./linux.nix { inherit pkgs system inputs; }; in { common = common; + infra = infra; darwin = if pkgs.lib.hasSuffix "darwin" system then darwin else [ ]; linux = if pkgs.lib.hasSuffix "linux" system then linux else [ ]; all = common + ++ infra ++ (if pkgs.lib.hasSuffix "darwin" system then darwin else [ ]) ++ (if pkgs.lib.hasSuffix "linux" system then linux else [ ]); } diff --git a/nix/scripts/common.nix b/scripts/infra.nix index b457ea2..aa9b0d6 100644 --- a/nix/scripts/common.nix +++ b/scripts/infra.nix @@ -1,4 +1,4 @@ -{ pkgs }: +{ self, pkgs }: let tofuSetup = '' tofu_setup() { @@ -22,13 +22,13 @@ let # Install terraform configs ${pkgs.coreutils}/bin/install -Dm 0644 ${ - import ../tofu/backups.nix { + import "${self}/infra/tf/backups.nix" { inherit pkgs; } } "$TMPDIR/backups/backups.tf.json" ${pkgs.coreutils}/bin/install -Dm 0644 ${ - import ../tofu/dns.nix { + import "${self}/infra/tf/dns.nix" { inherit pkgs; } } "$TMPDIR/cloudflare/cloudflare-dns.tf.json" @@ -43,8 +43,6 @@ let ''; in [ - (pkgs.writeScriptBin "update-deps" "nix flake update --commit-lock-file") - (pkgs.writeShellScriptBin "gcloud-auth" '' set -xeuo pipefail ${pkgs.google-cloud-sdk}/bin/gcloud auth print-identity-token > /dev/null 2>&1 || \ @@ -53,7 +51,7 @@ in ${pkgs.google-cloud-sdk}/bin/gcloud auth application-default login --quiet '') - (pkgs.writeShellScriptBin "tofu-plan" '' + (pkgs.writeShellScriptBin "tf-plan" '' set -xeuo pipefail ${tofuSetup} @@ -66,7 +64,7 @@ in CLOUDFLARE_API_TOKEN="$CLOUDFLARE_API_TOKEN" ${pkgs.opentofu}/bin/tofu -chdir="$TMPDIR/cloudflare" plan '') - (pkgs.writeShellScriptBin "tofu-apply" '' + (pkgs.writeShellScriptBin "tf-apply" '' set -xeuo pipefail ${tofuSetup} diff --git a/nix/scripts/linux.nix b/scripts/linux.nix index b44c86f..b44c86f 100644 --- a/nix/scripts/linux.nix +++ b/scripts/linux.nix |
