From 3e93fc2b92711c439013c7a377a5ab8aad734667 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 23 Dec 2024 01:38:04 -0800 Subject: [PATCH] refactor: modularize distrobox module --- modules/linux/distrobox/default.nix | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/modules/linux/distrobox/default.nix b/modules/linux/distrobox/default.nix index 4b63a5c..0e5b800 100644 --- a/modules/linux/distrobox/default.nix +++ b/modules/linux/distrobox/default.nix @@ -1,9 +1,21 @@ -{ pkgs, ... }: { - virtualisation.podman = { - enable = true; - dockerCompat = true; - }; + pkgs, + lib, + config, + ... +}: +let + cfg = config.liminalOS.extras.distrobox; +in +{ + options.liminalOS.extras.distrobox.enable = lib.mkEnableOption "distrobox and podman"; - environment.systemPackages = [ pkgs.distrobox ]; + config = lib.mkIf cfg.enable { + virtualisation.podman = { + enable = true; + dockerCompat = true; + }; + + environment.systemPackages = [ pkgs.distrobox ]; + }; }