diff options
Diffstat (limited to 'system')
| -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 + ''; + }; } |
