diff --git a/old/modules/home/iconTheme.nix b/modules/home/iconTheme/default.nix similarity index 57% rename from old/modules/home/iconTheme.nix rename to modules/home/iconTheme/default.nix index 265bfb2..cab86f1 100644 --- a/old/modules/home/iconTheme.nix +++ b/modules/home/iconTheme/default.nix @@ -1,24 +1,28 @@ { lib, config, ... }: - -with lib; - let + inherit (lib) + types + mkOption + mkIf + mkDefault + ; + # https://github.com/nix-community/home-manager/blob/master/modules/misc/gtk.nix iconThemeType = types.submodule { options = { package = mkOption { - type = types.nullOr types.package; + type = with types; nullOr package; default = null; - example = literalExpression "pkgs.gnome.adwaita-icon-theme"; + example = "pkgs.gnome.adwaita-icon-theme"; description = '' - Package providing the icon theme. This package will be installed - to your profile. If `null` then the theme - is assumed to already be available in your profile. + Package providing the icon theme. This package will be installed to + your profile. If `null` then the theme is assumed to already be + available in your profile. ''; }; name = mkOption { - type = types.str; + type = with types; str; example = "Adwaita"; description = "The name of the icon theme within the package."; }; @@ -29,11 +33,9 @@ in options = { home = { iconTheme = mkOption { - type = types.nullOr iconThemeType; + type = with types; nullOr iconThemeType; default = null; - description = '' - The icon theme to use. - ''; + description = "The icon theme to use."; }; }; }; @@ -42,18 +44,18 @@ in let cfg = config.home.iconTheme; in - { + mkIf (cfg != "null") { gtk = mkIf config.gtk.enable (mkDefault { iconTheme = { - name = cfg.name; - package = cfg.package; + inherit (cfg) name; + package = mkIf (cfg.package != "null") cfg.package; }; }); services.dunst = mkIf config.services.dunst.enable (mkDefault { iconTheme = { - name = cfg.name; - package = cfg.package; + inherit (cfg) name; + package = mkIf (cfg.package != "null") cfg.package; }; }); };