!XLCFfvFhUkYwOMLbVx:nixos.org

agenix

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

Load older messages


SenderMessageTime
11 Aug 2023
@ryantm:matrix.orgryantmNo secrets.nix is only for the agenix cli tool.00:46:17
@metasyntactical:matrix.orgmetasyntacticalI grabbed the /etc/ssh/ pubkeys from all of the boxes in my config00:46:18
@metasyntactical:matrix.orgmetasyntacticalcould it be some flakes scoping thing? I declared the age module in the top level flake and then my config using age is in another module -- could that cause it?00:47:15
@ryantm:matrix.orgryantmShouldn't be a problem.00:47:48
@metasyntactical:matrix.orgmetasyntacticalalso, will agenix require --impure always?00:47:53
@ryantm:matrix.orgryantmAgenix doesn't require impure00:48:08
@metasyntactical:matrix.orgmetasyntactical

okay. so in ./machines/theseus.nix I add the line below

age.secrets.wg-theseus-home-privkey.file = ./secrets/wg-theseus-home-privkey.age;

and I get the error:

error:
       Failed assertions:
       - age.identityPaths must be set.
(use '--show-trace' to show detailed location information)
00:50:08
@metasyntactical:matrix.orgmetasyntacticalshould I run it with --show-trace for you?00:50:23
@metasyntactical:matrix.orgmetasyntacticalor maybe try to poke at something in the repl?00:52:53
@metasyntactical:matrix.orgmetasyntactical
ssh_config  ssh_host_ed25519_key  ssh_host_ed25519_key.pub  ssh_host_rsa_key  ssh_host_rsa_key.pub  ssh_known_hosts
00:53:03
@ryantm:matrix.orgryantmSomething is going wrong here https://github.com/ryantm/agenix/blob/d8c973fd228949736dedf61b7f8cc1ece3236792/modules/age.nix#L22900:53:08
@ryantm:matrix.orgryantmYou could load your flake into the Repl and confirm the openssh service is enabled...00:55:51
@metasyntactical:matrix.orgmetasyntacticalif I call "nix repl --file flake.nix" how do I poke at the config for a system defined by it?00:59:56
@metasyntactical:matrix.orgmetasyntactical
connelly@theseus:/etc/nixos]$ nix repl --file flake.nix
Welcome to Nix 2.13.3. Type :? for help.

Loading installable ''...
Added 3 variables.
nix-repl> outputs.nixConfigurations.theseus
error: value is a function while a set was expected

       at «string»:1:1:

            1| outputs.nixConfigurations.theseus
             | ^

nix-repl> 
01:01:36
@metasyntactical:matrix.orgmetasyntactical

got it. :lf /etc/nixos did the trick.... here's those variables:

nix-repl> builtins.elemAt outputs.nixosConfigurations.theseus.config.services.openssh.hostKeys 0
{ bits = 4096; path = "/etc/ssh/ssh_host_rsa_key"; type = "rsa"; }

nix-repl> builtins.elemAt outputs.nixosConfigurations.theseus.config.services.openssh.hostKeys 1
{ path = "/etc/ssh/ssh_host_ed25519_key"; type = "ed25519"; }
01:06:31
@metasyntactical:matrix.orgmetasyntacticaland I confirmed those files exist01:07:15
@metasyntactical:matrix.orgmetasyntactical

and also of note in that flake:

nix-repl> outputs.nixosConfigurations.theseus.config.age.identityPaths
[ ]

01:09:05
@metasyntactical:matrix.orgmetasyntactical

and if I look at this, I think that's notable:

ix-repl> outputs.nixosConfigurations.theseus.options.age.identityPaths.default
[ ]
01:13:02
@metasyntactical:matrix.orgmetasyntactical

Oh shit, it looks like on my laptop, even though I had at one time, I am no longer running openssh.... just like you said...

nix-repl> outputs.nixosConfigurations.theseus.config.services.openssh.enable
false
01:14:52
@ryantm:matrix.orgryantmAh ha!01:17:45
@metasyntactical:matrix.orgmetasyntacticalthat fixed it. sorry to bother. I appreciate the help.01:37:19
12 Aug 2023
@mokasin:mokasin.deFabian left the room.18:09:57
13 Aug 2023
@10leej:matrix.orgnevoyu joined the room.01:24:59
15 Aug 2023
@cafkafk:nixos.devChristina Sørensen changed their profile picture.14:57:52
@10leej:matrix.orgnevoyu left the room.19:34:13
17 Aug 2023
@evalexpr:matrix.orgevalexpr joined the room.14:18:44
@evalexpr:matrix.orgevalexpro/ Is it possible to run/use agenix on a linux (non-NixOS) system without openssh invoked via home-manager being used as a module? I'm running into a bunch of roadblocks and struggling to make it work - if the above is a valid use-case I can provide some more info, ty14:23:07
@evalexpr:matrix.orgevalexpr It "mostly" works but I seem to have to run systemctl start --user agenix for it to actually make the file 🤔 14:50:36
18 Aug 2023
@zooter9:matrix.orgzooter9 joined the room.10:43:01
21 Aug 2023
@ryantm:matrix.orgryantmYeah, I think openssh is not a hard requirement, you can use some other identity to decrypt the secrets.18:11:16

Show newer messages


Back to Room ListRoom Version: 6