Fixed secrets. Try to fix disks mount
This commit is contained in:
@@ -301,20 +301,6 @@ files_generation() {
|
||||
cp -avu templates/nix-config/flake.nix final-nix-config/etc/nixos/
|
||||
cp -avu templates/nix-config/misc/* final-nix-config/etc/nixos/misc/
|
||||
|
||||
echo -e "\n✅ Generating sops-nix keys..."
|
||||
ssh-to-age -private-key -i final-nix-config/home/numbus-admin/.ssh/id_ed25519 > final-nix-config/var/lib/sops-nix/key.txt
|
||||
export SOPS_PUBLIC_KEY=$(age-keygen -y final-nix-config/var/lib/sops-nix/key.txt)
|
||||
|
||||
echo -e "\n✅ Generating sops-nix configuration files..."
|
||||
envsubst < templates/nix-config/sops-nix/.sops.yaml > final-nix-config/etc/nixos/.sops.yaml
|
||||
|
||||
echo -e "\n✅ Encrypting secrets in the correct file..."
|
||||
envsubst < "templates/nix-config/sops-nix/secrets.yaml" \
|
||||
| sops encrypt --filename-override secrets.yaml \
|
||||
--input-type yaml --output-type yaml \
|
||||
--age $SOPS_PUBLIC_KEY \
|
||||
--output final-nix-config/etc/nixos/secrets/secrets.yaml
|
||||
|
||||
echo -e "\n✅ Writing correct ips to configuration.nix..."
|
||||
sed -i "s|HOME_SERVER_IP|${HOME_SERVER_IP}|g" final-nix-config/etc/nixos/misc/networking.nix
|
||||
sed -i "s|HOME_ROUTER_IP|${HOME_ROUTER_IP}|g" final-nix-config/etc/nixos/misc/networking.nix
|
||||
@@ -392,6 +378,20 @@ files_generation() {
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo -e "\n✅ Generating sops-nix keys..."
|
||||
ssh-to-age -private-key -i final-nix-config/home/numbus-admin/.ssh/id_ed25519 > final-nix-config/var/lib/sops-nix/key.txt
|
||||
export SOPS_PUBLIC_KEY=$(age-keygen -y final-nix-config/var/lib/sops-nix/key.txt)
|
||||
|
||||
echo -e "\n✅ Generating sops-nix configuration files..."
|
||||
envsubst < templates/nix-config/sops-nix/.sops.yaml > final-nix-config/etc/nixos/.sops.yaml
|
||||
|
||||
echo -e "\n✅ Encrypting secrets in the correct file..."
|
||||
envsubst < "templates/nix-config/sops-nix/secrets.yaml" \
|
||||
| sops encrypt --filename-override secrets.yaml \
|
||||
--input-type yaml --output-type yaml \
|
||||
--age $SOPS_PUBLIC_KEY \
|
||||
--output final-nix-config/etc/nixos/secrets/secrets.yaml
|
||||
}
|
||||
|
||||
disk_config_generation() {
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
settings = {
|
||||
keyFile = "/etc/secrets/disks/content-${j}";
|
||||
allowDiscards = ${ALLOW_DISCARDS:-false};
|
||||
options = [ "noauto" ];
|
||||
crypttabExtraOpts = "nofail";
|
||||
};
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "xfs";
|
||||
mountpoint = "/mnt/content-${j}";
|
||||
mountOptions = [ "noauto" "nofail" ];
|
||||
mountOptions = [ "nofail" "defaults" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
settings = {
|
||||
keyFile = "/etc/secrets/disks/parity-${j}";
|
||||
allowDiscards = ${ALLOW_DISCARDS:-false};
|
||||
options = [ "noauto" ];
|
||||
crypttabExtraOpts = "nofail";
|
||||
};
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "xfs";
|
||||
mountpoint = "/mnt/parity-${j}";
|
||||
mountOptions = [ "noauto" "nofail" ];
|
||||
mountOptions = [ "nofail" "defaults" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user