misc improvements to modularity
This commit is contained in:
29 files changed
+111
-108
No files matched your search
@@ -1,4 +1,4 @@
|
||||
{ inputs, self, ... }: let
|
||||
{ inputs, self, lib, ... }: let
|
||||
spicetifyEnableOptionAttrs = { lib }: {
|
||||
type = lib.types.bool;
|
||||
description = "Whether to enable Spicetify, a modified version of Spotify that supports plugins and themes.";
|
||||
@@ -6,7 +6,7 @@
|
||||
};
|
||||
|
||||
spicetifyThemeOptionAttrs = { pkgs, lib }: {
|
||||
type = inputs.nixpkgs.lib.types.nullOr (inputs.nixpkgs.lib.types.enum (builtins.attrNames inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system}.themes));
|
||||
type = lib.types.nullOr (lib.types.enum (builtins.attrNames inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system}.themes));
|
||||
description = "This option is used to select a theme for Spicetify to use, from the list of available packages themes.";
|
||||
default = null;
|
||||
};
|
||||
@@ -15,7 +15,7 @@ in {
|
||||
options.features.applications.gui.spotify.enable = lib.mkEnableOption "Spotify";
|
||||
})) ];
|
||||
|
||||
flake.nixosModules.graphicsOptions = { lib, pkgs, ... }: {
|
||||
flake.nixosModules.graphicsOptions = { pkgs, lib, ... }: {
|
||||
options.features.applications.gui.spotify.spicetify = {
|
||||
enable = inputs.helpers.mkRedundantOption "features.nixos.home-manager.enable" "true" (spicetifyEnableOptionAttrs { inherit lib; });
|
||||
theme = inputs.helpers.mkRedundantOption "features.nixos.home-manager.enable" "true" (spicetifyThemeOptionAttrs { inherit pkgs lib; });
|
||||
@@ -26,7 +26,7 @@ in {
|
||||
spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
in {
|
||||
config = lib.mkIf (config.features.applications.gui.spotify.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.spotify = {
|
||||
home-manager.users.${config.info.userName}.features.applications.gui.spotify = {
|
||||
enable = lib.mkDefault true;
|
||||
spicetify = lib.mkDefault config.features.applications.gui.spotify.spicetify;
|
||||
};
|
||||
@@ -35,7 +35,7 @@ in {
|
||||
});
|
||||
};
|
||||
|
||||
flake.homeModules.graphicsOptions = { lib, pkgs, ... }: {
|
||||
flake.homeModules.graphicsOptions = { pkgs, lib, ... }: {
|
||||
options.features.applications.gui.spotify.spicetify = {
|
||||
enable = lib.mkOption (spicetifyEnableOptionAttrs { inherit lib; });
|
||||
theme = lib.mkOption (spicetifyThemeOptionAttrs { inherit pkgs lib; });
|
||||
|
||||
Reference in new issue
Block a user