Add podman service.

This commit is contained in:
Kevin Baensch 2023-06-07 01:14:47 +02:00
parent 16c8e41d35
commit e821fed3ff
Signed by: derped
GPG key ID: C0F1D326C7626543
4 changed files with 19 additions and 4 deletions

View file

@ -19,7 +19,8 @@ let
extraGroups = [ "audio" "wheel" "network" ] extraGroups = [ "audio" "wheel" "network" ]
++ (optionals cfg.xserver.enable ["input" "video"]) ++ (optionals cfg.xserver.enable ["input" "video"])
++ (optionals cfg.printing.enable [ "cups" "lp" ]) ++ (optionals cfg.printing.enable [ "cups" "lp" ])
++ (optional config.virtualisation.docker.enable "docker"); ++ (optional (config.virtualisation.docker.enable && !config.virtualisation.podman.enable) "docker")
++ (optional config.virtualisation.podman.enable "podman");
shell = "${pkgs.zsh}/bin/zsh"; shell = "${pkgs.zsh}/bin/zsh";
passwordFile = passPath; passwordFile = passPath;
# TODO: Fix for sops # TODO: Fix for sops

View file

@ -56,7 +56,7 @@ with lib;
"mullvad" "mullvad"
"mariaDB" "mariaDB"
"nspawn" "nspawn"
"docker" "docker" "podman"
]; ];
firewall = { firewall = {
enable = true; enable = true;

View file

@ -3,12 +3,11 @@
# Note: add privileged users to docker group for access # Note: add privileged users to docker group for access
with lib; with lib;
mkIf (elem "docker" config.machine.services) { mkIf ((elem "docker" config.machine.services) && !(elem "podman" config.machine.services)) {
virtualisation.docker= { virtualisation.docker= {
enable = true; enable = true;
# Disable live restore as it tends to delay/block system shutdown # Disable live restore as it tends to delay/block system shutdown
liveRestore = false; liveRestore = false;
}; };
environment.systemPackages = with pkgs; [ docker-compose docker-machine ]; environment.systemPackages = with pkgs; [ docker-compose docker-machine ];
### Docker Image stuff will probably follow here
} }

15
services/podman.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
with lib;
mkIf (elem "podman" config.machine.services) {
virtualisation.podman = {
enable = true;
dockerSocket.enable = (elem "docker" config.machine.services);
dockerCompat = (elem "docker" config.machine.services);
defaultNetwork = {
settings.dns_enabled = true;
};
};
environment.systemPackages = with pkgs; [ podman-compose ];
}