diff --git a/.gitignore b/.gitignore index b2910b34..f71d6f0a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ matrix.json result result-* .direnv +*.raw *.iso *.tar *.tar.gz diff --git a/machines/thatcher/README.md b/machines/thatcher/README.md new file mode 100644 index 00000000..d446d3a9 --- /dev/null +++ b/machines/thatcher/README.md @@ -0,0 +1,5 @@ +# `thatcher` + +This is a VPS with glauca.digital. + +Since it is a networking device, and networking devices are named after demons, and it is in Britain, it is therefore named after the well-known British demon, Margaret Thatcher. diff --git a/machines/thatcher/configuration.nix b/machines/thatcher/configuration.nix new file mode 100644 index 00000000..b8b72b49 --- /dev/null +++ b/machines/thatcher/configuration.nix @@ -0,0 +1,52 @@ +inputs: +{ config, pkgs, lib, modulesPath, ... }: +let + rootGPUID = "fce194cc-1e7e-40e6-9164-41f7ffdaddad"; + rootFSUID = "5a713012-c18f-4b4f-b900-137c5739c854"; +in with lib; { + imports = [ inputs.self.nixosModules.server ]; + + astral = { + tailscale.enable = mkForce false; + monitoring-node.scrapeTransport = "https"; + }; + + networking = { + hostName = "thatcher"; + domain = "h.astrid.tech"; + }; + + fileSystems."/" = mkForce { + device = "/dev/disk/by-uuid/${rootFSUID}"; + fsType = "xfs"; + autoResize = true; + }; + + boot = { + growPartition = true; + kernelParams = [ "console=tty0" ]; + loader.grub.device = lib.mkDefault "/dev/vda"; + loader.timeout = lib.mkDefault 0; + initrd.availableKernelModules = [ "uas" ]; + }; + + system.build.raw = mkForce + (import "${toString modulesPath}/../lib/make-disk-image.nix" { + inherit lib config pkgs rootFSUID rootGPUID; + diskSize = "auto"; + format = "raw"; + }); + + system.build.test-simple-vm = pkgs.writeShellScriptBin "test-simple-vm" '' + cat ${config.system.build.raw} > test.raw + truncate -s 4G test.raw + ${pkgs.qemu}/bin/qemu-kvm \ + -smp 2 \ + -m 2G \ + -drive if=virtio,format=raw,file=test.raw \ + -netdev user,id=mynet0,net=192.168.76.0/24,dhcpstart=192.168.76.9,hostfwd=tcp::2222-:22 \ + -net nic,model=e1000,macaddr=00:20:91:84:25:7f,netdev=mynet0 + ''; + + time.timeZone = "US/Pacific"; +} diff --git a/machines/thatcher/machine-info.nix b/machines/thatcher/machine-info.nix new file mode 100644 index 00000000..d6c16a25 --- /dev/null +++ b/machines/thatcher/machine-info.nix @@ -0,0 +1 @@ +{ arch = "x86_64-linux"; }