1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-25 07:58:31 +02:00

broot: use formats.toml to generate configuration

This commit is contained in:
Mario Rodas 2021-03-13 04:20:00 +00:00
parent 19c7d4e29f
commit 42bb553544

View File

@ -6,16 +6,7 @@ let
cfg = config.programs.broot;
configFile = config:
pkgs.runCommand "conf.toml" {
buildInputs = [ pkgs.remarshal ];
preferLocalBuild = true;
allowSubstitutes = false;
} ''
remarshal -if json -of toml \
< ${pkgs.writeText "verbs.json" (builtins.toJSON config)} \
> $out
'';
tomlFormat = pkgs.formats.toml { };
brootConf = {
verbs = cfg.verbs;
@ -194,7 +185,8 @@ in {
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."broot/conf.toml".source = configFile brootConf;
xdg.configFile."broot/conf.toml".source =
tomlFormat.generate "broot-config" brootConf;
# Dummy file to prevent broot from trying to reinstall itself
xdg.configFile."broot/launcher/installed-v1".text = "";