Skip to content

Commit

Permalink
Merge pull request #233 from yechielw/patch-1
Browse files Browse the repository at this point in the history
fix[home-manager]: update json to toml
  • Loading branch information
abenz1267 authored Jan 20, 2025
2 parents bb584ea + 93ea127 commit 1f80b10
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions nix/hm-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ self: {
pkgs,
...
}: let
inherit (lib) mkEnableOption mkOption mkPackageOption importJSON mkIf getExe mkForce mkMerge;
inherit (lib) mkEnableOption mkOption mkPackageOption importTOML mkIf getExe mkForce mkMerge;
inherit (lib.types) bool nullOr submodule lines;

jsonFormat = pkgs.formats.json {};
tomlFormat = pkgs.formats.toml {};

themeType = submodule {
options = {
layout = mkOption {
inherit (jsonFormat) type;
inherit (tomlFormat) type;
default = {};
description = ''
The layout of the theme.
Expand Down Expand Up @@ -47,10 +47,10 @@ in {
};

config = mkOption {
inherit (jsonFormat) type;
default = importJSON ../internal/config/config.default.json;
inherit (tomlFormat) type;
default = importTOML ../internal/config/config.default.toml;
description = ''
Configuration written to `$XDG_CONFIG_HOME/walker/config.json`.
Configuration written to `$XDG_CONFIG_HOME/walker/config.toml`.
See <https://github.com/abenz1267/walker/wiki/Basic-Configuration> for the full list of options.
'';
Expand All @@ -68,7 +68,7 @@ in {
{
home.packages = [cfg.package];

xdg.configFile."walker/config.json".source = mkIf (cfg.config != {}) (jsonFormat.generate "walker-config.json" cfg.config);
xdg.configFile."walker/config.toml".source = mkIf (cfg.config != {}) (tomlFormat.generate "walker-config.toml" cfg.config);

systemd.user.services.walker = mkIf cfg.runAsService {
Unit.Description = "Walker - Application Runner";
Expand All @@ -84,7 +84,7 @@ in {
programs.walker.config.theme = mkForce themeName;

xdg.configFile = {
"walker/themes/${themeName}.json".source = jsonFormat.generate "walker-themes-${themeName}.json" cfg.theme.layout;
"walker/themes/${themeName}.toml".source = tomlFormat.generate "walker-themes-${themeName}.toml" cfg.theme.layout;
"walker/themes/${themeName}.css".text = cfg.theme.style;
};
})
Expand Down

0 comments on commit 1f80b10

Please sign in to comment.