Move the yaml functions to their own file.

This commit is contained in:
Tom Alexander 2025-12-27 21:15:00 -05:00 committed by Tom Alexander
parent 2c5acd15df
commit e9a8f78342
Signed by: talexander
GPG Key ID: 36C99E8B3C39D85F
2 changed files with 25 additions and 17 deletions

View 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;
}

View File

@ -8,29 +8,13 @@
# installCheckPhase # installCheckPhase
# distPhase # distPhase
{ {
lib,
pkgs, pkgs,
stdenv, stdenv,
runCommand, runCommand,
writeText,
... ...
}: }:
let let
to_yaml_file = to_yaml_file = ((import ../../../functions/to_yaml.nix) {inherit pkgs;}).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;
kube_encryption_key = runCommand "kube_encryption_key" { } '' kube_encryption_key = runCommand "kube_encryption_key" { } ''
head -c 32 /dev/urandom | base64 | tee $out head -c 32 /dev/urandom | base64 | tee $out
''; '';