mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
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:
@@ -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" ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user