!XLCFfvFhUkYwOMLbVx:nixos.org

agenix

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

Load older messages


SenderMessageTime
17 Apr 2025
@oneeyed:matrix.orgSam changed their display name from Sam to Sam (away → 5/5).17:17:41
18 Apr 2025
@saik3617:matrix.orgSaik joined the room.16:20:15
@saik3617:matrix.orgSaik

Hello, heres a simple question that I've had a hard time finding an answer to:

is there a way to have a subfolder within secrets/?

I prefer subfoldering--category/secret_name.age--over appending--category.secret_name.age

16:22:34
@eyjhb:eyjhb.dkeyJhb
In reply to @saik3617:matrix.org

Hello, heres a simple question that I've had a hard time finding an answer to:

is there a way to have a subfolder within secrets/?

I prefer subfoldering--category/secret_name.age--over appending--category.secret_name.age

Yes, just create it and use it
16:32:18
@eyjhb:eyjhb.dkeyJhb @Saik https://git.fricloud.dk/fricloud/server-configs/src/branch/main/secrets/secrets.nix#L20 16:33:01
@eyjhb:eyjhb.dkeyJhbAnd then I use it like this https://git.fricloud.dk/fricloud/server-configs/src/branch/main/secrets/default.nix#L616:33:27
@eyjhb:eyjhb.dkeyJhbYou can see all the secrets in that folder as well.16:33:48
@saik3617:matrix.orgSaikThanks!17:08:32
@saik3617:matrix.orgSaik

Additionally, is there a way to modularize an environment file?

Something like

virtualisation.oci-containers.containers.postgres = {
  environmentFiles = [
    # Dynamically building an env file, which contains POSTGRES_PASSWORD=<contents of postgres-password.age>
    config.age.buildEnvFile "POSTGRES_PASSWORD" config.age.secrets.postgres-password.path
  ];
};
# then, i can construct a different envFile:
virtualisation.oci-containers.containers.grafana = {
  environmentFile = [
    # Note that the same value is being used, but is named something else, DATABASE_PASS
    # This prevents me needing two `.age` files for the same value.
    config.age.buildEnvFile "DATABASE_PASS" config.age.secrets.postgres-password.path
  ];
};
17:17:16
@eyjhb:eyjhb.dkeyJhbI'll try to take a look once I'm at my PC again. Hard to see code formatting on the phone :)17:47:05
@eyjhb:eyjhb.dkeyJhbI guess in theory you could MAKE something that does that, but I don't think it's currently possible. I want that as well for some of the things I have.. Because I specify them in a .env file, to make it work for the given application, but at the same time, I have a single file for specifying it elsewere. My usecase is e.g. creating a LDAP user which allows a given user to send emails, and then using that LDAP user in a given service to send welcome emails.18:13:54
@eyjhb:eyjhb.dkeyJhb It could actually be fun to implement, but right now, sorry to disappoint Saik , I don't think it's possible. Or at least, not easily 18:14:47
@eyjhb:eyjhb.dkeyJhbI have a sneaking suspicion that I did something akin to this, but not really in any good way, that makes any sense to use. 18:15:08
20 Apr 2025
@hazelsudz:matrix.orghazel joined the room.02:42:04
@hazelsudz:matrix.orghazel changed their display name from Hazel Sudzilouski to hazel.04:04:14
@brunkeltje:matrix.orgbrunkeltje joined the room.13:10:52
21 Apr 2025
@bastien_m:matrix.orgBastienM joined the room.14:20:45
@wesleyjrz:matrix.orgwesleyjrz changed their profile picture.17:48:30
@wesleyjrz:matrix.orgwesleyjrz left the room.17:56:11
@wesleyjrz:matrix.orgwesleyjrz joined the room.17:56:44
24 Apr 2025
@k900:0upti.meK900 @ryantm can I get a merge on https://github.com/ryantm/agenix/pull/324 12:05:22
@k900:0upti.meK900OK took a bit of bashing12:22:13
@k900:0upti.meK900But it should be fine now12:22:16
@tebriel:frodux.nettebriel joined the room.18:24:27
@jon-zuka:matrix.orgJon Zuka joined the room.19:01:37
@jon-zuka:matrix.orgJon Zukahello, where do i create the secrets folder?19:54:51
25 Apr 2025
@mynacol:mynacol.xyz@mynacol:mynacol.xyz Hello everyone, I just tried to create a secret where the filename starts with a dash (-) for reasons, but that unfortunately doesn't work. The relevant error message is basename: invalid option -- 'd'. Is there a known workaround? 20:19:14
@eyjhb:eyjhb.dkeyJhb
In reply to @mynacol:mynacol.xyz
Hello everyone, I just tried to create a secret where the filename starts with a dash (-) for reasons, but that unfortunately doesn't work. The relevant error message is basename: invalid option -- 'd'. Is there a known workaround?
Making a file without a dash at the start! /s - But most likely its something that should be fixed in the code/module. It shouldn't treat filenames with dashes at the start like arguments. Can you create an issue for it?
21:07:44
@mynacol:mynacol.xyz@mynacol:mynacol.xyzI actually got to the bottom of it: https://github.com/ryantm/agenix/issues/32521:25:56
@eyjhb:eyjhb.dkeyJhb I think most of these places should just have e.g. basename -- "$FILE" instead, and it would be solved. Still no clue why you want files to begin with a dash :p 21:27:44

Show newer messages


Back to Room ListRoom Version: 6