Change to optional
This commit is contained in:
parent
d3328bc705
commit
5d5abbc1a8
1 changed files with 58 additions and 66 deletions
|
|
@ -3,27 +3,20 @@
|
||||||
options,
|
options,
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
inputs,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
options.mods.home_packages = {
|
options.mods.home_packages = {
|
||||||
noDefaultPackages = lib.mkOption {
|
useDefaultPackages = lib.mkOption {
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
type = lib.types.bool;
|
|
||||||
description = "No default packages (will use additional_packages only)";
|
|
||||||
};
|
|
||||||
enable = lib.mkOption {
|
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
description = "Home manager packages";
|
description = "Use default packages (will use additional_packages only if disabled)";
|
||||||
};
|
};
|
||||||
additional_packages = lib.mkOption {
|
additional_packages = lib.mkOption {
|
||||||
default = [ ];
|
default = [ ];
|
||||||
example = [ pkgs.flatpak ];
|
example = [ pkgs.flatpak ];
|
||||||
type = lib.types.str;
|
type = with lib.types; listOf package;
|
||||||
description = ''
|
description = ''
|
||||||
Additional Home manager packages.
|
Additional Home manager packages.
|
||||||
Will be installed regardless of default home manager packages are installed.
|
Will be installed regardless of default home manager packages are installed.
|
||||||
|
|
@ -60,13 +53,12 @@
|
||||||
description = "The email client";
|
description = "The email client";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = (
|
config =
|
||||||
lib.mkIf config.mods.home_packages.noDefaultPackages (
|
(lib.optionalAttrs (options ? home.packages) {
|
||||||
lib.optionalAttrs (options ? home.packages) {
|
|
||||||
home.packages = config.mods.home_packages.additional_packages;
|
home.packages = config.mods.home_packages.additional_packages;
|
||||||
}
|
})
|
||||||
)
|
// lib.mkIf config.mods.home_packages.useDefaultPackages (
|
||||||
// (lib.optionalAttrs (options ? home.packages) {
|
lib.optionalAttrs (options ? home.packages) {
|
||||||
home.packages =
|
home.packages =
|
||||||
with pkgs;
|
with pkgs;
|
||||||
[
|
[
|
||||||
|
|
@ -74,8 +66,8 @@
|
||||||
(lib.mkIf config.mods.home_packages.ncspot ncspot)
|
(lib.mkIf config.mods.home_packages.ncspot ncspot)
|
||||||
(lib.mkIf config.mods.home_packages.vesktop vesktop)
|
(lib.mkIf config.mods.home_packages.vesktop vesktop)
|
||||||
(lib.mkIf config.mods.home_packages.nextcloudClient nextcloud-client)
|
(lib.mkIf config.mods.home_packages.nextcloudClient nextcloud-client)
|
||||||
(lib.mkIf (options ? config.mods.home_pakcage.matrixClient) config.mods.home_packages.matrixClient)
|
(lib.mkIf (!isNull config.mods.home_packages.matrixClient) config.mods.home_packages.matrixClient)
|
||||||
(lib.mkIf (options ? config.mods.home_packages.mailClient) config.mods.home_packages.mailClient)
|
(lib.mkIf (!isNull config.mods.home_packages.mailClient) config.mods.home_packages.mailClient)
|
||||||
adw-gtk3
|
adw-gtk3
|
||||||
bat
|
bat
|
||||||
brave
|
brave
|
||||||
|
|
@ -115,6 +107,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
})
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue