diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-05-11 13:22:14 +0200 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-05-11 13:22:14 +0200 |
| commit | fd2002bd6af8ef88b04441af74dbfe46a2aded27 (patch) | |
| tree | fa0402f7b4b6cd79832299fe5aa560a3d2e03669 | |
| parent | 3cced353c4a44cc607e230bd96e793e4d9fdcb72 (diff) | |
Fixed ssh-key mounting and permission issues
| -rw-r--r-- | system/encryption.nix | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/system/encryption.nix b/system/encryption.nix index a3b60d4..441ad86 100644 --- a/system/encryption.nix +++ b/system/encryption.nix @@ -17,16 +17,25 @@ (writeShellScriptBin "keys-mount" '' sudo systemctl start systemd-cryptsetup@ssh\\x2dkeys.service sudo mount /mnt/ssh-keys - ssh-add /mnt/ssh-keys/* + # Add all of my ssh-keys on the usb + ssh-add /mnt/ssh-keys/poseidon '') (writeShellScriptBin "keys-umount" '' - ssh-add -d /mnt/ssh-keys/* + # Do the same here + ssh-add -d /mnt/ssh-keys/poseidon sudo umount /mnt/ssh-keys sudo systemctl stop systemd-cryptsetup@ssh\\x2dkeys.service '') ]; - systemd.tmpfiles.rules = [ - "d /mnt/ssh-keys 0770 root ssh-keys -" - ]; + systemd.services."ssh-keys-permissions" = { + wantedBy = ["multi-user.target"]; + after = ["dev-mapper-ssh\\x2dkeys.device"]; + script = '' + chown -R root:ssh-keys /mnt/ssh-keys + chmod 750 /mnt/ssh-keys + # And here + chmod 600 /mnt/ssh-keys/poseidon + ''; + }; } |
