From 6fb7d2113aa0a035b3fbeabd6cb1f49d71d7e1d9 Mon Sep 17 00:00:00 2001 From: guangtao Date: Mon, 6 Nov 2023 01:39:53 -0800 Subject: [PATCH] refactor: update tenzir-devops --- README.org | 2 +- cells/dev/configs/treefmt.toml | 3 - cells/dev/tasks/runScriptWithEnv.nix | 14 - cells/dev/tasks/test.nix | 2 - .../prod/tasks/deploy-tenzir-aws/default.nix | 10 - devshell.toml | 2 +- flake.lock | 436 +++++------------- flake.nix | 29 +- units/cells/dev/configs/treefmt.nix | 6 + .../cells}/dev/shellsProfiles/commands.toml | 0 .../cells}/dev/shellsProfiles/packages.toml | 0 {cells => units/cells}/dev/tasks/climod.md | 0 {cells => units/cells}/dev/tasks/climod.nix | 20 +- .../cells}/dev/tasks/makes-ps-tenzir/_env | 0 .../dev/tasks/makes-ps-tenzir/default.nix | 2 +- .../cells}/dev/tasks/makes-ps-tenzir/env | 0 .../dev/tasks/makes-ps-tenzir/tenzir.yaml | 0 .../cells}/dev/tasks/makes-test.nix | 4 +- units/cells/dev/tasks/runScriptWithEnv.nix | 18 + .../cells}/dev/tasks/script-json/default.json | 0 .../dev/tasks/script-json/function.json | 0 units/cells/dev/tasks/test.nix | 1 + .../cells}/prod/schemas/tenzir-sysmon.yaml | 0 .../prod/tasks/deploy-tenzir-aws/default.nix | 6 + .../tasks/deploy-tenzir-aws/entrypoint.sh | 0 .../cells}/prod/tasks/deploy-tenzir-aws/env | 0 26 files changed, 187 insertions(+), 368 deletions(-) delete mode 100644 cells/dev/configs/treefmt.toml delete mode 100644 cells/dev/tasks/runScriptWithEnv.nix delete mode 100644 cells/dev/tasks/test.nix delete mode 100644 cells/prod/tasks/deploy-tenzir-aws/default.nix create mode 100644 units/cells/dev/configs/treefmt.nix rename {cells => units/cells}/dev/shellsProfiles/commands.toml (100%) rename {cells => units/cells}/dev/shellsProfiles/packages.toml (100%) rename {cells => units/cells}/dev/tasks/climod.md (100%) rename {cells => units/cells}/dev/tasks/climod.nix (70%) rename {cells => units/cells}/dev/tasks/makes-ps-tenzir/_env (100%) rename {cells => units/cells}/dev/tasks/makes-ps-tenzir/default.nix (94%) rename {cells => units/cells}/dev/tasks/makes-ps-tenzir/env (100%) rename {cells => units/cells}/dev/tasks/makes-ps-tenzir/tenzir.yaml (100%) rename {cells => units/cells}/dev/tasks/makes-test.nix (89%) create mode 100644 units/cells/dev/tasks/runScriptWithEnv.nix rename {cells => units/cells}/dev/tasks/script-json/default.json (100%) rename {cells => units/cells}/dev/tasks/script-json/function.json (100%) create mode 100644 units/cells/dev/tasks/test.nix rename {cells => units/cells}/prod/schemas/tenzir-sysmon.yaml (100%) create mode 100644 units/cells/prod/tasks/deploy-tenzir-aws/default.nix rename {cells => units/cells}/prod/tasks/deploy-tenzir-aws/entrypoint.sh (100%) rename {cells => units/cells}/prod/tasks/deploy-tenzir-aws/env (100%) diff --git a/README.org b/README.org index 6c5f618..c7da4fd 100644 --- a/README.org +++ b/README.org @@ -12,7 +12,7 @@ * Configuration languages or files -By simply placing the supported configuration formats or files in the corresponding folders, the auto-importing mechanism will be triggered automatically. +By simply placing the supported configuration formats or files in the corresponding folders, the auto-importing mechanism will be triggered. #+begin_quote We have a global command-line tool called ~std~ that allows users to query and execute various tasks. #+end_quote diff --git a/cells/dev/configs/treefmt.toml b/cells/dev/configs/treefmt.toml deleted file mode 100644 index 6297c92..0000000 --- a/cells/dev/configs/treefmt.toml +++ /dev/null @@ -1,3 +0,0 @@ -[formatter.prettier] -command = "prettier" -excludes = ["generated-*.yaml"] diff --git a/cells/dev/tasks/runScriptWithEnv.nix b/cells/dev/tasks/runScriptWithEnv.nix deleted file mode 100644 index aae18a8..0000000 --- a/cells/dev/tasks/runScriptWithEnv.nix +++ /dev/null @@ -1,14 +0,0 @@ -makeScript { - name = "runScriptWithEnv"; - env = { - a = "1"; - b = "2"; - VAR_NAME = "test"; - }; - searchPaths.bin = [nixpkgs.hello]; - searchPaths.source = []; - entrypoint = '' - hello --help - echo $a - ''; -} diff --git a/cells/dev/tasks/test.nix b/cells/dev/tasks/test.nix deleted file mode 100644 index 8c66390..0000000 --- a/cells/dev/tasks/test.nix +++ /dev/null @@ -1,2 +0,0 @@ -{tenzir-devops} @ args: -args diff --git a/cells/prod/tasks/deploy-tenzir-aws/default.nix b/cells/prod/tasks/deploy-tenzir-aws/default.nix deleted file mode 100644 index 91bdceb..0000000 --- a/cells/prod/tasks/deploy-tenzir-aws/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -makeScript { - name = "runScriptWithEnv"; - searchPaths.bin = [ - nixpkgs.awscli - ]; - searchPaths.source = [ - ./env - ]; - entrypoint = ./entrypoint.sh; -} diff --git a/devshell.toml b/devshell.toml index 60c68a1..ea960d5 100644 --- a/devshell.toml +++ b/devshell.toml @@ -1,4 +1,4 @@ -cellsFrom = "/cells" +cellsFrom = "/units/cells" [devshell] # programs.sops.enable = true; diff --git a/flake.lock b/flake.lock index 344f6d7..ffd797c 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,15 @@ "nodes": { "POP": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": [ + "tenzir-devops", + "omnibus", + "flops" + ], "nixlib": "nixlib", "nixpkgs": [ "tenzir-devops", - "std-ext", + "omnibus", "flops" ] }, @@ -41,11 +45,11 @@ }, "call-flake": { "locked": { - "lastModified": 1687380775, + "lastModified": 1697332845, "narHash": "sha256-bmhE1TmrJG4ba93l9WQTLuYM53kwGQAjYHRvHOeuxWU=", "owner": "divnix", "repo": "call-flake", - "rev": "74061f6c241227cd05e79b702db9a300a2e4131a", + "rev": "088f8589c7f3ee59bea1858a89f5125d284c3c4a", "type": "github" }, "original": { @@ -56,11 +60,11 @@ }, "call-flake_2": { "locked": { - "lastModified": 1689473344, + "lastModified": 1687380775, "narHash": "sha256-bmhE1TmrJG4ba93l9WQTLuYM53kwGQAjYHRvHOeuxWU=", "owner": "divnix", "repo": "call-flake", - "rev": "a07e91d3fb59eb9f7ec706a151e1a7b36a1e8727", + "rev": "74061f6c241227cd05e79b702db9a300a2e4131a", "type": "github" }, "original": { @@ -71,15 +75,18 @@ }, "devshell": { "inputs": { - "nixpkgs": "nixpkgs_3", + "nixpkgs": [ + "tenzir-devops", + "nixpkgs" + ], "systems": "systems" }, "locked": { - "lastModified": 1692793255, - "narHash": "sha256-yVyj0AE280JkccDHuG1XO9oGxN6bW8ksr/xttXcXzK0=", + "lastModified": 1698410321, + "narHash": "sha256-MphuSlgpmKwtJncGMohryHiK55J1n6WzVQ/OAfmfoMc=", "owner": "numtide", "repo": "devshell", - "rev": "2aa26972b951bc05c3632d4e5ae683cb6771a7c6", + "rev": "1aed986e3c81a4f6698e85a7452cbfcc4b31a36e", "type": "github" }, "original": { @@ -92,18 +99,20 @@ "inputs": { "haumea": [ "tenzir-devops", - "std", + "omnibus", + "flops", "haumea" ], "nixlib": [ "tenzir-devops", - "std", - "haumea", - "nixpkgs" + "omnibus", + "flops", + "nixlib" ], "yants": [ "tenzir-devops", - "std", + "omnibus", + "flops", "yants" ] }, @@ -117,7 +126,6 @@ }, "original": { "owner": "divnix", - "ref": "0.2.1", "repo": "dmerge", "type": "github" } @@ -126,20 +134,18 @@ "inputs": { "haumea": [ "tenzir-devops", - "std-ext", - "flops", + "std", "haumea" ], "nixlib": [ "tenzir-devops", - "std-ext", - "flops", - "nixlib" + "std", + "haumea", + "nixpkgs" ], "yants": [ "tenzir-devops", - "std-ext", - "flops", + "std", "yants" ] }, @@ -153,26 +159,11 @@ }, "original": { "owner": "divnix", + "ref": "0.2.1", "repo": "dmerge", "type": "github" } }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -181,11 +172,11 @@ ] }, "locked": { - "lastModified": 1690933134, - "narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=", + "lastModified": 1698882062, + "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb", + "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", "type": "github" }, "original": { @@ -195,72 +186,15 @@ } }, "flake-utils": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" + "inputs": { + "systems": "systems_2" }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_5": { "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -269,7 +203,7 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_2": { "locked": { "lastModified": 1653893745, "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", @@ -287,18 +221,18 @@ "flops": { "inputs": { "POP": "POP", - "call-flake": "call-flake_2", - "dmerge": "dmerge_2", - "haumea": "haumea_2", + "call-flake": "call-flake", + "dmerge": "dmerge", + "haumea": "haumea", "nixlib": "nixlib_2", - "yants": "yants_2" + "yants": "yants" }, "locked": { - "lastModified": 1693044856, - "narHash": "sha256-hb1rnTQ59YQfcAGooCHfO8Aj+q38FsaywFCQDNpuMMc=", + "lastModified": 1699224044, + "narHash": "sha256-4gcOHdPINNRlA3OmNVYn+qtWuLeG10N2CWi50R4eUGw=", "owner": "gtrunsec", "repo": "flops", - "rev": "64575b00a6b40080bf8f64fdb34eb18aad79224e", + "rev": "4aff40202cf1db539700d266636a6626b99157f9", "type": "github" }, "original": { @@ -309,42 +243,42 @@ }, "haumea": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": [ + "tenzir-devops", + "omnibus", + "flops", + "nixlib" + ] }, "locked": { - "lastModified": 1685133229, - "narHash": "sha256-FePm/Gi9PBSNwiDFq3N+DWdfxFq0UKsVVTJS3cQPn94=", + "lastModified": 1697205539, + "narHash": "sha256-gHEy0Q+eEQJkWl6/DpFxXPOlTx/lMU7Pvs/bwoq4OhI=", "owner": "nix-community", "repo": "haumea", - "rev": "34dd58385092a23018748b50f9b23de6266dffc2", + "rev": "fc119c500189f739fec7ad33d111f9c92910eccf", "type": "github" }, "original": { "owner": "nix-community", - "ref": "v0.2.2", "repo": "haumea", "type": "github" } }, "haumea_2": { "inputs": { - "nixpkgs": [ - "tenzir-devops", - "std-ext", - "flops", - "nixlib" - ] + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1689557889, - "narHash": "sha256-kllmt6JnHlry+WAASdSMDaRwbiuk2dFhkbW3Qz1w8BU=", + "lastModified": 1685133229, + "narHash": "sha256-FePm/Gi9PBSNwiDFq3N+DWdfxFq0UKsVVTJS3cQPn94=", "owner": "nix-community", "repo": "haumea", - "rev": "d6a9593ff2160ce29bf6d905e9ccbcecd66baeef", + "rev": "34dd58385092a23018748b50f9b23de6266dffc2", "type": "github" }, "original": { "owner": "nix-community", + "ref": "v0.2.2", "repo": "haumea", "type": "github" } @@ -381,11 +315,11 @@ ] }, "locked": { - "lastModified": 1688922987, - "narHash": "sha256-RnQwrCD5anqWfyDAVbfFIeU+Ha6cwt5QcIwIkaGRzQw=", + "lastModified": 1697285352, + "narHash": "sha256-tRGLm/DO8+anGUCgLYxTF5EPqWv8EZ9MVFWRdh285HU=", "owner": "nlewo", "repo": "nix2container", - "rev": "ab381a7d714ebf96a83882264245dbd34f0a7ec8", + "rev": "9d7f33ef0058f4df4c0912025f43c758a3289d76", "type": "github" }, "original": { @@ -397,10 +331,11 @@ "nixago": { "inputs": { "flake-utils": "flake-utils_2", - "nixago-exts": "nixago-exts", + "nixago-exts": [ + "tenzir-devops" + ], "nixpkgs": [ "tenzir-devops", - "std-ext", "nixpkgs" ] }, @@ -418,112 +353,6 @@ "type": "github" } }, - "nixago-exts": { - "inputs": { - "flake-utils": "flake-utils_3", - "nixago": "nixago_2", - "nixpkgs": [ - "tenzir-devops", - "std-ext", - "nixago", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1676070308, - "narHash": "sha256-QaJ65oc2l8iwQIGWUJ0EKjCeSuuCM/LqR8RauxZUUkc=", - "owner": "nix-community", - "repo": "nixago-extensions", - "rev": "e5380cb0456f4ea3c86cf94e3039eb856bf07d0b", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixago-extensions", - "type": "github" - } - }, - "nixago-exts_2": { - "inputs": { - "flake-utils": "flake-utils_5", - "nixago": "nixago_3", - "nixpkgs": [ - "tenzir-devops", - "std-ext", - "nixago", - "nixago-exts", - "nixago", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1655508669, - "narHash": "sha256-BDDdo5dZQMmwNH/GNacy33nPBnCpSIydWFPZs0kkj/g=", - "owner": "nix-community", - "repo": "nixago-extensions", - "rev": "3022a932ce109258482ecc6568c163e8d0b426aa", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixago-extensions", - "type": "github" - } - }, - "nixago_2": { - "inputs": { - "flake-utils": "flake-utils_4", - "nixago-exts": "nixago-exts_2", - "nixpkgs": [ - "tenzir-devops", - "std-ext", - "nixago", - "nixago-exts", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1676070010, - "narHash": "sha256-iYzJIWptE1EUD8VINAg66AAMUajizg8JUYN3oBmb8no=", - "owner": "nix-community", - "repo": "nixago", - "rev": "d480ba6c0c16e2c5c0bd2122852d6a0c9ad1ed0e", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "rename-config-data", - "repo": "nixago", - "type": "github" - } - }, - "nixago_3": { - "inputs": { - "flake-utils": "flake-utils_6", - "nixpkgs": [ - "tenzir-devops", - "std-ext", - "nixago", - "nixago-exts", - "nixago", - "nixago-exts", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1655405483, - "narHash": "sha256-Crd49aZWNrpczlRTOwWGfwBMsTUoG9vlHDKQC7cx264=", - "owner": "nix-community", - "repo": "nixago", - "rev": "e6a9566c18063db5b120e69e048d3627414e327d", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixago", - "type": "github" - } - }, "nixlib": { "locked": { "lastModified": 1653180592, @@ -541,11 +370,11 @@ }, "nixlib_2": { "locked": { - "lastModified": 1689469483, - "narHash": "sha256-2SBhY7rZQ/iNCxe04Eqxlz9YK9KgbaTMBssq3/BgdWY=", + "lastModified": 1698540503, + "narHash": "sha256-YN6DJQc7SMe6ep9FhD2BGl92bo24NPNRWjADEJE4xeU=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "02fea408f27186f139153e1ae88f8ab2abd9c22c", + "rev": "ce2acb20a405bf6f910081c2adc988bbc8100e4c", "type": "github" }, "original": { @@ -556,11 +385,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1691279975, - "narHash": "sha256-EwPVVuQJGf77NOlX96FE9bpbFGz1wq/M4sqJ6Vk4LyM=", + "lastModified": 1699126377, + "narHash": "sha256-LtDx5VgD/F+5SSRqt8BRSiZi5EwMjWLI1XGjWizcnMI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "97bd658852ce0efbdc4d9ca84ad466a4cbfb1cf4", + "rev": "e583a3b08f2b59488deb2ace2528df37c931509f", "type": "github" }, "original": { @@ -572,11 +401,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1681001314, - "narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=", + "lastModified": 1660438583, + "narHash": "sha256-rJUTYxFKlWUJI3njAwEc1pKAVooAViZGJvsgqfh/q/E=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "367c0e1086a4eb4502b24d872cea2c7acdd557f4", + "rev": "bbd8f7cd87d0b29294ef3072ffdbd61d60f05da4", "type": "github" }, "original": { @@ -587,27 +416,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1677383253, - "narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9952d6bc395f5841262b006fbace8dd7e143b634", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1660438583, - "narHash": "sha256-rJUTYxFKlWUJI3njAwEc1pKAVooAViZGJvsgqfh/q/E=", + "lastModified": 1681001314, + "narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "bbd8f7cd87d0b29294ef3072ffdbd61d60f05da4", + "rev": "367c0e1086a4eb4502b24d872cea2c7acdd557f4", "type": "github" }, "original": { @@ -631,9 +444,27 @@ "type": "github" } }, + "omnibus": { + "inputs": { + "flops": "flops" + }, + "locked": { + "lastModified": 1699263487, + "narHash": "sha256-NqLRU+2HAPg4RzE9F0WlIkRei2/D51hbtTjRNe/meas=", + "owner": "gtrunsec", + "repo": "omnibus", + "rev": "b3fc889d22059065b2e955d5721a55cb013fc44b", + "type": "github" + }, + "original": { + "owner": "gtrunsec", + "repo": "omnibus", + "type": "github" + } + }, "paisano": { "inputs": { - "call-flake": "call-flake", + "call-flake": "call-flake_2", "nixpkgs": [ "tenzir-devops", "std", @@ -696,11 +527,10 @@ "blank": "blank", "devshell": [ "tenzir-devops", - "std-ext", "devshell" ], - "dmerge": "dmerge", - "haumea": "haumea", + "dmerge": "dmerge_2", + "haumea": "haumea_2", "incl": "incl", "makes": [ "tenzir-devops", @@ -718,7 +548,6 @@ ], "nixago": [ "tenzir-devops", - "std-ext", "nixago" ], "nixpkgs": [ @@ -732,7 +561,7 @@ "std", "blank" ], - "yants": "yants" + "yants": "yants_2" }, "locked": { "lastModified": 1692861655, @@ -748,38 +577,22 @@ "type": "github" } }, - "std-ext": { - "inputs": { - "devshell": "devshell", - "flops": "flops", - "nixago": "nixago", - "nixpkgs": [ - "tenzir-devops", - "nixpkgs" - ], - "org-roam-book-template": [ - "tenzir-devops" - ], - "std": [ - "tenzir-devops", - "std" - ] - }, + "systems": { "locked": { - "lastModified": 1693045237, - "narHash": "sha256-FL5QTb/xSLjE/G7aXK3guj63Gkm1YekgPB7qOz0OmT4=", - "owner": "gtrunsec", - "repo": "std-ext", - "rev": "ecbec9f9f0c13f765f282bd11f340a7be0743c79", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { - "owner": "gtrunsec", - "repo": "std-ext", + "owner": "nix-systems", + "repo": "default", "type": "github" } }, - "systems": { + "systems_2": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -796,28 +609,25 @@ }, "tenzir-devops": { "inputs": { + "devshell": "devshell", "flake-parts": "flake-parts", - "flops": [ - "tenzir-devops", - "std-ext", - "flops" - ], "n2c": "n2c", + "nixago": "nixago", "nixpkgs": "nixpkgs", "nixpkgs-users": [ "tenzir-devops", "nixpkgs" ], - "std": "std", - "std-ext": "std-ext" + "omnibus": "omnibus", + "std": "std" }, "locked": { "dir": "nix/devops", - "lastModified": 1698645904, - "narHash": "sha256-WWZ5PAK5Vmy6QesY4SNjVrxJYH0ps7xcdSYAo0GapA4=", + "lastModified": 1699263556, + "narHash": "sha256-zHCP98RTHjXjuU9e6bDtnrxLD08G/8Bz61XLZ2ehIDQ=", "owner": "gtrunsec", "repo": "vast", - "rev": "9a4874234bb9d0d1051d7fe45417c60bf2049431", + "rev": "7bbe34d51d77e3a8b0bd568483266ec5ce9f9089", "type": "github" }, "original": { @@ -830,12 +640,7 @@ }, "yants": { "inputs": { - "nixpkgs": [ - "tenzir-devops", - "std", - "haumea", - "nixpkgs" - ] + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1686863218, @@ -853,7 +658,12 @@ }, "yants_2": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": [ + "tenzir-devops", + "std", + "haumea", + "nixpkgs" + ] }, "locked": { "lastModified": 1686863218, diff --git a/flake.nix b/flake.nix index b797ea8..fbc3351 100644 --- a/flake.nix +++ b/flake.nix @@ -1,23 +1,30 @@ { description = "The users' interface to the Tenzir platform"; - outputs = { - self, - tenzir-devops, - ... - } @ inputs: - ( - tenzir-devops.lib.mkStd {inherit inputs;} - ) + outputs = + { self, tenzir-devops, ... }@inputs: + (tenzir-devops.lib.mkStd { inherit inputs; }) // { - devShells = inputs.tenzir-devops.inputs.std.harvest inputs.self [["dev" "shells"]]; - templates = (inputs.tenzir-devops.inputs.std.harvest inputs.self ["dev" "lib"]).x86_64-linux.templates; + devShells = inputs.tenzir-devops.inputs.std.harvest inputs.self [ + [ + "dev" + "shells" + ] + ]; + templates = + (inputs.tenzir-devops.inputs.std.harvest inputs.self [ + "dev" + "lib" + ]).x86_64-linux.templates; }; inputs = { tenzir-devops.url = "github:gtrunsec/vast/devops?dir=nix/devops"; nixpkgs.follows = "tenzir-devops/nixpkgs"; }; nixConfig = { - extra-substituters = ["https://tenzir.cachix.org" "https://vast.cachix.org"]; + extra-substituters = [ + "https://tenzir.cachix.org" + "https://vast.cachix.org" + ]; extra-trusted-public-keys = [ "tenzir.cachix.org-1:+MLwldLx9GLGLsi9mDr5RrVYyI64iVobWpntJaPM50E=" "vast.cachix.org-1:0L8rErLUuFAdspyGYYQK3Sgs9PYRMzkLEqS2GxfaQhA=" diff --git a/units/cells/dev/configs/treefmt.nix b/units/cells/dev/configs/treefmt.nix new file mode 100644 index 0000000..cee8e56 --- /dev/null +++ b/units/cells/dev/configs/treefmt.nix @@ -0,0 +1,6 @@ +{ + formatter.prettier = { + command = "prettier"; + excludes = dmerge.append [ "generated-*.yaml" ]; + }; +} diff --git a/cells/dev/shellsProfiles/commands.toml b/units/cells/dev/shellsProfiles/commands.toml similarity index 100% rename from cells/dev/shellsProfiles/commands.toml rename to units/cells/dev/shellsProfiles/commands.toml diff --git a/cells/dev/shellsProfiles/packages.toml b/units/cells/dev/shellsProfiles/packages.toml similarity index 100% rename from cells/dev/shellsProfiles/packages.toml rename to units/cells/dev/shellsProfiles/packages.toml diff --git a/cells/dev/tasks/climod.md b/units/cells/dev/tasks/climod.md similarity index 100% rename from cells/dev/tasks/climod.md rename to units/cells/dev/tasks/climod.md diff --git a/cells/dev/tasks/climod.nix b/units/cells/dev/tasks/climod.nix similarity index 70% rename from cells/dev/tasks/climod.nix rename to units/cells/dev/tasks/climod.nix index a0f92ce..f6835f6 100644 --- a/cells/dev/tasks/climod.nix +++ b/units/cells/dev/tasks/climod.nix @@ -16,15 +16,17 @@ climod { ''; subcommands.eoq.description = "Eoq subcommand"; subcommands.tasks.subcommands.makeScript.description = "makes::fun => make a script"; - subcommands.tasks.subcommands.makeScript.action.bash = let - md = '' - # example + subcommands.tasks.subcommands.makeScript.action.bash = + let + md = '' + # example - ```nix - ${builtins.readFile ./makes-test.nix} - ``` + ```nix + ${builtins.readFile ./makes-test.nix} + ``` + ''; + in + '' + echo '${md}' | glow - ''; - in '' - echo '${md}' | glow - - ''; } diff --git a/cells/dev/tasks/makes-ps-tenzir/_env b/units/cells/dev/tasks/makes-ps-tenzir/_env similarity index 100% rename from cells/dev/tasks/makes-ps-tenzir/_env rename to units/cells/dev/tasks/makes-ps-tenzir/_env diff --git a/cells/dev/tasks/makes-ps-tenzir/default.nix b/units/cells/dev/tasks/makes-ps-tenzir/default.nix similarity index 94% rename from cells/dev/tasks/makes-ps-tenzir/default.nix rename to units/cells/dev/tasks/makes-ps-tenzir/default.nix index da93703..74ccb47 100644 --- a/cells/dev/tasks/makes-ps-tenzir/default.nix +++ b/units/cells/dev/tasks/makes-ps-tenzir/default.nix @@ -1,6 +1,6 @@ makeScript { name = "process-compose-tenzir"; - searchPaths.bin = []; + searchPaths.bin = [ ]; searchPaths.source = [ ./env (makeEnvVars { diff --git a/cells/dev/tasks/makes-ps-tenzir/env b/units/cells/dev/tasks/makes-ps-tenzir/env similarity index 100% rename from cells/dev/tasks/makes-ps-tenzir/env rename to units/cells/dev/tasks/makes-ps-tenzir/env diff --git a/cells/dev/tasks/makes-ps-tenzir/tenzir.yaml b/units/cells/dev/tasks/makes-ps-tenzir/tenzir.yaml similarity index 100% rename from cells/dev/tasks/makes-ps-tenzir/tenzir.yaml rename to units/cells/dev/tasks/makes-ps-tenzir/tenzir.yaml diff --git a/cells/dev/tasks/makes-test.nix b/units/cells/dev/tasks/makes-test.nix similarity index 89% rename from cells/dev/tasks/makes-test.nix rename to units/cells/dev/tasks/makes-test.nix index c02a322..7133c0f 100644 --- a/cells/dev/tasks/makes-test.nix +++ b/units/cells/dev/tasks/makes-test.nix @@ -1,8 +1,6 @@ makeScript { name = "runScriptWithEnv"; - searchPaths.bin = [ - nixpkgs.hello - ]; + searchPaths.bin = [ nixpkgs.hello ]; searchPaths.source = [ (makeEnvVars { name = "firstEnvVarsOutput"; diff --git a/units/cells/dev/tasks/runScriptWithEnv.nix b/units/cells/dev/tasks/runScriptWithEnv.nix new file mode 100644 index 0000000..082ffdd --- /dev/null +++ b/units/cells/dev/tasks/runScriptWithEnv.nix @@ -0,0 +1,18 @@ +makeScript { + name = "runScriptWithEnv"; + searchPaths.bin = [ nixpkgs.hello ]; + searchPaths.source = [ + (makeEnvVars { + name = "firstEnvVarsOutput"; + mapping = { + a = "1"; + b = "2"; + VAR_NAME = "test"; + }; + }) + ]; + entrypoint = '' + hello --help + echo $a + ''; +} diff --git a/cells/dev/tasks/script-json/default.json b/units/cells/dev/tasks/script-json/default.json similarity index 100% rename from cells/dev/tasks/script-json/default.json rename to units/cells/dev/tasks/script-json/default.json diff --git a/cells/dev/tasks/script-json/function.json b/units/cells/dev/tasks/script-json/function.json similarity index 100% rename from cells/dev/tasks/script-json/function.json rename to units/cells/dev/tasks/script-json/function.json diff --git a/units/cells/dev/tasks/test.nix b/units/cells/dev/tasks/test.nix new file mode 100644 index 0000000..d73fae6 --- /dev/null +++ b/units/cells/dev/tasks/test.nix @@ -0,0 +1 @@ +{ tenzir-devops }@args: args diff --git a/cells/prod/schemas/tenzir-sysmon.yaml b/units/cells/prod/schemas/tenzir-sysmon.yaml similarity index 100% rename from cells/prod/schemas/tenzir-sysmon.yaml rename to units/cells/prod/schemas/tenzir-sysmon.yaml diff --git a/units/cells/prod/tasks/deploy-tenzir-aws/default.nix b/units/cells/prod/tasks/deploy-tenzir-aws/default.nix new file mode 100644 index 0000000..3029854 --- /dev/null +++ b/units/cells/prod/tasks/deploy-tenzir-aws/default.nix @@ -0,0 +1,6 @@ +makeScript { + name = "runScriptWithEnv"; + searchPaths.bin = [ nixpkgs.awscli ]; + searchPaths.source = [ ./env ]; + entrypoint = ./entrypoint.sh; +} diff --git a/cells/prod/tasks/deploy-tenzir-aws/entrypoint.sh b/units/cells/prod/tasks/deploy-tenzir-aws/entrypoint.sh similarity index 100% rename from cells/prod/tasks/deploy-tenzir-aws/entrypoint.sh rename to units/cells/prod/tasks/deploy-tenzir-aws/entrypoint.sh diff --git a/cells/prod/tasks/deploy-tenzir-aws/env b/units/cells/prod/tasks/deploy-tenzir-aws/env similarity index 100% rename from cells/prod/tasks/deploy-tenzir-aws/env rename to units/cells/prod/tasks/deploy-tenzir-aws/env