nixos-config/lib/base64.nix
2024-11-07 23:26:04 -05:00

20 lines
342 B
Nix

{ runCommand }:
{
b64decode =
input:
builtins.readFile (
runCommand "b64decode" { } ''
base64 -d >$out <${builtins.toFile "input" input}
''
);
b64encode =
input:
builtins.readFile (
runCommand "b64encode" { } ''
base64 -w0 >$out <${builtins.toFile "input" input}
''
);
}