nixos-config/lib/base64.nix
2024-08-15 19:15:37 -04:00

15 lines
322 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}
'');
}