3 Commits

Author SHA1 Message Date
ahtlon
d4ef6381a0 i don't know if this should be used
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 4m9s
Since only passing though the ssh dir doesn't work, the host would be polluted by all the other hosts writing to etc
2025-01-18 17:39:28 +01:00
ahtlon
c416f27c81 add note to docs 2025-01-18 16:35:34 +01:00
ahtlon
0d61107515 Try constant test keys 2025-01-18 16:34:24 +01:00
5 changed files with 12 additions and 40 deletions

View File

@@ -44,6 +44,9 @@ sudo mkdir -p /var/lib/microvms/durruti/{var,etc}
# alternatively u can run the vm in interactive mode (maybe stop the microvm@durruti.service first)
microvm -r durruti
#if you get an error like "Error booting VM: VmBoot(DeviceManager(CreateVirtioFs(VhostUserConnect)))", try starting the virtio service manually
sudo systemctl start microvm-virtiofsd@{host}.service
# after u made changes to the microvm update and restart the vm
microvm -uR durruti

View File

@@ -56,11 +56,11 @@ let
socket = "store.socket";
}
{
source = "/var/lib/microvms/${hostName}/etc";
source = "/var/lib/microvms/test/etc/";
mountPoint = "/etc";
tag = "etc";
tag = "etcssh";
proto = "virtiofs";
socket = "etc.socket";
socket = "etcssh.socket";
}
{
source = "/var/lib/microvms/${hostName}/var";

View File

@@ -20,7 +20,6 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
let
sops = sops-nix.packages."${pkgs.system}";
microvmpkg = microvm.packages."${pkgs.system}";
installed = builtins.attrNames self.packages."${pkgs.system}".scripts;
in
pkgs.mkShell {
sopsPGPKeyDirs = [
@@ -38,13 +37,11 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
pkgs.mdbook
microvmpkg.microvm
];
packages = builtins.map (pkgName: self.packages."${pkgs.system}".scripts.${pkgName}) installed;
shellHook = ''echo "Available scripts: ${builtins.concatStringsSep " " installed}"'';
};
packages = {
scripts.remote-install = pkgs.writeShellScriptBin "remote-install" (builtins.readFile ./scripts/remote-install-encrypt.sh);
scripts.boot-unlock = pkgs.writeShellScriptBin "boot-unlock" (builtins.readFile ./scripts/unlock-boot.sh);
remote-install = pkgs.writeShellScriptBin "remote-install" (builtins.readFile ./scripts/remote-install-encrypt.sh);
boot-unlock = pkgs.writeShellScriptBin "boot-unlock" (builtins.readFile ./scripts/unlock-boot.sh);
docs = pkgs.stdenv.mkDerivation {
name = "malobeo-docs";
phases = [ "buildPhase" ];

View File

@@ -1,4 +1,5 @@
set -o errexit
set -o nounset
set -o pipefail
if [ $# -lt 2 ]; then
@@ -8,21 +9,6 @@ if [ $# -lt 2 ]; then
exit 1
fi
if [ ! -e flake.nix ]
then
echo "flake.nix not found. Searching down."
while [ ! -e flake.nix ]
do
if [ $PWD = "/" ]
then
echo "Found root. Aborting."
exit 1
else
cd ..
fi
done
fi
hostname=$1
ipaddress=$2

View File

@@ -4,33 +4,19 @@ set -o pipefail
sshoptions="-o StrictHostKeyChecking=no -o ServerAliveInterval=1 -o ServerAliveCountMax=1 -p 222 -T"
HOSTNAME=$1
if [ ! -e flake.nix ]
then
echo "flake.nix not found. Searching down."
while [ ! -e flake.nix ]
do
if [ $PWD = "/" ]
then
echo "Found root. Aborting."
exit 1
else
cd ..
fi
done
fi
echo
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
if [ $# = 1 ]
then
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
echo "$diskkey" | ssh $sshoptions root@$HOSTNAME-initrd "systemd-tty-ask-password-agent" #storage
echo "$diskkey" | ssh $sshoptions root@$HOSTNAME-initrd "systemd-tty-ask-password-agent" #root
elif [ $# = 2 ]
then
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
IP=$2
echo "$diskkey" | ssh $sshoptions root@$IP "systemd-tty-ask-password-agent" #storage
echo "$diskkey" | ssh $sshoptions root@$IP "systemd-tty-ask-password-agent" #root