mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-31 04:04:32 +00:00
broot: avoid IFD
This commit is contained in:
parent
b14a70c40f
commit
13fbbe382f
2 changed files with 9 additions and 16 deletions
|
@ -6,10 +6,10 @@ let
|
|||
|
||||
cfg = config.programs.broot;
|
||||
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
jsonFormat = pkgs.formats.json { };
|
||||
|
||||
settingsModule = {
|
||||
freeformType = tomlFormat.type;
|
||||
freeformType = jsonFormat.type;
|
||||
|
||||
options = {
|
||||
modal = mkEnableOption "modal (vim) mode";
|
||||
|
@ -194,24 +194,17 @@ in {
|
|||
# Dummy file to prevent broot from trying to reinstall itself
|
||||
(pkgs.writeTextDir "launcher/installed-v1" "")
|
||||
];
|
||||
|
||||
postBuild = ''
|
||||
ln -s ${
|
||||
tomlFormat.generate "broot-config" cfg.settings
|
||||
} $out/conf.toml
|
||||
|
||||
# Remove conf.hjson, whose content has been merged into programs.broot.settings
|
||||
rm $out/conf.hjson
|
||||
${lib.getExe pkgs.jq} --slurp add > $out/conf.hjson \
|
||||
<(${
|
||||
lib.getExe pkgs.hjson-go
|
||||
} -c ${cfg.package.src}/resources/default-conf/conf.hjson) \
|
||||
${jsonFormat.generate "broot-config.json" cfg.settings}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
programs.broot.settings = builtins.fromJSON (builtins.readFile
|
||||
(pkgs.runCommand "default-conf.json" {
|
||||
nativeBuildInputs = [ pkgs.hjson-go ];
|
||||
}
|
||||
"hjson-cli -c ${cfg.package.src}/resources/default-conf/conf.hjson > $out"));
|
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration (shellInit "bash");
|
||||
|
||||
programs.zsh.initContent = mkIf cfg.enableZshIntegration (shellInit "zsh");
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
nixpkgs.overlays = [ (self: super: { inherit (realPkgs) broot hjson-go; }) ];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/broot/conf.toml
|
||||
assertFileContains home-files/.config/broot/conf.toml 'modal = true'
|
||||
assertFileExists home-files/.config/broot/conf.hjson
|
||||
assertFileContains home-files/.config/broot/conf.hjson '"modal": true'
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue