diff --git a/flake.lock b/flake.lock index 534b40e..58baaf9 100644 --- a/flake.lock +++ b/flake.lock @@ -143,11 +143,11 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1720039488, - "narHash": "sha256-Jph2M8C7R75F7b78gMJpzJMSUd1TyIQfAiOcJiAfkMI=", + "lastModified": 1720393519, + "narHash": "sha256-R8eTvSm+O6cFVrgrVE7eOhSNi1fAO43zF8fcuRRfW6o=", "owner": "oliver-ni", "repo": "transpire", - "rev": "5862df70491778a3574c2ff603f15e385748f55b", + "rev": "a891b5f7280426950bf268a257b1734a5df665c4", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0333d41..1f5be74 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,10 @@ }) (builtins.readDir ./hosts); + # ======================= + # Transpire Configuration + # ======================= + fs = nixpkgs.lib.fileset; allNixFiles = fs.fileFilter (file: file.hasExt "nix") ./.; diff --git a/kubernetes/apply-manually/applicationset.yaml b/kubernetes/apply-manually/applicationset.yaml new file mode 100644 index 0000000..9489fdc --- /dev/null +++ b/kubernetes/apply-manually/applicationset.yaml @@ -0,0 +1,29 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: poketwo + namespace: argocd +spec: + generators: + - git: + directories: + - path: '*' + repoURL: https://github.com/poketwo/nix.git + revision: cluster + template: + metadata: + name: poketwo-{{path.basename}} + namespace: argocd + spec: + destination: + namespace: '{{path.basename}}' + server: https://kubernetes.default.svc + project: default + source: + path: '{{path}}' + repoURL: https://github.com/poketwo/nix.git + targetRevision: cluster + syncPolicy: + automated: {} + syncOptions: + - CreateNamespace=true diff --git a/kubernetes/core/argocd.nix b/kubernetes/core/argocd.nix index 58057df..de27af5 100644 --- a/kubernetes/core/argocd.nix +++ b/kubernetes/core/argocd.nix @@ -45,35 +45,5 @@ }; }; }; - - resources."argoproj.io/v1alpha1".ApplicationSet.poketwo.spec = { - generators = [{ - git = { - repoURL = "https://github.com/poketwo/nix.git"; - revision = "cluster"; - directories = [{ path = "*"; }]; - }; - }]; - - template = { - metadata = { - name = "poketwo-{{path.basename}}"; - namespace = "argocd"; - }; - spec = { - project = "default"; - source = { - repoURL = "https://github.com/poketwo/nix.git"; - targetRevision = "cluster"; - path = "{{path}}"; - }; - destination = { - server = "https://kubernetes.default.svc"; - namespace = "{{path.basename}}"; - }; - syncPolicy.automated = { }; - }; - }; - }; }; } diff --git a/kubernetes/extras/namespaces-first.nix b/kubernetes/extras/namespaces-first.nix deleted file mode 100644 index a171d63..0000000 --- a/kubernetes/extras/namespaces-first.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ lib, ... }: - -let - namespacesFirst = { apiVersion, kind, ... }@obj: - if apiVersion == "v1" && kind == "Namespace" then - lib.recursiveUpdate - obj - { metadata.annotations."argocd.argoproj.io/sync-wave" = "-1"; } - else obj; -in -{ - transforms = [ namespacesFirst ]; -}