Skip to content

Commit

Permalink
mangohud: make false values actually disable
Browse files Browse the repository at this point in the history
Currently the following, will produces `some_opt=false` in the
rendered config:

```nix
programs.mangohud.settings = {
  some_opt = false;
};
```

With the intention being to disable the option, this would be
incorrect, as per the following stated at:
<https://github.com/flightlessmango/MangoHud/blob/0575c8eb1f61692a2e5ca152c4f8ed70bef55ee2/data/MangoHud.conf#L3C5-L4C1>

> Use some_parameter=0 to disable a parameter (only works with on/off
> parameters)

As such, I changed the rendering to follow this.
This will be output instead: `some_opt=0`
  • Loading branch information
sebaszv committed Jan 10, 2025
1 parent d4aebb9 commit 07ff4e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/programs/mangohud.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let
int = toString option;
float = int;
path = int;
bool = "false";
bool = "0"; # "on/off" opts are disabled with `=0`
string = option;
list = concatStringsSep "," (lists.forEach option (x: toString x));
}.${builtins.typeOf option};
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/programs/mangohud/basic-configuration.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cpu_stats
cpu_temp
cpu_text=CPU
fps_limit=30,60
legacy_layout=false
legacy_layout=0
media_player_name=spotify
media_player_order=title,artist,album
output_folder=/home/user/Documents/mangohud
Expand Down

0 comments on commit 07ff4e0

Please sign in to comment.