From 9aa11e45b8df65e3e2196c0f911cb5fcd14398e9 Mon Sep 17 00:00:00 2001 From: L-Nafaryus Date: Thu, 29 Jun 2023 15:59:03 +0500 Subject: [PATCH] new: podman --- flake.nix | 1 + hosts/elnafo/default.nix | 6 +++++- modules/desktop/media/recording.nix | 1 + modules/services/podman.nix | 33 +++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 modules/services/podman.nix diff --git a/flake.nix b/flake.nix index 9c8c34c..17fc942 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,7 @@ mkPkgs = pkgs: extraOverlays: import pkgs { inherit system; config.allowUnfree = true; + # config.cudaSupport = true; overlays = extraOverlays ++ (lib.attrValues self.overlays); }; diff --git a/hosts/elnafo/default.nix b/hosts/elnafo/default.nix index d89e58c..a9e454e 100644 --- a/hosts/elnafo/default.nix +++ b/hosts/elnafo/default.nix @@ -25,7 +25,10 @@ steam.enable = true; lutris.enable = true; }; - graphics.enable = true; + graphics = { + enable = true; + models.enable = true; + }; media = { recording.enable = true; }; @@ -60,6 +63,7 @@ services = { ssh.enable = true; nginx.enable = true; + podman.enable = true; }; }; diff --git a/modules/desktop/media/recording.nix b/modules/desktop/media/recording.nix index 0892c70..444bc6e 100644 --- a/modules/desktop/media/recording.nix +++ b/modules/desktop/media/recording.nix @@ -23,6 +23,7 @@ in { unstable.obs-studio-plugins.obs-vkcapture unstable.handbrake ffmpeg + olive-editor ] else []); }; } diff --git a/modules/services/podman.nix b/modules/services/podman.nix new file mode 100644 index 0000000..12140c8 --- /dev/null +++ b/modules/services/podman.nix @@ -0,0 +1,33 @@ +{ config, options, pkgs, lib, ... }: +with lib; +with lib.custom; +let + cfg = config.modules.services.podman; +in { + options.modules.services.podman = { + enable = mkBoolOpt false; + }; + + config = mkIf cfg.enable { + virtualisation = { + podman = { + enable = true; + # Create a `docker` alias for podman, to use it as a drop-in replacement + dockerCompat = true; + # Required for containers under podman-compose to be able to talk to each other. + defaultNetwork.settings.dns_enabled = true; + }; + oci-containers = { + backend = "podman"; + containers = { + container-name = { + image = "container-image"; + autoStart = true; + ports = [ "127.0.0.1:1234:1234" ]; + }; + }; + }; + }; + + }; +}