fix(impermanence): copy over to persist when deploying

This commit is contained in:
Mohammad Rafiq 2025-03-30 07:50:21 +08:00
parent 9ee5317e6a
commit 03abee8b66
No known key found for this signature in database
2 changed files with 17 additions and 0 deletions

View file

@ -105,6 +105,21 @@
# Directories to persist between boots
fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist" = {
# Hide the mounts from showing up in the file manager.
hideMounts = true;
files = [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/machine-id"
];
users.rafiq = {
directories = [
"repos"
];
files = [
".config/sops/age/keys.txt"
".ssh/id_ed25519"
];
};
};
}

View file

@ -24,6 +24,8 @@ done
# Prepare temporary directory and copy necessary files
root=$(mktemp -d)
mkdir -p ${root}/persist
root=${root}/persist
sudo cp --verbose --archive --parents /etc/ssh/ssh_host_* ${root}
sudo cp --verbose --archive --parents ~/.ssh/id_ed25519 ${root}
sudo cp --verbose --archive --parents ~/.config/sops/age/keys.txt ${root}