Commit c9c081423d8e

Vincent Demeester <vincent@sbr.pm>
2018-11-01 16:01:00
programs: add podman program
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 7372e0a
modules/programs/podman.nix
@@ -0,0 +1,47 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+  cfg = config.programs.podman;
+in
+{
+  options = {
+    programs.podman = {
+      enable = mkOption {
+        default = false;
+        description = "Enable VS Code profile";
+        type = types.bool;
+      };
+    };
+  };
+  config = mkIf cfg.enable {
+    # FIXME(vdemeester) package podman and conmon in nixpkgs
+    xdg.configFile."containers/libpod.conf".text = ''
+      image_default_transport = "docker://"
+      runtime_path = ["/run/current-system/sw/bin/runc"]
+      conmon_path = ["/run/current-system/sw/bin/conmon"]
+      cni_plugin_dir = ["${pkgs.cni-plugins}/bin/"]
+      cgroup_manager = "systemd"
+      cni_config_dir = "/etc/cni/net.d/"
+      cni_default_network = "podman"
+      # pause
+      pause_image = "k8s.gcr.io/pause:3.1"
+      pause_command = "/pause"
+    '';
+
+    xdg.configFile."containers/registries.conf".text = ''
+      [registries.search]
+      registries = ['docker.io', 'registry.fedoraproject.org', 'quay.io', 'registry.access.redhat.com', 'registry.centos.org']
+      [registries.insecure]
+      registries = []
+    '';
+
+    xdg.configFile."containers/policy.json".text = ''
+    {
+      "default": [
+        { "type": "insecureAcceptAnything" }
+      ]
+    }
+    '';
+  };
+}
modules/module-list.nix
@@ -20,6 +20,7 @@
     ./profiles/ssh.nix
     ./profiles/tmux.nix
     ./profiles/zsh.nix
+    ./programs/podman.nix
     ./programs/vscode.nix
     ./services/shairport-sync.nix
   ];
hokkaido.nix
@@ -15,6 +15,7 @@
     rust.enable = true;
   };
   programs.vscode.enable = true;
+  programs.podman.enable = true;
   home.packages = with pkgs; [
     google-chrome
   ];
shikoku.nix
@@ -17,6 +17,7 @@
     rust.enable = true;
   };
   programs.vscode.enable = true;
+  programs.podman.enable = true;
   xdg.configFile."fish/conf.d/docker.fish".text = ''
     set -gx DOCKER_BUILDKIT 1
   '';
wakasu.nix
@@ -16,6 +16,7 @@
     rust.enable = true;
   };
   programs.vscode.enable = true;
+  programs.podman.enable = true;
   xdg.configFile."fish/conf.d/docker.fish".text = ''
     set -gx DOCKER_BUILDKIT 1
   '';