about summary refs log tree commit diff
path: root/modules/profiles/dev/containers.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2024-04-21 02:15:42 +0300
committerAzat Bahawi <azat@bahawi.net>2024-04-21 02:15:42 +0300
commite6ed60548397627bf10f561f9438201dbba0a36e (patch)
treef9a84c5957d2cc4fcd148065ee9365a0c851ae1c /modules/profiles/dev/containers.nix
parent2024-04-18 (diff)
2024-04-21
Diffstat (limited to '')
-rw-r--r--modules/profiles/dev/containers.nix71
1 files changed, 71 insertions, 0 deletions
diff --git a/modules/profiles/dev/containers.nix b/modules/profiles/dev/containers.nix
new file mode 100644
index 0000000..f75a26b
--- /dev/null
+++ b/modules/profiles/dev/containers.nix
@@ -0,0 +1,71 @@
+{
+  config,
+  lib,
+  pkgs,
+  ...
+}:
+with lib;
+let
+  cfg = config.nixfiles.modules.profiles.dev.containers;
+in
+{
+  options.nixfiles.modules.profiles.dev.containers.enable =
+    mkEnableOption "Tools for working with containers and container orchestration"
+    // {
+      default = config.nixfiles.modules.profiles.dev.enable;
+    };
+
+  config = mkIf cfg.enable {
+    nixfiles.modules = {
+      common.shell.aliases = {
+        h = "helm";
+        k = "kubectl";
+        kns = "kubens";
+        ktx = "kubectx";
+        b = "buildah";
+      };
+      podman.enable = true;
+    };
+
+    hm = {
+      home = {
+        sessionVariables = {
+          MINIKUBE_HOME = "${config.dirs.config}/minikube";
+          MINIKUBE_IN_STYLE = "false";
+          WERF_DEV = "true";
+          WERF_INSECURE_REGISTRY = "true";
+          WERF_LOG_DEBUG = "true";
+          WERF_LOG_PRETTY = "false";
+          WERF_LOG_VERBOSE = "true";
+          WERF_SYNCHRONIZATION = ":local";
+          WERF_TELEMETRY = "false";
+        };
+
+        packages = with pkgs; [
+          buildah
+          k9s
+          kubectl
+          kubectl-doctor
+          kubectl-images
+          kubectl-tree
+          kubectx
+          kubelogin-oidc
+          kubent
+          kubernetes-helm
+          kubespy
+          minikube
+          skopeo
+          stern
+          telepresence2
+          werf
+        ];
+      };
+
+      xdg.dataFile."minikube/config/config.json".text = generators.toJSON { } {
+        config.Rootless = true;
+        driver = "podman";
+        container-runtime = "cri-o";
+      };
+    };
+  };
+}

Consider giving Nix/NixOS a try! <3