mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-11-02 18:39:24 +00:00
add PoC base64 functions
This commit is contained in:
parent
2e05efff6d
commit
eb578f67be
2 changed files with 16 additions and 0 deletions
|
@ -34,6 +34,7 @@
|
|||
nixpkgs.legacyPackages.${system}.nixpkgs-fmt);
|
||||
|
||||
lib = {
|
||||
base64 = import lib/base64.nix;
|
||||
gen-ssh-config = import lib/gen-ssh-config.nix lib;
|
||||
ssh-keys = import lib/ssh-keys.nix;
|
||||
|
||||
|
|
15
lib/base64.nix
Normal file
15
lib/base64.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ 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}
|
||||
'');
|
||||
|
||||
}
|
Loading…
Reference in a new issue