auto: bootstrapping sparky

This commit is contained in:
Sam 2024-05-22 17:31:06 +01:00
parent b3b8e178e1
commit 02b9de7372
2 changed files with 2 additions and 1 deletions

View File

@ -8,7 +8,7 @@ in
users.users.media = {
isNormalUser = true;
shell = pkgs.zsh; # default shell
#hashedPasswordFile = sopsHashedPasswordFile;
hashedPasswordFile = sopsHashedPasswordFile;
password = "nixos";
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);

View File

@ -81,6 +81,7 @@ chmod 644 "$temp/persist/etc/ssh/ssh_host_ed25519_key.pub"
# Install Nixos to target
cd "$HOME/nixos"
git add . && git commit -m "auto: bootstrapping $hostname"
SHELL=/bin/sh nix run github:nix-community/nixos-anywhere -- --extra-files "$temp" --flake .#"$config" root@"$ip" -i "$HOME/.ssh/id_ed25519"
[ $? != 0 ] && echo "Error installing Nixos" && exit 1