distrobox: make systemd unit optional (#7007)

This PR adds an option enableSystemdUnit to the Distrobox module to make the Systemd Unit optional, and hard coded as is now.
This commit is contained in:
Aguirre Matteo
2025-05-09 13:33:12 +00:00
committed by GitHub
parent e9bd9568db
commit b706037a60

View File

@@ -21,9 +21,16 @@ in
options.programs.distrobox = {
enable = mkEnableOption "distrobox";
package = mkPackageOption pkgs "distrobox" { };
enableSystemdUnit = mkOption {
type = lib.types.bool;
default = true;
example = false;
description = ''
Whatever to enable a Systemd Unit that automatically rebuilds your
containers when changes are detected.
'';
};
containers = mkOption {
type = formatter.type;
default = { };
@@ -77,7 +84,7 @@ in
formatter.generate "containers.ini" cfg.containers
);
systemd.user.services.distrobox-home-manager = {
systemd.user.services.distrobox-home-manager = mkIf cfg.enableSystemdUnit {
Unit.Description = "Build the containers declared in ~/.config/distrobox/containers.ini";
Install.WantedBy = [ "default.target" ];