Skip to content

Commit

Permalink
feat(applications): add Forecast module
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorAugustoLN committed Feb 1, 2025
1 parent 446afcd commit c0e70a2
Showing 1 changed file with 158 additions and 0 deletions.
158 changes: 158 additions & 0 deletions modules/applications/by-name/forecast/default.nix
Original file line number Diff line number Diff line change
@@ -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";
};
};
}

0 comments on commit c0e70a2

Please sign in to comment.