podman in workstation

This commit is contained in:
Danilo Reyes 2024-03-29 17:24:12 -06:00
parent ffd09b636a
commit 3a99fc2b03
2 changed files with 61 additions and 10 deletions

View File

@ -69,6 +69,7 @@ passwords and other secrets.
imports = [
# <agenix/modules/age.nix>
./fstab.nix
./docker.nix
(import "${home-manager}/nixos")
# nixGaming.nixosModules.pipewireLowLatency
];
@ -919,7 +920,7 @@ environment = {
};
systemPackages = with pkgs; [
# virt-manager
docker-compose
# docker-compose
wget
gwe
];
@ -1170,15 +1171,15 @@ On this section, you can also add virtual machines settings.
programs.dconf.enable = true; # virt-manager requires dconf to remember settings
virtualisation = {
libvirtd.enable = false;
docker = {
enable = true;
enableNvidia = true;
autoPrune = {
enable = true;
flags = [ "--all" ];
dates = "weekly";
};
};
# docker = {
# enable = true;
# enableNvidia = true;
# autoPrune = {
# enable = true;
# flags = [ "--all" ];
# dates = "weekly";
# };
# };
};
#+end_src

50
workstation/docker.nix Normal file
View File

@ -0,0 +1,50 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [ podman-compose ];
virtualisation = {
podman = {
enable = true;
enableNvidia = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
autoPrune = {
enable = true;
flags = [ "--all" ];
dates = "weekly";
};
};
oci-containers = {
backend = "podman";
containers = {
flame = {
autoStart = true;
image = "pawelmalak/flame";
ports = [ "5005:5005" ];
volumes = [
"/var/lib/docker-configs/flame:/app/data"
"/var/run/docker.sock:/var/run/docker.sock"
];
environment = {
TZ = "America/Mexico_City";
PUID = "1000";
PGID = "100";
PASSWORD = "RkawpqMc8lR56QyU7JSfiLhG";
};
};
flame-nsfw = {
autoStart = true;
image = "pawelmalak/flame";
ports = [ "5007:5005" ];
volumes = [ "/var/lib/docker-configs/flame-nsfw:/app/data" ];
environment = {
TZ = "America/Mexico_City";
PUID = "1000";
PGID = "100";
PASSWORD = "RkawpqMc8lR56QyU7JSfiLhG";
};
};
};
};
};
}