Commit 2aa4298266d0

Vincent Demeester <vincent@sbr.pm>
2020-06-01 14:14:26
systems/hokkaido: enable virtualisation.containers…
… and migrate kubernetes/openshift setup Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 9d00ea2
systems/hokkaido.nix
@@ -43,4 +43,6 @@ in
     mail.enable = enableHome;
     yubikey.enable = true;
   };
+
+  virtualisation.containers.enable = true;
 }
users/vincent/containers/chos4.desktop
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Name=chos4
+Exec=chos4 install
+Type=Application
+Terminal=true
+Categories=System;
users/vincent/containers/default.nix
@@ -0,0 +1,9 @@
+{ pkgs, ... }:
+
+{
+  imports = [
+    ./gcloud.nix
+    ./kubernetes.nix
+    ./openshift.nix
+  ];
+}
users/vincent/containers/gcloud.nix
@@ -0,0 +1,11 @@
+{ pkgs, ... }:
+
+{
+  xdg.configFile."nr/gcloud" = {
+    text = builtins.toJSON [
+      { cmd = "gcloud"; pkg = "google-cloud-sdk"; }
+      { cmd = "gcsfuse"; }
+    ];
+    onChange = "${pkgs.my.nr}/bin/nr gcloud";
+  };
+}
users/vincent/containers/kubernetes.nix
@@ -0,0 +1,15 @@
+{ pkgs, ... }:
+
+{
+  home.packages = with pkgs; [
+    #cri-tools
+    kail
+    # kubectl # FIXME this goes against oc
+    kustomize
+    kubectx
+    my.ko
+    my.krew
+    my.kss
+    my.kubernix
+  ];
+}
users/vincent/containers/openshift.nix
@@ -0,0 +1,11 @@
+{ pkgs, ... }:
+
+{
+  home.file.".local/share/applications/chos4.desktop".source = ./chos4.desktop;
+  home.packages = with pkgs; [
+    my.crc
+    my.oc
+    #my.openshift-install
+    my.operator-sdk
+  ];
+}
users/vincent/default.nix
@@ -27,11 +27,14 @@ with lib;
       (import ../modules)
       (import ./core)
     ]
-    ++ optionals config.profiles.dev.enable [
-      (import ./dev)
-    ]
-    ++ optionals config.profiles.desktop.enable [
-      (import ./desktop)
+    ++ optionals config.profiles.dev.enable [ (import ./dev) ]
+    ++ optionals config.profiles.desktop.enable [ (import ./desktop) ]
+    ++ optionals config.profiles.docker.enable [{
+      home.packages = with pkgs; [ docker docker-compose ];
+    }]
+    ++ optionals (config.virtualisation.containers.enable && config.profiles.dev.enable) [
+      (import ./containers)
     ]
+    # TODO: mpd
   );
 }