From 3a99fc2b03f23597eec5dfb1c71521ffe9e4e6ce Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Fri, 29 Mar 2024 17:24:12 -0600 Subject: [PATCH] podman in workstation --- workstation/configuration.org | 21 ++++++++------- workstation/docker.nix | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 workstation/docker.nix diff --git a/workstation/configuration.org b/workstation/configuration.org index b8266e3..2570934 100644 --- a/workstation/configuration.org +++ b/workstation/configuration.org @@ -69,6 +69,7 @@ passwords and other secrets. imports = [ # ./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 diff --git a/workstation/docker.nix b/workstation/docker.nix new file mode 100644 index 0000000..fc03635 --- /dev/null +++ b/workstation/docker.nix @@ -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"; + }; + }; + }; + }; + }; +}