From c0e70a2a00f8f386ccd1543ea144dedf64a5f149 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Sat, 1 Feb 2025 10:19:09 -0300 Subject: [PATCH] feat(applications): add Forecast module --- .../applications/by-name/forecast/default.nix | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 modules/applications/by-name/forecast/default.nix diff --git a/modules/applications/by-name/forecast/default.nix b/modules/applications/by-name/forecast/default.nix new file mode 100644 index 0000000..038fd31 --- /dev/null +++ b/modules/applications/by-name/forecast/default.nix @@ -0,0 +1,158 @@ +{ lib, ... }: +lib.cosmic.applications.mkCosmicApplication { + name = "forecast"; + originalName = "Forecast"; + identifier = "com.jwestall.Forecast"; + configurationVersion = 1; + + maintainers = [ lib.maintainers.HeitorAugustoLN ]; + + settingsOptions = + let + inherit (lib.cosmic) defaultNullOpts; + in + { + api_key = defaultNullOpts.mkStr "" '' + The API key for Geocoding API. + ''; + + app_theme = + defaultNullOpts.mkRonEnum [ "Dark" "Light" "System" ] + { + __type = "enum"; + variant = "System"; + } + '' + The theme of the application. + ''; + + default_page = + defaultNullOpts.mkRonEnum [ "DailyView" "Details" "HourlyView" ] + { + __type = "enum"; + variant = "HourlyView"; + } + '' + The default page of the application. + ''; + + latitude = + defaultNullOpts.mkRonOptionalOf lib.types.str + { + __type = "optional"; + variant = "-28.971476"; + } + '' + The latitude of the location. + ''; + + location = + defaultNullOpts.mkRonOptionalOf lib.types.str + { + __type = "optional"; + variant = "Anta Gorda - RS, Brazil"; + } + '' + The name of the location. + ''; + + longitude = + defaultNullOpts.mkRonOptionalOf lib.types.str + { + __type = "optional"; + variant = "-412.005691"; + } + '' + The longitude of the location. + ''; + + pressure_units = + defaultNullOpts.mkRonEnum [ "Bar" "Hectopascal" "Kilopascal" "Psi" ] + { + __type = "enum"; + variant = "Hectopascal"; + } + '' + The units of the pressure. + ''; + + speed_units = + defaultNullOpts.mkRonEnum [ "KilometresPerHour" "MetersPerSecond" "MilesPerHour" ] + { + __type = "enum"; + variant = "KilometresPerHour"; + } + '' + The units of the speed. + ''; + + timefmt = + defaultNullOpts.mkRonEnum [ "TwelveHr" "TwentyFourHr" ] + { + __type = "enum"; + variant = "TwelveHr"; + } + '' + The time format. + ''; + + units = + defaultNullOpts.mkRonEnum [ "Celsius" "Fahrenheit" ] + { + __type = "enum"; + variant = "Fahrenheit"; + } + '' + The units of the temperature. + ''; + }; + + settingsExample = { + api_key = ""; + + app_theme = { + __type = "enum"; + variant = "System"; + }; + + default_page = { + __type = "enum"; + variant = "HourlyView"; + }; + + latitude = { + __type = "optional"; + variant = "-28.971476"; + }; + + location = { + __type = "optional"; + variant = "Anta Gorda - RS, Brazil"; + }; + + longitude = { + __type = "optional"; + variant = "-412.005691"; + }; + + pressure_units = { + __type = "enum"; + variant = "Hectopascal"; + }; + + speed_units = { + __type = "enum"; + variant = "KilometresPerHour"; + }; + + timefmt = { + __type = "enum"; + variant = "TwelveHr"; + }; + + units = { + __type = "enum"; + variant = "Fahrenheit"; + }; + }; +}