auto: bootstrapping sparky

This commit is contained in:
Sam 2024-05-26 21:26:19 +01:00
parent 767c6ac5aa
commit dbbd032191
4 changed files with 13 additions and 14 deletions

View File

@ -155,11 +155,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1716711219, "lastModified": 1716736760,
"narHash": "sha256-TnZETiQPXbyT5mdCHMOyrJnx2+BwroMBRrguciz1vEo=", "narHash": "sha256-h3RmnNknKYtVA+EvUSra6QAwfZjC2q1G8YA7W0gat8Y=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "05e6ba83eb3585ce0aff7b41e4bd0e317d05ad4a", "rev": "5d151429e1e79107acf6d06dcc5ace4e642ec239",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -228,11 +228,11 @@
"nix-secrets": { "nix-secrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1716735171, "lastModified": 1716755172,
"narHash": "sha256-xHshDVHKC4KICpe9vyLF7KHG1eAOczlLh5O8afCq87s=", "narHash": "sha256-os5wQsYjysS9Fd28GegNim+OOE3WoK5ETDYSaFMqd14=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "042f6242e61c00d5a2e7b05464762d8f62fb736a", "rev": "6772ccd68afefc0b456625112b4ca4bb65a3aa76",
"revCount": 48, "revCount": 58,
"type": "git", "type": "git",
"url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git"
}, },
@ -300,11 +300,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1716733566, "lastModified": 1716746631,
"narHash": "sha256-Zu0fn7bC+M/LwOOkR1RmeoOuCIbvvFwuqTldVBVe4WY=", "narHash": "sha256-0/G9FQaVm321BoCKREwRqr4l93ZwtvW+4x8gjN67bWs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "8212bf1cd2d2dfe6ba521dd8c65a13b67e562d1a", "rev": "9697385115fe557468b2ddcbd1277602b3e58d5e",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -10,8 +10,8 @@ in
# Disk configuration # Disk configuration
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
#(import ../common/disks/luks-btrfs-subvolumes.nix { device = "/dev/vda" ; }) (import ../common/disks/luks-btrfs-subvolumes.nix { device = "/dev/vda" ; })
(import ../common/disks/std-disk-config.nix { device = "/dev/vda" ; }) #(import ../common/disks/std-disk-config.nix { device = "/dev/vda" ; })
../common/optional/btrfs-impermanence.nix ../common/optional/btrfs-impermanence.nix
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence

View File

@ -2,7 +2,6 @@
{ {
boot.initrd.postDeviceCommands = lib.mkAfter '' boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp mkdir /btrfs_tmp
mount /dev/root_vg/root /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots mkdir -p /btrfs_tmp/old_roots
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S") timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")

View File

@ -70,7 +70,7 @@ echo "$luks_secret" > /tmp/luks_secret.key
cd "$HOME/nixos" cd "$HOME/nixos"
git add . && git commit -m "auto: bootstrapping $hostname" && git push git add . && git commit -m "auto: bootstrapping $hostname" && git push
SHELL=/bin/sh nix run github:nix-community/nixos-anywhere -- --extra-files "$temp_ssh" --disk-encryption-keys /tmp/luks_secret.key /tmp/luks_secret.key --flake .#"$config" root@"$ip" -i "$HOME/.ssh/id_ed25519" SHELL=/bin/sh nix run github:nix-community/nixos-anywhere/242444d228636b1f0e89d3681f04a75254c29f66 -- --extra-files "$temp_ssh" --disk-encryption-keys /tmp/luks_secret.key /tmp/luks_secret.key --flake .#"$config" root@"$ip" -i "$HOME/.ssh/id_ed25519"
[ $? != 0 ] && echo "Error installing Nixos" && exit 1 [ $? != 0 ] && echo "Error installing Nixos" && exit 1
## Delete keys from local known_hosts ## Delete keys from local known_hosts