Skip to content

Instantly share code, notes, and snippets.

@lovesegfault
Created June 4, 2020 22:10
Show Gist options
  • Save lovesegfault/da3563c8ca5de65e7c14895146b57f9e to your computer and use it in GitHub Desktop.
Save lovesegfault/da3563c8ca5de65e7c14895146b57f9e to your computer and use it in GitHub Desktop.
self: super:
with builtins; with self.lib;
{
mkSecret = { ... }@args:
let
name = baseNameOf (toString args.file);
stub = toFile name "This is a stub!\n";
file =
if pathExists args.file then
args.file
else
self.lib.warn "Using stub for secrets/${name}" stub;
in
args // { inherit file; };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment