mirror of
https://github.com/nix-community/home-manager
synced 2024-12-02 16:09:46 +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;
|
cfg = config.programs.broot;
|
||||||
|
|
||||||
configFile = config:
|
tomlFormat = pkgs.formats.toml { };
|
||||||
pkgs.runCommand "conf.toml" {
|
|
||||||
buildInputs = [ pkgs.remarshal ];
|
|
||||||
preferLocalBuild = true;
|
|
||||||
allowSubstitutes = false;
|
|
||||||
} ''
|
|
||||||
remarshal -if json -of toml \
|
|
||||||
< ${pkgs.writeText "verbs.json" (builtins.toJSON config)} \
|
|
||||||
> $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
brootConf = {
|
brootConf = {
|
||||||
verbs = cfg.verbs;
|
verbs = cfg.verbs;
|
||||||
|
@ -194,7 +185,8 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
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
|
# Dummy file to prevent broot from trying to reinstall itself
|
||||||
xdg.configFile."broot/launcher/installed-v1".text = "";
|
xdg.configFile."broot/launcher/installed-v1".text = "";
|
||||||
|
|
Loading…
Reference in a new issue