alacritty.yaml should now work

yaml
pegasust 2022-12-06 04:29:26 +00:00
parent a67f121381
commit d4834a446c
1 changed files with 8 additions and 8 deletions

View File

@ -31,16 +31,16 @@ let
# TODO: put this in a seperate library
# callPackage supports both PATH and function as first param!
# TODO: support yaml string with writeTextFile (provided by callPackge)
yamlToJsonDrv = yamlPath: outputPath:
pkgs.callPackage ({ runCommand }:
yamlToJsonDrv = yamlContent: outputPath: pkgs.callPackage ({ runCommand }:
# runCommand source: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix#L33
runCommand
outputPath
{ nativeBuildInputs = [ pkgs.yq ]; }
runCommand outputPath { inherit yamlContent; nativeBuildInputs = [ pkgs.yq ]; }
# run yq which outputs '.' (no filter) on file at yamlPath
# note that $out is passed onto the bash/sh script for execution
''cat \"${yamlPath}\" | yq >\"$out\"'') { };
fromYaml = yamlPath: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlPath "any-output.json"));
''
echo "$yamlContent" | yq >$out
'') { };
# fromYamlPath = yamlPath: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlPath "any-output.json"));
fromYaml = yamlContent: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlContent "any_output.json"));
in
{
home = {
@ -86,7 +86,7 @@ in
programs.alacritty = myHome.programs.alacritty or {
enable = true;
# settings = myLib.fromYaml (builtins.readFile "${proj_root}/alacritty/alacritty.yml");
settings = fromYaml "${proj_root}//alacritty/alacritty.yml";
settings = fromYaml (builtins.readFile "${proj_root}//alacritty/alacritty.yml");
};
# nix: Propagates the environment with packages and vars when enter (children of)
# a directory with shell.nix-compatible and .envrc