Skip to content

Commit

Permalink
more ill-fated attempts?
Browse files Browse the repository at this point in the history
  • Loading branch information
ifd3f committed Mar 25, 2024
1 parent 8b3c9b1 commit d818805
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 10 deletions.
2 changes: 1 addition & 1 deletion machines/boop/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# `xn--vp9h` (pronounced 🤓)
# boop

another server for applications and compute and stuff
7 changes: 2 additions & 5 deletions machines/boop/boot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ in {

# because we want to be able to decrypt host keys over SSH
boot.initrd.network = {
udhcpc = {
enable = true;
extraArgs = [ "-i" constants.mgmt_if ];
};
enable = true;
udhcpc.enable = true;
postCommands = ''
ip addr
'';
ssh = {
enable = true;
port = 2222;
hostKeys = [ ./initrd/ssh_host_rsa_key ./initrd/ssh_host_ed25519_key ];
authorizedKeys = inputs.self.lib.sshKeyDatabase.users.astrid;
};
Expand Down
28 changes: 28 additions & 0 deletions machines/boop/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -euxo pipefail

mkdisks() {
zpool create rpool mirror /dev/disk/by-id/nvme-eui.6479a7869ad03b89 /dev/disk/by-id/nvme-eui.6479a7869ad04a16
zfs create -o encryption=on -o keylocation=prompt -o keyformat=passphrase rpool/enc
zfs set mountpoint=none rpool
zfs set compression=on rpool
for pool in rpool/enc/var rpool/enc/etc rpool/enc/tmp rpool/enc/home rpool/nix; do
zfs create -o mountpoint=legacy $pool
done
zfs list
}

mountdisks() {
mount -t tmpfs -osize=256M,mode=755 rootfs /mnt
mount -t zfs -o x-mount.mkdir rpool/enc/tmp /mnt/tmp
mount -t zfs -o x-mount.mkdir rpool/nix /mnt/nix
mount -t zfs -o x-mount.mkdir rpool/enc/var /mnt/var
mount -t zfs -o x-mount.mkdir rpool/enc/etc /mnt/etc
mount -t zfs -o x-mount.mkdir rpool/enc/home /mnt/home
mount -o x-mount.mkdir /dev/disk/by-uuid/D30E-26C7 /mnt/boot
}

runinstall() {
nixos-install --no-channel-copy --option substituters "" $@
}
1 change: 1 addition & 0 deletions machines/boop/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ with lib; {

astral = {
users.alia.enable = true;
users.astrid.enable = true;
virt = {
docker.enable = true;
libvirt.enable = true;
Expand Down
1 change: 1 addition & 0 deletions machines/boop/fs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
fileSystems."/" = {
device = "rootfs";
fsType = "tmpfs";
options = [ "defaults" "size=256M" "mode=755" ];
};

fileSystems."/tmp" = {
Expand Down
8 changes: 4 additions & 4 deletions nix/nixos-modules/roles/server.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ with lib; {
boot.kernelPackages = pkgs.linuxKernel.packages.linux_hardened;

# Enable SSH in initrd for debugging
boot.initrd.network.ssh = {
enable = true;
authorizedKeys = [ inputs.self.lib.sshKeyDatabase.users.astrid ];
};
# boot.initrd.network.ssh = {
# enable = true;
# authorizedKeys = [ inputs.self.lib.sshKeyDatabase.users.astrid ];
# };

astral = {
acme.enable = true;
Expand Down

0 comments on commit d818805

Please sign in to comment.