let's try deploying the SSH host key declaratively so that we can decrypt the host key with the host key that we haven't decrypted yet– lis, since yesterday
--arg/--argstr, or you could use --impure and just read environment variables or arbitrary files, and sops even has exec-env and exec-file subcommands to do just that, but even then i'm pretty sure everything you pass this way ends up in some .drv> secret=meow nix build --impure --print-out-paths --expr '
derivation {
name = "foo";
system = builtins.currentSystem;
builder = "/bin/sh";
args = ["-c" "echo ${builtins.getEnv "secret"} > $out"];
}
'
> nix derivation show /nix/store/cywy0y5cb0njz975j0lrrh2m3ll29kqy-foo
{
"/nix/store/5axlc4wjy3s4v5xrk6c5db31y9kh6fi5-foo.drv": {
"args": [
"-c",
"echo meow > $out"
],
"builder": "/bin/sh",
"env": {
"builder": "/bin/sh",
"name": "foo",
"out": "/nix/store/cywy0y5cb0njz975j0lrrh2m3ll29kqy-foo",
"system": "x86_64-linux"
},
"inputDrvs": {},
"inputSrcs": [],
"name": "foo",
"outputs": {
"out": {
"path": "/nix/store/cywy0y5cb0njz975j0lrrh2m3ll29kqy-foo"
}
},
"system": "x86_64-linux"
}
}--impure is a few extra builtinsreadFile for arbitrary files, fetchurl and friends without hashes, and currentSystem/currentTime