!XLCFfvFhUkYwOMLbVx:nixos.org

agenix

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

Load older messages


SenderMessageTime
12 Dec 2022
@id:ionode.netid changed their profile picture.05:03:28
14 Dec 2022
@fsx:matrix.org@fsx:matrix.org left the room.10:30:44
@nahfe:nahfe.xyzHerman changed their display name from NAHFE to Herman.10:53:57
@nahfe:nahfe.xyzHerman changed their display name from Herman to NAHFE.11:30:54
@nahfe:nahfe.xyzHerman changed their display name from NAHFE to Herman.11:33:02
@id:ionode.netid left the room.17:34:20
@id:ionode.netid joined the room.17:35:08
15 Dec 2022
@kraem:ne.bul.aekraem

hi, i can't seem to provision keys to a new system. getting this while switching to a new generation:

cp: cannot stat '/run/agenix/ssh_lb1_initrd_ed25519': No such file or directory
failed to create initrd secrets: No such file or directory

/run/agenix is empty as the generation hasn't been switched to, but it's needed to create the initrd secrets (if i understand correctly). is this a known issue? can't find it being discussed in the issues of the repo

21:54:47
@kraem:ne.bul.aekraem
sudo mkdir -p /run/agenix && sudo touch /run/agenix/ssh_lb1_initrd_ed25519 && switch_generation
# /run/agenix/1 and /run/agenix.d/1/ssh_lb1_initrd_ed25519 gets created
# but /run/agenix/ssh_lb1_initrd_ed25519 is still my empty file and i get the same error if switching generation after deleting it

note that i have no idea what i'm doing at this point 🙃

22:06:52
@kraem:ne.bul.aekraem ok i think i solved it by nix-collect-garbage -d && /run/current-system/bin/switch-to-configuration switch. it seems some old initrd secrets was the culprit? 22:44:53
16 Dec 2022
@ryantm:matrix.orgryantmI haven't really thought much about early boot secrets. What is this secret for?05:25:31
@kraem:ne.bul.aekraemthat particular secret is an ssh key used in initrd07:38:40
@kraem:ne.bul.aekraem it works sometimes after collecting garbage but still fails sometimes 07:40:06
17 Dec 2022
@dandellion:dodsorf.asDandellion joined the room.22:20:49
18 Dec 2022
@mlyx:matrix.orgmlyx joined the room.03:27:07
@dasj19:matrix.orgdasj19 joined the room.20:40:20
@dasj19:matrix.orgdasj19Hi, I am first time user of agenix and I am trying to get nixos to read user password file encrypted by agenix. In the code below the system can read the value of "description" just fine, but the value of passwordFile is not applied to the user account. Any advice is greatly appreciated. users.users.daniel = { isNormalUser = true; description = lib.strings.fileContents config.age.secrets.daniel-fullname.path; passwordFile = config.age.secrets.daniel-password.path; # Value created with mkpasswd. extraGroups = [ "networkmanager" "wheel" ]; }; 20:45:30
@ryantm:matrix.orgryantmDo you have the .file config option for that secret also specified?21:38:43
@ryantm:matrix.orgryantm dasj19: ☝️ 21:39:28
@dasj19:matrix.orgdasj19Yes, I tried with just the .file then I added owners and groups: age.secrets.daniel-fullname = { file = /etc/nixos/secrets/daniel-fullname.age; owner = "daniel"; group = "users"; }; age.secrets.daniel-password = { file = /etc/nixos/secrets/daniel-password.age; owner = "daniel"; group = "users"; };21:40:20
@ryantm:matrix.orgryantmWhat you are doing with description is an antipattern because it leaks the secret into the nix store and has bootstrapping issues.21:42:08
@dasj19:matrix.orgdasj19yes, i noticed but the goal there is just to hide it from a future git commit21:42:47
@ryantm:matrix.orgryantmOkay. I guess it's fine for that.21:43:10
@dasj19:matrix.orgdasj19the description part works, but just the passwordFile part does not21:43:44
@ryantm:matrix.orgryantmAre you using flakes?21:43:44
@ryantm:matrix.orgryantmAnd is your flake.nix in /etc?21:43:57
@dasj19:matrix.orgdasj19no, just plain configuration.nix21:44:09
@ryantm:matrix.orgryantmI don't think it matters but I think you can leave those secrets as owned by root since the user activation script runs as root.21:45:10
@ryantm:matrix.orgryantmDo you see any warnings during activation?21:45:34
@dasj19:matrix.orgdasj19okay, the secrets were owned by root to begin with, i changed them to see if it made a difference. no warnings during agenix generation change21:46:56

Show newer messages


Back to Room ListRoom Version: 6