!XLCFfvFhUkYwOMLbVx:nixos.org

agenix

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

Load older messages


SenderMessageTime
18 Dec 2022
@dasj19:matrix.orgdasj19do you want to take a look? i can post on pastebin or something22:30:38
@ryantm:matrix.orgryantmLooks like there is some json file that gets made https://github.com/NixOS/nixpkgs/blob/ba46d30d1f9a636f46fb7877008140984f5e7b75/nixos/modules/config/update-users-groups.pl#LL88C12-L88C4522:30:42
@ryantm:matrix.orgryantmThat the Perl script reads.22:30:48
@ryantm:matrix.orgryantmIt would be interesting to know if that script contains the /run/agenix/... path22:31:09
@dasj19:matrix.orgdasj19in the perl script?22:32:25
@ryantm:matrix.orgryantm It's called users-groups.json. Maybe you can find it with ls /nix/store/*users-groups.json 22:33:02
@ryantm:matrix.orgryantm {"autoSubUidGidRange":true,"createHome":true,"description":"Ryan Mulligan","group":"users","hashedPassword":null,"home":"/home/ryantm","homeMode":"700","initialHashedPassword":null,"initialPassword":null,"isSystemUser":false,"name":"ryantm","password":null,"passwordFile":"/run/agenix/passwordfile-ryantm","shell":"/run/current-system/sw/bin/bash","subGidRanges":[],"subUidRanges":[],"uid":null} 22:34:07
@dasj19:matrix.orgdasj19yes, found it... and it has: {"autoSubUidGidRange":true,"createHome":true,"description":"Daniel AAA","group":"users","hashedPassword":null,"home":"/home/daniel","homeMode":"700","initialHashedPassword":null,"initialPassword":null,"isSystemUser":false,"name":"daniel","password":null,"passwordFile":"/run/agenix/daniel-password","shell":"/run/current-system/sw/bin/bash","subGidRanges":[],"subUidRanges":[],"uid":null}22:34:31
@ryantm:matrix.orgryantmlooks the same as mine. bizarre.22:35:18
@dasj19:matrix.orgdasj19i'll try one more thing .. I run on nixpkgs from 5. of december... i can try to update on a newer version22:36:28
@dasj19:matrix.orgdasj19i run on the unstable branch22:36:39
@ryantm:matrix.orgryantm
system.activationScripts.debug.{ text = "set -x; echo "DEBUG PASSWORDFILE";cat /run/agenix/daniel-password"; deps = "agenixInstall"; }
system.activationScripts.users.deps = [ "debug" ];
22:37:58
@ryantm:matrix.orgryantm *
system.activationScripts.debug = { text = "set -x; echo "DEBUG PASSWORDFILE";cat /run/agenix/daniel-password"; deps = "agenixInstall"; }
system.activationScripts.users.deps = [ "debug" ];
22:38:12
@dasj19:matrix.orgdasj19ok, i'll give that a try22:38:23
@ryantm:matrix.orgryantmThat should cat your password file after agenix installs it but before the users script runs.22:38:39
@dasj19:matrix.orgdasj19 had to fix a semicolon and change quotes to single quotes:
but still get: error: A definition for option system.activationScripts.debug.deps' is not of type list of string'. Definition values:
- In `/etc/nixos/configuration.nix': "agenixInstall"
22:41:38
@ryantm:matrix.orgryantm *
system.activationScripts.debug = { text = "set -x; echo 'DEBUG PASSWORDFILE';cat /run/agenix/daniel-password"; deps = [ "agenixInstall" ]; }
system.activationScripts.users.deps = [ "debug" ];
22:42:12
@ryantm:matrix.orgryantmThanks, I fixed it above too.22:42:18
@ryantm:matrix.orgryantm *
system.activationScripts.debug = { text = "set -x; echo 'DEBUG PASSWORDFILE';cat /run/agenix/daniel-password"; deps = [ "agenixInstall" ]; };
system.activationScripts.users.deps = [ "debug" ];
22:42:30
@dasj19:matrix.orgdasj19

this is in the result:

  • echo 'DEBUG PASSWORDFILE'
    DEBUG PASSWORDFILE
  • cat /run/agenix/daniel-password
    $6$HgyUnbDcnnfRn4Ox$Ttzd6kxqrt2ZoutO.kfEXWzc4zCDCXYwHKN5X4NyB/scHOrWKoYbHQhuxtjI1tq8BRHn5Avxcgim5FHoNv90R1+ (( _localstatus > 0 ))
22:43:59
@dasj19:matrix.orgdasj19so the secret gets decrypted correctly but does not end in the /etc/shadow22:45:13
@dasj19:matrix.orgdasj19I am doing a system update and see if the issue persists22:47:08
@ryantm:matrix.orgryantmok, seems like everything is working...22:47:26
@dasj19:matrix.orgdasj19system update did not help, i'll try on another system tomorrow, can't think of anything else i can try22:51:14
@ryantm:matrix.orgryantmdasj19: aside from editing the perl script, me neither.22:51:37
@dasj19:matrix.orgdasj19ok, but you can confirm that the current way of doing it is the right approach22:52:44
@dasj19:matrix.orgdasj19thanks a lot for assistance, i have to go to bed soon22:53:58
@ryantm:matrix.orgryantmYes.22:58:49
@ryantm:matrix.orgryantmOf course I can't see your whole configuration files, so there might be something obviously bad lurking.22:59:13
19 Dec 2022
@lgcl:lgcl.delgcl (they/them) changed their profile picture.13:45:44

Show newer messages


Back to Room ListRoom Version: 6