Move the yaml functions to their own file.
This commit is contained in:
24
nix/kubernetes/functions/to_yaml.nix
Normal file
24
nix/kubernetes/functions/to_yaml.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
to_yaml_file =
|
||||
file_name: contents:
|
||||
let
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
yaml_file = settingsFormat.generate file_name contents;
|
||||
in
|
||||
yaml_file;
|
||||
to_yaml =
|
||||
file_name: contents:
|
||||
let
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
yaml_file = settingsFormat.generate file_name contents;
|
||||
yaml_content = builtins.readFile yaml_file;
|
||||
in
|
||||
yaml_content;
|
||||
in
|
||||
{
|
||||
inherit to_yaml to_yaml_file;
|
||||
}
|
||||
Reference in New Issue
Block a user