!XLCFfvFhUkYwOMLbVx:nixos.org

agenix

353 Members
age-encrypted secrets for NixOS https://github.com/ryantm/agenix/90 Servers

Load older messages


SenderMessageTime
3 Sep 2025
@ed209a:matrix.orged209 joined the room.19:18:26
@ed209a:matrix.orged209 I'm looking for ways to store build-time secrets using agenix, but it seems to be a bit tricky to do. is there an easy way to (potentially imperitively) decrypted a subset of secrets so they're available on the system before deploying/building images? 19:21:04
@k900:0upti.meK900Build-time secrets are basically always bad19:22:46
@k900:0upti.meK900Why do you want that?19:22:52
@ed209a:matrix.orged209 i should say deploy time... like how else do you give luks the key to use when provisioning a system? 19:23:26
@k900:0upti.meK900Can you explain what you're actually trying to do?19:23:46
@ed209a:matrix.orged209 the main use case is using nixos-anywhere to provision a system with luks 19:25:38
@ed209a:matrix.orged209 * the main use case is using nixos-anywhere to provision a system with luks (using disko) 19:26:16
@ed209a:matrix.orged209 * the main use case is using nixos-anywhere to provision a system with luks (using disko) 19:26:27
@ed209a:matrix.orged209I'm certainly open to a better way. the secret is only needed when creating the luks volume, and then is unecessary/not stored19:27:16
@k900:0upti.meK900I feel like this is a nixos-anywhere problem19:27:47
@k900:0upti.meK900As in, the key should be provisioned by nixos-anywhere19:27:54
@k900:0upti.meK900Because it's what's doing the installing19:28:03
@k900:0upti.meK900 I don't know if it can actually do that 19:28:14
@k900:0upti.meK900But I know it is too early for agenix to do anything19:28:25
@ed209a:matrix.orged209
In reply to @k900:0upti.me
I don't know if it can actually do that
there is a mechanism for this
19:28:25
@k900:0upti.meK900(and same for other agenix shaped tools)19:28:41
@ed209a:matrix.orged209 found it, its --disk-encryption-keys... I guess I can manually decrypt secrets but would be cool if you could have it automatically done during deployment 19:30:52
@ed209a:matrix.orged209 * found it, its --disk-encryption-keys is the nixos-anywhere flag... I guess I can manually decrypt secrets but would be cool if you could have it automatically done during deployment 19:33:43
4 Sep 2025
@curious_cuttlefish:matrix.orgcurious_cuttlefish joined the room.04:41:16
8 Sep 2025
@inayet:matrix.orgInayet set a profile picture.02:15:48
@ed209a:matrix.orged209 is it just me, or is deploying secrets in nixos-install (not sure if it matters but I'm technically doing disko-install) not possible? 12:18:33
@ed209a:matrix.orged209

error msg:

decrypting '/nix/store/9hypanvdrbg77832x73c2j9cx8543gva-source/password.age' to '/run/agenix.d/1/password'...
age: error: tpm plugin: couldn't start plugin: chdir /mnt/disko-install-root/tmp.gzeSgr8SI6: no such file or directory
age: report unexpected or unhelpful errors at https://filippo.io/age/report
chmod: cannot access '/run/agenix.d/1/password.tmp': No such file or directory
mv: cannot stat '/run/agenix.d/1/password.tmp': No such file or directory
[agenix] symlinking new secrets to /run/agenix (generation 1)...
Activation script snippet 'agenixInstall' failed (1)
warning: password file ‘/run/agenix/password’ does not exist
[agenix] chowning...
chown: cannot access '/run/agenix.d/1/password': No such file or directory
Activation script snippet 'agenixChown' failed (1)
12:37:35
@eyjhb:eyjhb.dkeyJhbBut, isn't the secrets just part of the config? So they should be copied to the store, and then decrypted on activation12:37:49
@eyjhb:eyjhb.dkeyJhb Haven't seen that error before however 12:38:30
@ed209a:matrix.orged209 it does work if i say, install w/ temp password and then do nixos-rebuild switch 12:39:07
@ed209a:matrix.orged209also maybe I should try rebooting and see if its safe to ignore that error 😅12:42:20
@ed209a:matrix.orged209yeah, i don't get it... but it doesn't seem to decrypt on reboot22:20:59
@ed209a:matrix.orged209but if I run 'nixos-rebuilt switch` it works fine22:26:19
9 Sep 2025
@ed209a:matrix.orged209 so I'm actually starting to think the issue is age-yubikey-tpm. works when I do nixos-rebuilt switch but not on boot etc, get a very similar error message 10:30:38

Show newer messages


Back to Room ListRoom Version: 6