mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
broot: use formats.toml to generate configuration
This commit is contained in:
parent
19c7d4e29f
commit
42bb553544
1 changed files with 3 additions and 11 deletions
|
@ -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 = "";
|
||||
|
|
Loading…
Reference in a new issue