From 19c7d4e29f4e696c77e6305041d29c55d379f464 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sat, 13 Mar 2021 04:20:00 +0000 Subject: [PATCH] nushell: use formats.toml to generate configuration --- modules/programs/nushell.nix | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/modules/programs/nushell.nix b/modules/programs/nushell.nix index 2dc6a0f67..1a53a71f4 100644 --- a/modules/programs/nushell.nix +++ b/modules/programs/nushell.nix @@ -6,16 +6,7 @@ let cfg = config.programs.nushell; - configFile = config: - pkgs.runCommand "config.toml" { - buildInputs = [ pkgs.remarshal ]; - preferLocalBuild = true; - allowSubstitutes = false; - } '' - remarshal -if json -of toml \ - < ${pkgs.writeText "config.json" (builtins.toJSON config)} \ - > $out - ''; + tomlFormat = pkgs.formats.toml { }; in { meta.maintainers = [ maintainers.Philipp-M ]; @@ -62,7 +53,8 @@ in { config = mkIf cfg.enable { home.packages = [ cfg.package ]; - xdg.configFile."nu/config.toml" = - mkIf (cfg.settings != { }) { source = configFile cfg.settings; }; + xdg.configFile."nu/config.toml" = mkIf (cfg.settings != { }) { + source = tomlFormat.generate "nushell-config" cfg.settings; + }; }; }