nixos-config/lib/base64.nix

16 lines
322 B
Nix
Raw Normal View History

2024-08-15 23:12:56 +00:00
{ 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}
'');
}