Files
NixOsConfig/pkgs/secret-from-file/default.nix
T

28 lines
600 B
Nix

# Encrypts a file as secrets/<name>.age for the recipients in secrets/secrets.nix.
# `nix` (to read secrets.nix) is taken from the system PATH.
{
lib,
writeShellApplication,
coreutils,
diffutils,
git,
jq,
age,
}:
writeShellApplication {
name = "secret-from-file";
runtimeInputs = [
coreutils
diffutils
git
jq
age
];
text = builtins.readFile ./secret-from-file.sh;
meta = {
description = "Encrypt an existing file as secrets/<name>.age using the agenix recipient rules";
mainProgram = "secret-from-file";
platforms = lib.platforms.linux;
};
}