!XLCFfvFhUkYwOMLbVx:nixos.org

agenix

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

Load older messages


SenderMessageTime
23 Oct 2023
@mar.in:matrix.orgmarin
In reply to @gigahawk:matrix.org
for now I have the server exposing an SMB network share and I've just been transferring the encrypted secrets that way, but it's a little janky
in any case I believe you'll need nixos running on that server in order to have secrets decrypted by agenix on boot
15:11:54
@gigahawk:matrix.orggigahawkYea it's just annoying to have to ssh into it to create the secret, paste in the actual secret from my host, then transfer the files back to the host to commit to the repo15:29:48
@gigahawk:matrix.orggigahawkEasier to just create everything from the host and then pull it on the server side 15:30:19
@willpower3309:matrix.orgwillmckinnon
In reply to @gigahawk:matrix.org
Easier to just create everything from the host and then pull it on the server side
Have you looked into deploy-rs?
15:55:17
@gigahawk:matrix.orggigahawkYea I'm aware of the various deployment tools, but my setup isn't really that complicated and for now I still prefer just running nixos-rebuild on the machine I'm working on15:59:06
25 Oct 2023
@federicodschonborn:matrix.orgFederico Damián Schonborn changed their profile picture.00:13:16
26 Oct 2023
@jeroen:simonetti.nljeroen Question about agenix's homeManager module... does it work when there's a password on the key?
I am getting an error 'No matching keys found' in the launchd logging, even though I am able to edit the .age file using the supplied key from age.identityPaths
08:02:14
@k900:0upti.meK900 ⚡️No, how would it work then08:27:54
@charles:computer.surgeryCharles ⚡️ I finally switched to agenix today yesterday, I wrote a bunch of nix around it to automate setting all the age.secrets.<name>.files and I'm pretty happy with it: https://or.computer.surgery/charles/servy-fleet/-/commit/b01fc595fcf956fe462d2b57beaa0670a6163482 09:01:31
@charles:computer.surgeryCharles ⚡️ I wonder if this would be worth upstreaming? Maybe with some more configurability, since the secrets is a little hardcoded 09:02:26
@charles:computer.surgeryCharles ⚡️* I wonder if this would be worth upstreaming in some capacity? Maybe with some more configurability, since the secrets is a little hardcoded09:02:38
@charles:computer.surgeryCharles ⚡️* I wonder if this would be worth upstreaming in some capacity? Maybe with some more configurability, since the `secrets` directory is a little hardcoded09:02:56
@charles:computer.surgeryCharles ⚡️The only thing I miss is having an agent to avoid giving my password every time, which gets really bad when rekeying09:03:49
@charles:computer.surgeryCharles ⚡️
In reply to @charles:computer.surgery
I wonder if this would be worth upstreaming in some capacity? Maybe with some more configurability, since the secrets directory is a little hardcoded
In particular I mean the little NixOS module in flake.nix and the mkSecret and mkSecrets functions (mainly the latter, the former is mostly just implementation details) in secrets.nix
09:06:09
27 Oct 2023
@federicodschonborn:matrix.orgFederico Damián Schonborn changed their profile picture.01:24:47
29 Oct 2023
@charles:computer.surgeryCharles ⚡️

I stripped out the library functions to a standalone file so it's easier to steal:

  • https://or.computer.surgery/charles/servy-fleet/-/blob/60273f09fe0853a8d42ace9287878d4bbe08fae1/lib/secrets.nix

Here's how I use it:

  • https://or.computer.surgery/charles/servy-fleet/-/blob/60273f09fe0853a8d42ace9287878d4bbe08fae1/flake.nix#L77-78
  • https://or.computer.surgery/charles/servy-fleet/-/blob/60273f09fe0853a8d42ace9287878d4bbe08fae1/secrets.nix
04:07:43
@charles:computer.surgeryCharles ⚡️

why does this happen?

$ nix eval '.#nixosConfigurations.blue.config.age.secrets."garage/rpc".file'                                              /nix/store/5figp7jxkcwhw790j79p64533vl2d7pb-source/secrets/garage/rpc.age
$ git checkout HEAD^
$ nix eval '.#nixosConfigurations.blue.config.age.secrets."garage/rpc".file'                                              /nix/store/5p5zlykmcrbmyhik4xgxilng1h3xcqan-source/secrets/garage/rpc.age

the hashes are different but the contents of the file are the same

04:37:03
@charles:computer.surgeryCharles ⚡️ *

why does this happen?

$ nix eval '.#nixosConfigurations.blue.config.age.secrets."garage/rpc".file'
/nix/store/5figp7jxkcwhw790j79p64533vl2d7pb-source/secrets/garage/rpc.age
$ git checkout HEAD^
$ nix eval '.#nixosConfigurations.blue.config.age.secrets."garage/rpc".file'
/nix/store/5p5zlykmcrbmyhik4xgxilng1h3xcqan-source/secrets/garage/rpc.age

the hashes are different but the contents of the file are the same

04:37:33
@charles:computer.surgeryCharles ⚡️ the goal is to have a systemd restartTriggers for a service that uses an agenix secret, and this does work, but it restarts every time instead of just when it changes 04:38:43
@charles:computer.surgeryCharles ⚡️ maybe i should builtins.readFile it so the restartTriggers just has the ciphertext? 04:39:39
@charles:computer.surgeryCharles ⚡️no that doesn't work because the contents can't be a nix string04:42:07
@charles:computer.surgeryCharles ⚡️ builtins.hashFileing it worked 04:49:19
@jacekpoz:jacekpoz.pljacekpoz 11:13:09
@jacekpoz:jacekpoz.pljacekpoz 11:13:14
@jacekpoz:jacekpoz.pljacekpoz 11:58:31
@jacekpoz:jacekpoz.pljacekpoz 11:58:40
@jacekpoz:jacekpoz.pljacekpoz 13:45:23
@jacekpoz:jacekpoz.pljacekpoz 13:45:31
@jacekpoz:jacekpoz.pljacekpoz 17:43:51
@jacekpoz:jacekpoz.pljacekpoz 17:43:59

Show newer messages


Back to Room ListRoom Version: 6