From 22067b477a060aa3d44f83464164b33c6b383beb Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 12 Apr 2023 11:52:10 +0200 Subject: [PATCH] Move declarative containers to a new module --- configuration.nix | 1 + modules/containers.nix | 26 ++++++++++++++++++++++++++ modules/information.nix | 23 ----------------------- 3 files changed, 27 insertions(+), 23 deletions(-) create mode 100644 modules/containers.nix diff --git a/configuration.nix b/configuration.nix index bc8d07b..c05351e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -203,6 +203,7 @@ with pkgs; ./modules/communication.nix ./modules/information.nix ./modules/device.nix + ./modules/containers.nix ]; } diff --git a/modules/containers.nix b/modules/containers.nix new file mode 100644 index 0000000..52d222f --- /dev/null +++ b/modules/containers.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +{ + # Podman setup + virtualisation = { + containers.enable = true; + podman = { + enable = true; + dockerCompat = true; + extraPackages = with pkgs; [ zfs ]; + }; + + oci-containers = { + backend = "podman"; + containers = { + # Openbooks configuration + openbooks = { + image = + "evanbuss/openbooks@sha256:16609c3da954715f8f98b5de6c838146914ae700b2a700b4d9aad8b23c9217da"; + ports = [ "127.0.0.1:9000:80" ]; + cmd = [ "--name" "bookworm" "--searchbot" "searchook" "--persist" ]; + }; + }; + }; + }; +} diff --git a/modules/information.nix b/modules/information.nix index 32f19c5..cd64081 100644 --- a/modules/information.nix +++ b/modules/information.nix @@ -31,27 +31,4 @@ # Set environment variable pointing to wallabag configuration directory environment.variables.WALLABAG_DATA = "/var/lib/wallabag"; - # Podman setup - virtualisation = { - containers.enable = true; - podman = { - enable = true; - dockerCompat = true; - extraPackages = with pkgs; [ zfs ]; - }; - - # Openbooks configuration - oci-containers = { - backend = "podman"; - containers = { - openbooks = { - image = - "evanbuss/openbooks@sha256:16609c3da954715f8f98b5de6c838146914ae700b2a700b4d9aad8b23c9217da"; - ports = [ "127.0.0.1:9000:80" ]; - cmd = [ "--name" "bookworm" "--searchbot" "searchook" "--persist" ]; - }; - }; - }; - }; - }